Class: Unicodeout_SampleFrame

Inherits:
TkFrame
  • Object
show all
Defined in:
sample/demos-en/unicodeout.rb,
sample/demos-jp/unicodeout.rb

Constant Summary collapse

@@font =
$font

Instance Method Summary collapse

Constructor Details

#initialize(base) ⇒ Unicodeout_SampleFrame

@@font = ‘Helvetica 14’ @@font = ‘Courier 12’ @@font = ‘clearlyu 16’ @@font = ‘fixed 12’ @@font = ‘Times 12’ @@font = ‘Newspaper 12’ @@font = ‘century schoolbook 12’



68
69
70
71
# File 'sample/demos-en/unicodeout.rb', line 68

def initialize(base)
  super(base)
  grid_columnconfig(1, :weight=>1)
end

Instance Method Details

#add_sample(lang, *args) ⇒ Object



73
74
75
76
77
78
79
80
81
82
# File 'sample/demos-en/unicodeout.rb', line 73

def add_sample(lang, *args)
  sample_txt = Tk::UTF8_String(args.join(''))
  l = TkLabel.new(self, :font=>@@font, :text=>lang+':',
                  :anchor=>:nw, :pady=>0)
  #s = TkLabel.new(self, :font=>@@font, :text=>sample_txt,
  s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt,
                  :anchor=>:nw, :width=>30, :pady=>0)
  Tk.grid(l, s, :sticky=>:ew, :pady=>0)
  l.grid_config(:padx, '1m')
end