diff options
Diffstat (limited to 'ext/tk/sample/tkmsgcat-load_tk.rb')
-rw-r--r-- | ext/tk/sample/tkmsgcat-load_tk.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ext/tk/sample/tkmsgcat-load_tk.rb b/ext/tk/sample/tkmsgcat-load_tk.rb index 45d68e4e0b..703f471e19 100644 --- a/ext/tk/sample/tkmsgcat-load_tk.rb +++ b/ext/tk/sample/tkmsgcat-load_tk.rb @@ -14,7 +14,7 @@ col_proc = TkComm.install_bind(proc{|w, color, frame, label| TkComm.window(frame).background(color) Tk.update TkComm.window(label).text( - msgcat.mc("%1$s:: %2$s", 'Color', + msgcat.mc("%1$s:: %2$s", 'Color', color.capitalize)) w.flash; w.flash Tk.callback_break; @@ -22,7 +22,7 @@ col_proc = TkComm.install_bind(proc{|w, color, frame, label| del_proc = TkComm.install_cmd(proc{top_win.destroy; top_win = nil}) -err_proc = TkComm.install_cmd(proc{fail(RuntimeError, +err_proc = TkComm.install_cmd(proc{fail(RuntimeError, msgcat.mc('Application Error'))}) show_sample = proc{|loc| @@ -36,10 +36,10 @@ show_sample = proc{|loc| pack(:pady=>10, :padx=>10) } - lbl = TkLabel.new(top_win, :text=>msgcat.mc("%1$s:: %2$s", + lbl = TkLabel.new(top_win, :text=>msgcat.mc("%1$s:: %2$s", 'Color', '')).pack(:anchor=>'w') - bg = TkFrame.new(top_win).pack(:ipadx=>20, :ipady=>10, + bg = TkFrame.new(top_win).pack(:ipadx=>20, :ipady=>10, :expand=>true, :fill=>:both) TkFrame.new(bg){|f| @@ -48,7 +48,7 @@ show_sample = proc{|loc| bind('ButtonRelease-1', col_proc, "#{col} #{bg.path} #{lbl.path}") }.pack(:fill=>:x) =begin - TkButton.new(f, :text=>msgcat.mc(col), + TkButton.new(f, :text=>msgcat.mc(col), :command=>proc{ bg.background col lbl.text msgcat.mc("%1$s:: %2$s", 'Color', col.capitalize) @@ -58,17 +58,17 @@ show_sample = proc{|loc| }.pack(:anchor=>'center', :pady=>15) TkFrame.new(top_win){|f| - TkButton.new(f, :text=>msgcat.mc('Delete'), + TkButton.new(f, :text=>msgcat.mc('Delete'), :command=>del_proc).pack(:side=>:right, :padx=>5) - TkButton.new(f, :text=>msgcat.mc('Error'), + TkButton.new(f, :text=>msgcat.mc('Error'), :command=>err_proc).pack(:side=>:left, :padx=>5) =begin - TkButton.new(f, :text=>msgcat.mc('Delete'), + TkButton.new(f, :text=>msgcat.mc('Delete'), :command=>proc{ top_win.destroy top_win = nil }).pack(:side=>:right, :padx=>5) - TkButton.new(f, :text=>msgcat.mc('Error'), + TkButton.new(f, :text=>msgcat.mc('Error'), :command=>proc{ fail RuntimeError, msgcat.mc('Application Error') }).pack(:side=>:left, :padx=>5) @@ -83,7 +83,7 @@ show_sample = proc{|loc| TkLabel.new(:text=>"Please click a locale.").pack(:padx=>5, :pady=>3) TkFrame.new{|f| - TkButton.new(f, :text=>msgcat.mc('Exit'), + TkButton.new(f, :text=>msgcat.mc('Exit'), :command=>proc{exit}).pack(:side=>:right, :padx=>5) }.pack(:side=>:bottom, :fill=>:x) @@ -106,7 +106,7 @@ lbox.bind('ButtonRelease-1'){|ev| lbox.insert('end', 'default') -Dir.entries(msgcat_dir).sort.each{|f| +Dir.entries(msgcat_dir).sort.each{|f| if f =~ /^(.*).msg$/ lbox.insert('end', $1) end |