Index: ext/tk/sample/tkmsgcat-load_rb.rb =================================================================== --- ext/tk/sample/tkmsgcat-load_rb.rb (revision 23917) +++ ext/tk/sample/tkmsgcat-load_rb.rb (working copy) @@ -15,7 +15,7 @@ TkComm.window(frame).background(color) Tk.update TkComm.window(label).text( - msgcat["%1$s:: %2$s", 'Color', + msgcat["%1$s:: %2$s", 'Color', color.capitalize]) w.flash; w.flash Tk.callback_break; @@ -23,7 +23,7 @@ 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['Application Error'])}) show_sample = proc{|loc| @@ -38,10 +38,10 @@ pack(:pady=>10, :padx=>10) } - lbl = TkLabel.new(top_win, :text=>msgcat["%1$s:: %2$s", + lbl = TkLabel.new(top_win, :text=>msgcat["%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| @@ -53,9 +53,9 @@ }.pack(:anchor=>'center', :pady=>15) TkFrame.new(top_win){|f| - TkButton.new(f, :text=>msgcat['Delete'], + TkButton.new(f, :text=>msgcat['Delete'], :command=>del_proc).pack(:side=>:right, :padx=>5) - TkButton.new(f, :text=>msgcat['Error'], + TkButton.new(f, :text=>msgcat['Error'], :command=>err_proc).pack(:side=>:left, :padx=>5) }.pack(:side=>:bottom, :fill=>:x) @@ -67,7 +67,7 @@ TkLabel.new(:text=>"Please click a locale.").pack(:padx=>5, :pady=>3) TkFrame.new{|f| - TkButton.new(f, :text=>msgcat['Exit'], + TkButton.new(f, :text=>msgcat['Exit'], :command=>proc{exit}).pack(:side=>:right, :padx=>5) }.pack(:side=>:bottom, :fill=>:x) @@ -90,7 +90,7 @@ 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 Index: ext/tk/sample/propagate.rb =================================================================== --- ext/tk/sample/propagate.rb (revision 23917) +++ ext/tk/sample/propagate.rb (working copy) @@ -3,7 +3,7 @@ TkLabel.new(:text=>"Please click the bottom frame").pack -f = TkFrame.new(:width=>400, :height=>100, :background=>'yellow', +f = TkFrame.new(:width=>400, :height=>100, :background=>'yellow', :relief=>'ridge', :borderwidth=>5).pack # TkPack.propagate(f, false) # <== important!! Index: ext/tk/sample/encstr_usage.rb =================================================================== --- ext/tk/sample/encstr_usage.rb (revision 23917) +++ ext/tk/sample/encstr_usage.rb (working copy) @@ -13,12 +13,12 @@ src_str = IO.readlines(File.join(File.dirname(__FILE__),'iso2022-kr.txt')).join -t1.insert('end', +t1.insert('end', "use neither Tk::EncodedString class nor Tk.encoding= method\n\n") t1.insert('end', src_str) enc_str = Tk::EncodedString(src_str, 'iso2022-kr') -t2.insert('end', +t2.insert('end', "use Tk::EncodedString class (Tk.encoding => '#{Tk.encoding}')\n\n") t2.insert('end', enc_str) Index: ext/tk/sample/multi-ip_sample2.rb =================================================================== --- ext/tk/sample/multi-ip_sample2.rb (revision 23917) +++ ext/tk/sample/multi-ip_sample2.rb (working copy) @@ -14,7 +14,7 @@ sleep s TkButton.new(:text=>'b2: p $SAFE', :command=>proc{p $SAFE}).pack(:fill=>:x) sleep s - TkButton.new(:text=>'b3: p MultiTkIp.ip_name', + TkButton.new(:text=>'b3: p MultiTkIp.ip_name', :command=>proc{p MultiTkIp.ip_name}).pack(:fill=>:x) sleep s TkButton.new(:text=>'EXIT', :command=>proc{exit}).pack(:fill=>:x) Index: ext/tk/sample/figmemo_sample.rb =================================================================== --- ext/tk/sample/figmemo_sample.rb (revision 23917) +++ ext/tk/sample/figmemo_sample.rb (working copy) @@ -55,14 +55,14 @@ USAGE = <:ridge, :borderwidth=>@border, - :selectborderwidth=>@selectborder, + @entry = TkEntry.new(self, :relief=>:ridge, :borderwidth=>@border, + :selectborderwidth=>@selectborder, :highlightthickness=>0) @entry.bind('Return'){@state.value = 0} @@ -131,7 +131,7 @@ x = w.canvasx(x) y = w.canvasy(y) tag = nil - w.find_overlapping(x - @overlap_d, y - @overlap_d, + w.find_overlapping(x - @overlap_d, y - @overlap_d, x + @overlap_d, y + @overlap_d).find{|item| ! (item.tags.find{|name| if name =~ /^(#{@memo_id_head}\d+)$/ @@ -161,8 +161,8 @@ def _state1(x,y) # set center @mode = 1 - @target = TkcOval.new(self, - [canvasx(x), canvasy(y)], [canvasx(x), canvasy(y)], + @target = TkcOval.new(self, + [canvasx(x), canvasy(y)], [canvasx(x), canvasy(y)], :outline=>@col, :width=>3, :tags=>[@memo_id_tag]) @items << @target @mark = [x,y] @@ -175,16 +175,16 @@ @mode = 2 r = Integer(Math.sqrt((x-@mark[0])**2 + (y-@mark[1])**2)) - @target.coords([canvasx(@mark[0] - r), canvasy(@mark[1] - r)], + @target.coords([canvasx(@mark[0] - r), canvasy(@mark[1] - r)], [canvasx(@mark[0] + r), canvasy(@mark[1] + r)]) end def _state3(x,y) # set line start @mode = 3 - @target = TkcLine.new(self, - [canvasx(x), canvasy(y)], [canvasx(x), canvasy(y)], - :arrow=>:first, :arrowshape=>[10, 14, 5], + @target = TkcLine.new(self, + [canvasx(x), canvasy(y)], [canvasx(x), canvasy(y)], + :arrow=>:first, :arrowshape=>[10, 14, 5], :fill=>@col, :tags=>[@memo_id_tag]) @items << @target @mark = [x, y] @@ -196,7 +196,7 @@ def _state4(x,y) # create line @mode = 4 - @target.coords([canvasx(@mark[0]), canvasy(@mark[1])], + @target.coords([canvasx(@mark[0]), canvasy(@mark[1])], [canvasx(x), canvasy(y)]) end @@ -232,8 +232,8 @@ @entry.value = '' @entry.configure(:justify=>justify, :font=>@font, :foreground=>@col) - ewin = TkcWindow.new(self, [canvasx(x)+dx, canvasy(y)+dy], - :window=>@entry, :state=>:normal, :anchor=>anchor, + ewin = TkcWindow.new(self, [canvasx(x)+dx, canvasy(y)+dy], + :window=>@entry, :state=>:normal, :anchor=>anchor, :tags=>[@memo_id_tag]) @entry.focus @@ -243,9 +243,9 @@ ewin.delete - @target = TkcText.new(self, [canvasx(x), canvasy(y)], - :anchor=>anchor, :justify=>justify, - :fill=>@col, :font=>@font, :text=>@entry.value, + @target = TkcText.new(self, [canvasx(x), canvasy(y)], + :anchor=>anchor, :justify=>justify, + :fill=>@col, :font=>@font, :text=>@entry.value, :tags=>[@memo_id_tag]) _state0() @@ -305,9 +305,9 @@ end filetypes = [ - ['GIF Files', '.gif'], - ['GIF Files', [], 'GIFF'], - ['PPM Files', '.ppm'], + ['GIF Files', '.gif'], + ['GIF Files', [], 'GIFF'], + ['PPM Files', '.ppm'], ['PGM Files', '.pgm'] ] @@ -339,7 +339,7 @@ begin canvas.load_photo(fpath) rescue => e - Tk.messageBox(:icon=>'error', :type=>'ok', + Tk.messageBox(:icon=>'error', :type=>'ok', :message=>"Fail to read '#{fpath}'.\n#{e.message}") end @@ -354,11 +354,11 @@ initname = fname.value if initname != '-' initname = File.basename(initname, File.extname(initname)) - fpath = Tk.getSaveFile(:filetypes=>[ ['Text Files', '.txt'], - ['ALL Files', '*'] ], + fpath = Tk.getSaveFile(:filetypes=>[ ['Text Files', '.txt'], + ['ALL Files', '*'] ], :initialfile=>initname) else - fpath = Tk.getSaveFile(:filetypes=>[ ['Text Files', '.txt'], + fpath = Tk.getSaveFile(:filetypes=>[ ['Text Files', '.txt'], ['ALL Files', '*'] ]) end return if fpath.empty? @@ -366,7 +366,7 @@ begin fid = open(fpath, 'w') rescue => e - Tk.messageBox(:icon=>'error', :type=>'ok', + Tk.messageBox(:icon=>'error', :type=>'ok', :message=>"Fail to open '#{fname.value}'.\n#{e.message}") end @@ -384,24 +384,24 @@ initname = fname.value if initname != '-' initname = File.basename(initname, File.extname(initname)) - fpath = Tk.getSaveFile(:filetypes=>[ ['Postscript Files', '.ps'], - ['ALL Files', '*'] ], + fpath = Tk.getSaveFile(:filetypes=>[ ['Postscript Files', '.ps'], + ['ALL Files', '*'] ], :initialfile=>initname) else - fpath = Tk.getSaveFile(:filetypes=>[ ['Postscript Files', '.ps'], + fpath = Tk.getSaveFile(:filetypes=>[ ['Postscript Files', '.ps'], ['ALL Files', '*'] ]) end return if fpath.empty? bbox = canvas.bbox('all') - canvas.postscript(:file=>fpath, :x=>bbox[0], :y=>bbox[1], + canvas.postscript(:file=>fpath, :x=>bbox[0], :y=>bbox[1], :width=>bbox[2] - bbox[0], :height=>bbox[3] - bbox[1]) end # -------------------------------- def quit(canvas) - ret = Tk.messageBox(:icon=>'warning', :type=>'okcancel', - :default=>'cancel', + ret = Tk.messageBox(:icon=>'warning', :type=>'okcancel', + :default=>'cancel', :message=>'Realy quit? ') exit if ret == 'ok' end @@ -413,11 +413,11 @@ # create canvas frame canvas = PhotoCanvas.new(root).pack(:fill=>:both, :expand=>true) usage_frame = TkFrame.new(root, :relief=>:ridge, :borderwidth=>2) -hide_btn = TkButton.new(usage_frame, :text=>'hide usage', - :font=>{:size=>8}, :pady=>1, +hide_btn = TkButton.new(usage_frame, :text=>'hide usage', + :font=>{:size=>8}, :pady=>1, :command=>proc{usage_frame.unpack}) hide_btn.pack(:anchor=>'e', :padx=>5) -usage = TkLabel.new(usage_frame, :text=>PhotoCanvas::USAGE, +usage = TkLabel.new(usage_frame, :text=>PhotoCanvas::USAGE, :font=>'Helvetica 8', :justify=>:left).pack show_usage = proc{ @@ -426,20 +426,20 @@ fname = TkVariable.new('-') f = TkFrame.new(root, :relief=>:sunken, :borderwidth=>1).pack(:fill=>:x) -label = TkLabel.new(f, :textvariable=>fname, - :font=>{:size=>-12, :weight=>:bold}, +label = TkLabel.new(f, :textvariable=>fname, + :font=>{:size=>-12, :weight=>:bold}, :anchor=>'w').pack(:side=>:left, :fill=>:x, :padx=>10) # create menu mspec = [ - [ ['File', 0], - ['Show Usage', proc{show_usage.call}, 5], - '---', - ['Open Image File', proc{open_file(canvas, fname)}, 0], - ['Save Memo Texts', proc{save_memo(canvas, fname)}, 0], - '---', - ['Save Postscript', proc{ps_print(canvas, fname)}, 5], - '---', + [ ['File', 0], + ['Show Usage', proc{show_usage.call}, 5], + '---', + ['Open Image File', proc{open_file(canvas, fname)}, 0], + ['Save Memo Texts', proc{save_memo(canvas, fname)}, 0], + '---', + ['Save Postscript', proc{ps_print(canvas, fname)}, 5], + '---', ['Quit', proc{quit(canvas)}, 0] ] ] Index: ext/tk/sample/tkrttimer.rb =================================================================== --- ext/tk/sample/tkrttimer.rb (revision 23917) +++ ext/tk/sample/tkrttimer.rb (working copy) @@ -8,24 +8,24 @@ f1 = TkFrame.new(:borderwidth=>2, :relief=>:ridge) f1.pack(:side=>:bottom, :fill=>:both) TkLabel.new(f1, :text=>'use TkTimer (TkAfter) class').pack(:anchor=>:center) -label1 = TkLabel.new(:parent=>f1, :relief=>:raised, +label1 = TkLabel.new(:parent=>f1, :relief=>:raised, :width=>10).pack(:fill=>:both) f2 = TkFrame.new(:borderwidth=>2, :relief=>:ridge) f2.pack(:side=>:bottom, :fill=>:both) TkLabel.new(f2, :text=>'use TkRTTimer class').pack -label2 = TkLabel.new(:parent=>f2, :relief=>:raised, +label2 = TkLabel.new(:parent=>f2, :relief=>:raised, :width=>10).pack(:fill=>:both) TkLabel.new(:padx=>10, :pady=>5, :justify=>'left', :text=><2*@size, :height=>2*@size, + @c = TkCanvas.new(:width=>2*@size, :height=>2*@size, :scrollregion=>[-@size, -@size, @size, @size] ).pack(:fill=>:both, :expand=>true) @@ -59,26 +59,26 @@ def _create_marks @mark_tag = TkcTag.new(@c) - TkcLine.new(@c, 0, -0.90*@size, 0, -0.85*@size, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, 0, -0.90*@size, 0, -0.85*@size, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@mark_color) - TkcLine.new(@c, 0.90*@size, 0, 0.85*@size, 0, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, 0.90*@size, 0, 0.85*@size, 0, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@mark_color) - TkcLine.new(@c, 0, 0.90*@size, 0, 0.85*@size, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, 0, 0.90*@size, 0, 0.85*@size, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@mark_color) - TkcLine.new(@c, -0.90*@size, 0, -0.85*@size, 0, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, -0.90*@size, 0, -0.85*@size, 0, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@mark_color) - TkcText.new(@c, [0, -0.92*@size], :text=>0, + TkcText.new(@c, [0, -0.92*@size], :text=>0, :anchor=>'s', :fill=>@mark_color) - TkcText.new(@c, [0.92*@size, 0], :text=>@clock.div(4), + TkcText.new(@c, [0.92*@size, 0], :text=>@clock.div(4), :anchor=>'w', :fill=>@mark_color) - TkcText.new(@c, [0, 0.92*@size], :text=>@clock.div(2), + TkcText.new(@c, [0, 0.92*@size], :text=>@clock.div(2), :anchor=>'n', :fill=>@mark_color) - TkcText.new(@c, [-0.92*@size, 0], :text=>@clock.div(4)*3, + TkcText.new(@c, [-0.92*@size, 0], :text=>@clock.div(4)*3, :anchor=>'e', :fill=>@mark_color) [30.0, 60.0].each{|angle| @@ -92,17 +92,17 @@ x2 = 0.85*x_base y2 = 0.85*y_base - TkcLine.new(@c, x1, y1, x2, y2, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, x1, y1, x2, y2, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@mark_color) - TkcLine.new(@c, x1, -y1, x2, -y2, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, x1, -y1, x2, -y2, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@mark_color) - TkcLine.new(@c, -x1, y1, -x2, y2, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, -x1, y1, -x2, y2, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@mark_color) - TkcLine.new(@c, -x1, -y1, -x2, -y2, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, -x1, -y1, -x2, -y2, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@mark_color) x3 = 0.92*x_base @@ -114,13 +114,13 @@ dh = angle.to_i/30 end - TkcText.new(@c, x3, -y3, :text=>dh, + TkcText.new(@c, x3, -y3, :text=>dh, :anchor=>'sw', :fill=>@mark_color) - TkcText.new(@c, x3, y3, :text=>@clock.div(2)-dh, + TkcText.new(@c, x3, y3, :text=>@clock.div(2)-dh, :anchor=>'nw', :fill=>@mark_color) - TkcText.new(@c, -x3, y3, :text=>@clock.div(2)+dh, + TkcText.new(@c, -x3, y3, :text=>@clock.div(2)+dh, :anchor=>'ne', :fill=>@mark_color) - TkcText.new(@c, -x3, -y3, :text=>@clock-dh, + TkcText.new(@c, -x3, -y3, :text=>@clock-dh, :anchor=>'se', :fill=>@mark_color) } @@ -136,17 +136,17 @@ x2 = 0.875*x_base y2 = 0.875*y_base - TkcLine.new(@c, x1, y1, x2, y2, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, x1, y1, x2, y2, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@submark_color) - TkcLine.new(@c, x1, -y1, x2, -y2, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, x1, -y1, x2, -y2, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@submark_color) - TkcLine.new(@c, -x1, y1, -x2, y2, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, -x1, y1, -x2, y2, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@submark_color) - TkcLine.new(@c, -x1, -y1, -x2, -y2, - :tags=>[@tag, @mark_tag], + TkcLine.new(@c, -x1, -y1, -x2, -y2, + :tags=>[@tag, @mark_tag], :width=>@mark_width, :fill=>@submark_color) } end @@ -162,48 +162,48 @@ second_hand_width = 1 # 0.4*@cdot_size @hour_hand_coords = [ - [0, -0.5*@cdot_size], - [hour_hand_width, -0.5*@cdot_size-hour_hand_width], - [hour_hand_width, -hour_hand_len+hour_hand_width], - [0, -hour_hand_len], - [-hour_hand_width, -hour_hand_len+hour_hand_width], - [-hour_hand_width, -0.5*@cdot_size-hour_hand_width], + [0, -0.5*@cdot_size], + [hour_hand_width, -0.5*@cdot_size-hour_hand_width], + [hour_hand_width, -hour_hand_len+hour_hand_width], + [0, -hour_hand_len], + [-hour_hand_width, -hour_hand_len+hour_hand_width], + [-hour_hand_width, -0.5*@cdot_size-hour_hand_width], ] @minute_hand_coords = [ - [0, -0.5*@cdot_size], - [minute_hand_width, -0.5*@cdot_size - minute_hand_width], - [minute_hand_width, -minute_hand_len+minute_hand_width], - [0, -minute_hand_len], - [-minute_hand_width, -minute_hand_len+minute_hand_width], - [-minute_hand_width, -0.5*@cdot_size-minute_hand_width], + [0, -0.5*@cdot_size], + [minute_hand_width, -0.5*@cdot_size - minute_hand_width], + [minute_hand_width, -minute_hand_len+minute_hand_width], + [0, -minute_hand_len], + [-minute_hand_width, -minute_hand_len+minute_hand_width], + [-minute_hand_width, -0.5*@cdot_size-minute_hand_width], ] @second_hand_coords = [ - [0, -0.5*@cdot_size], - [second_hand_width, -0.5*@cdot_size - second_hand_width], - [second_hand_width, -second_hand_len+second_hand_width], - [0, -second_hand_len], - [-second_hand_width, -second_hand_len+second_hand_width], - [-second_hand_width, -0.5*@cdot_size-second_hand_width], + [0, -0.5*@cdot_size], + [second_hand_width, -0.5*@cdot_size - second_hand_width], + [second_hand_width, -second_hand_len+second_hand_width], + [0, -second_hand_len], + [-second_hand_width, -second_hand_len+second_hand_width], + [-second_hand_width, -0.5*@cdot_size-second_hand_width], ] - @hour_hand = TkcPolygon.new(@c, @hour_hand_coords, - :tags=>[@tag, @hand_tag], - :outline=>@hour_hand_color, + @hour_hand = TkcPolygon.new(@c, @hour_hand_coords, + :tags=>[@tag, @hand_tag], + :outline=>@hour_hand_color, :fill=>@hour_hand_color) - @minute_hand = TkcPolygon.new(@c, @minute_hand_coords, - :tags=>[@tag, @hand_tag], - :outline=>@minute_hand_color, + @minute_hand = TkcPolygon.new(@c, @minute_hand_coords, + :tags=>[@tag, @hand_tag], + :outline=>@minute_hand_color, :fill=>@minute_hand_color) - @second_hand = TkcPolygon.new(@c, @second_hand_coords, - :tags=>[@tag, @hand_tag], - :outline=>@second_hand_color, + @second_hand = TkcPolygon.new(@c, @second_hand_coords, + :tags=>[@tag, @hand_tag], + :outline=>@second_hand_color, :fill=>@second_hand_color) - @center_dot = TkcOval.new(@c, - [-@cdot_size, -@cdot_size], - [@cdot_size, @cdot_size], + @center_dot = TkcOval.new(@c, + [-@cdot_size, -@cdot_size], + [@cdot_size, @cdot_size], :outline=>@cdot_color, :fill=>@cdot_color) end private :_create_hands @@ -269,8 +269,8 @@ extent = -span/2.0 end - pie = TkcArc.new(@c, @circle_coords, :tags=>[@tag], - :outline=>'black', 'fill'=>color, + pie = TkcArc.new(@c, @circle_coords, :tags=>[@tag], + :outline=>'black', 'fill'=>color, :start=>start, :extent=>extent) _raise_hands _raise_marks Index: ext/tk/sample/safe-tk.rb =================================================================== --- ext/tk/sample/safe-tk.rb (revision 23917) +++ ext/tk/sample/safe-tk.rb (working copy) @@ -7,7 +7,7 @@ TkLabel.new(:text=>'This is the Default Master Ipnterpreter').pack(:padx=>5, :pady=>3) TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack(:pady=>3) -TkFrame.new(:borderwidth=>2, :height=>3, +TkFrame.new(:borderwidth=>2, :height=>3, :relief=>:sunken).pack(:fill=>:x, :expand=>true, :padx=>10, :pady=>7) @@ -19,17 +19,17 @@ puts "\n---- create procs ----------" puts 'x = proc{p [\'proc x\', "$SAFE==#{$SAFE}"]; exit}' x = proc{p ['proc x', "$SAFE==#{$SAFE}"]; exit} -TkLabel.new(:text=>'x = proc{p [\'proc x\', "$SAFE==#{$SAFE}"]; exit}', +TkLabel.new(:text=>'x = proc{p [\'proc x\', "$SAFE==#{$SAFE}"]; exit}', :anchor=>:w).pack(:fill=>:x) puts 'y = proc{|label| p [\'proc y\', "$SAFE==#{$SAFE}", label]; label.text($SAFE)}' y = proc{|label| p ['proc y', "$SAFE==#{$SAFE}", label]; label.text($SAFE)} -TkLabel.new(:text=>'y = proc{|label| p [\'proc y\', "$SAFE==#{$SAFE}", label]; label.text($SAFE)}', +TkLabel.new(:text=>'y = proc{|label| p [\'proc y\', "$SAFE==#{$SAFE}", label]; label.text($SAFE)}', :anchor=>:w).pack(:fill=>:x) puts 'z = proc{p [\'proc z\', "$SAFE==#{$SAFE}"]; exit}' z = proc{p ['proc z', "$SAFE==#{$SAFE}"]; exit} -TkLabel.new(:text=>'z = proc{p [\'proc z\', "$SAFE==#{$SAFE}"]; exit}', +TkLabel.new(:text=>'z = proc{p [\'proc z\', "$SAFE==#{$SAFE}"]; exit}', :anchor=>:w).pack(:fill=>:x) puts "\n---- call 1st eval_proc ----------" @@ -42,12 +42,12 @@ # TkLabel.new(f, :text=>" (<-- 'lbl' widget is here)").pack(:side=>:right) l = TkLabel.new(f).pack(:side=>:right) - TkButton.new(:text=>':command=>proc{l.text($SAFE)}', + TkButton.new(:text=>':command=>proc{l.text($SAFE)}', :command=>proc{l.text($SAFE)}).pack(:fill=>:x, :padx=>5) TkButton.new(:text=>':command=>x', :command=>x).pack(:fill=>:x, :padx=>5) - TkButton.new(:text=>':command=>proc{exit}', + TkButton.new(:text=>':command=>proc{exit}', :command=>proc{exit}).pack(:fill=>:x, :padx=>5) - TkFrame.new(:borderwidth=>2, :height=>3, + TkFrame.new(:borderwidth=>2, :height=>3, :relief=>:sunken).pack(:fill=>:x, :expand=>true, :padx=>10, :pady=>7) l # return the label widget @@ -62,19 +62,19 @@ f = TkFrame.new.pack TkLabel.new(f, :text=>"$SAFE == ").pack(:side=>:left) l = TkLabel.new(f, :text=>$SAFE).pack(:side=>:right) - TkButton.new(:text=>':command=>proc{l.text($SAFE)}', - :command=>proc{l.text($SAFE)}).pack(:fill=>:x, + TkButton.new(:text=>':command=>proc{l.text($SAFE)}', + :command=>proc{l.text($SAFE)}).pack(:fill=>:x, :padx=>5) - TkButton.new(:text=>':command=>proc{y.call(l)}', - :command=>proc{y.call(l)}).pack(:fill=>:x, + TkButton.new(:text=>':command=>proc{y.call(l)}', + :command=>proc{y.call(l)}).pack(:fill=>:x, :padx=>5) TkButton.new(:text=>':command=>proc{Thread.new(l, &y).value}', :command=>proc{ Thread.new(l, &y).value }).pack(:fill=>:x, :padx=>5) - TkButton.new(:text=>':command=>proc{z.call}', + TkButton.new(:text=>':command=>proc{z.call}', :command=>proc{z.call}).pack(:fill=>:x, :padx=>5) - TkFrame.new(:borderwidth=>2, :height=>3, + TkFrame.new(:borderwidth=>2, :height=>3, :relief=>:sunken).pack(:fill=>:x, :expand=>true, :padx=>10, :pady=>7) }) @@ -85,15 +85,15 @@ f = TkFrame.new.pack TkLabel.new(f, :text=>"$SAFE == ").pack(:side=>:left) l = TkLabel.new(f, :text=>$SAFE).pack(:side=>:right) - TkButton.new(:text=>":command=>proc{y.call(l)}", + TkButton.new(:text=>":command=>proc{y.call(l)}", :command=>proc{y.call(l)}).pack(:fill=>:x, :padx=>5) binding ', binding) p ip.eval_str(" - TkButton.new(:text=>':command=>proc{ l.text = $SAFE }', + TkButton.new(:text=>':command=>proc{ l.text = $SAFE }', :command=>proc{ l.text = $SAFE }).pack(:fill=>:x, :padx=>5) - TkFrame.new(:borderwidth=>2, :height=>3, + TkFrame.new(:borderwidth=>2, :height=>3, :relief=>:sunken).pack(:fill=>:x, :expand=>true, :padx=>10, :pady=>7) ", bind) @@ -106,7 +106,7 @@ TkLabel.new(:text=>"3rd and 4th eval_proc : $SAFE == #{$SAFE}").pack } p ip.eval_proc{ - TkButton.new(:text=>':command=>proc{ lbl.text = $SAFE }', + TkButton.new(:text=>':command=>proc{ lbl.text = $SAFE }', :command=>proc{ lbl.text = $SAFE }).pack(:fill=>:x, :padx=>5) } Index: ext/tk/sample/tktree.rb =================================================================== --- ext/tk/sample/tktree.rb (revision 23917) +++ ext/tk/sample/tktree.rb (working copy) @@ -3,10 +3,10 @@ # # see # -# Note: optional argument '-font' of the Tcl library is changed to -# 'itemfont' on this Ruby library, because of avoiding font -# operation trouble in 'initialize' method ( see the following -# test script ). +# Note: optional argument '-font' of the Tcl library is changed to +# 'itemfont' on this Ruby library, because of avoiding font +# operation trouble in 'initialize' method ( see the following +# test script ). # ########################################################################## require 'tk' @@ -68,9 +68,9 @@ if __FILE__ == $0 TkLabel.new(:text=><:ridge, :justify=>:left).pack - This is a sample to use a Tcl library script on Ruby/Tk. - This sample loads tktree.tcl (see ) - and calls functions of the Tcl script. + This is a sample to use a Tcl library script on Ruby/Tk. + This sample loads tktree.tcl (see ) + and calls functions of the Tcl script. EOL items = %w(/group1/item1 /group1/item2 /group1/subgroup/item1 /group2/item1 /item1) @@ -79,14 +79,14 @@ tr1.focus items.each{|item| - tr1.newitem(item, + tr1.newitem(item, :command=>proc{Tk.messageBox(:message=>"#{item} executed")}) } f = TkFrame.new.pack(:expand=>true, :fill=>:both) - tr2 = TkTree.new(f, :bg=>'black', #:itemfont=>{:family=>'Times', :size=>14}, - :textcolor=>'red', :bd=>4, :relief=>:ridge, - :selectbackground=>'darkBlue', :selectforeground=>'yellow', + tr2 = TkTree.new(f, :bg=>'black', #:itemfont=>{:family=>'Times', :size=>14}, + :textcolor=>'red', :bd=>4, :relief=>:ridge, + :selectbackground=>'darkBlue', :selectforeground=>'yellow', :selectborderwidth=>3, :linecolor=>'yellow') { yscrollbar(TkScrollbar.new(f, :width=>10).pack(:side=>:right, :fill=>:y)) xscrollbar(TkScrollbar.new(f, :width=>10).pack(:side=>:bottom, :fill=>:x)) @@ -94,8 +94,8 @@ } items.each{|item| - tr2.newitem(item, :textcolor=>'green', :image=>'', - :itemfont=>{:family=>'Times', :size=>10}, + tr2.newitem(item, :textcolor=>'green', :image=>'', + :itemfont=>{:family=>'Times', :size=>10}, :command=>proc{Tk.messageBox(:message=>"#{item} executed")}) } Index: ext/tk/sample/tkbrowse.rb =================================================================== --- ext/tk/sample/tkbrowse.rb (revision 23917) +++ ext/tk/sample/tkbrowse.rb (working copy) @@ -69,7 +69,7 @@ # Fill the listbox with a list of all the files in the directory (run # the "ls" command to get that information). -if ARGV.length>0 +if ARGV.length>0 dir = ARGV[0] else dir="." Index: ext/tk/sample/tktimer2.rb =================================================================== --- ext/tk/sample/tktimer2.rb (revision 23917) +++ ext/tk/sample/tktimer2.rb (working copy) @@ -5,7 +5,7 @@ # new notation : # * symbols are acceptable as keys or values of the option hash -# * the parent widget can be given by :parent key on the option hash +# * the parent widget can be given by :parent key on the option hash root = TkRoot.new(:title=>'timer sample') label = TkLabel.new(:parent=>root, :relief=>:raised, :width=>10) \ .pack(:side=>:bottom, :fill=>:both) @@ -19,11 +19,11 @@ } timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 }) - # ==> repeat-interval : (about) 50 ms, - # repeat : infinite (-1) times, + # ==> repeat-interval : (about) 50 ms, + # repeat : infinite (-1) times, # repeat-procedure : tick (only one, in this case) # - # ==> wait-before-call-init-proc : 0 ms, + # ==> wait-before-call-init-proc : 0 ms, # init_proc : proc{ label.text('0.00'); 0 } # # (0ms)-> init_proc ->(50ms)-> tick ->(50ms)-> tick ->.... Index: ext/tk/sample/multi-ip_sample.rb =================================================================== --- ext/tk/sample/multi-ip_sample.rb (revision 23917) +++ ext/tk/sample/multi-ip_sample.rb (working copy) @@ -85,14 +85,14 @@ TkTimer.new(2000, -1, proc{p ['safe2', safe_slave2.deleted?]}).start TkTimer.new(2000, -1, proc{p ['trusted', trusted_slave.deleted?]}).start -TkTimer.new(5000, 1, +TkTimer.new(5000, 1, proc{ safe_slave1.eval_proc{Tk.root.destroy} safe_slave1.delete print "*** The safe_slave1 is deleted by the timer.\n" }).start -TkTimer.new(10000, 1, +TkTimer.new(10000, 1, proc{ trusted_slave.eval_proc{Tk.root.destroy} trusted_slave.delete Index: ext/tk/sample/ttk_wrapper.rb =================================================================== --- ext/tk/sample/ttk_wrapper.rb (revision 23917) +++ ext/tk/sample/ttk_wrapper.rb (working copy) @@ -10,7 +10,7 @@ # parse commandline arguments ########################################################################## require 'optparse' -opt = OptionParser.new("Usage: #{$0} [options] rubytk_script" << "\n " << +opt = OptionParser.new("Usage: #{$0} [options] rubytk_script" << "\n " << "Ruby/Tk script wrapper. Use Ttk widgets as default.") opt.version = version @@ -21,7 +21,7 @@ opt.on('-l', '--list', 'list available theme names'){|v| OPTS[:list] = true} opt.on('-t', '--theme theme', 'theme name'){|v| OPTS[:theme] = v} -opt.on('-d', '--themedir themes_dir', 'directory of theme definitions'){|v| +opt.on('-d', '--themedir themes_dir', 'directory of theme definitions'){|v| OPTS[:themedir] << v } opt.on('-r', '--rubytheme rb_theme', 'theme definition file (ruby script)'){|v| @@ -42,7 +42,7 @@ Tk.default_widget_set = :Ttk rescue LoadError if OPTS[:verbose] - print "warning: fail to load 'Ttk' extension. use standard widgets.\n" + print "warning: fail to load 'Ttk' extension. use standard widgets.\n" end end @@ -53,7 +53,7 @@ ########################################################################## # define Tcl/Tk procedures for compatibility. -# those are required when want to use themes included +# those are required when want to use themes included # in "sample/tkextlib/tile/demo.rb". ########################################################################## Tk::Tile.__define_LoadImages_proc_for_compatibility__! @@ -111,7 +111,7 @@ # set theme of widget style ########################################################################## if OPTS[:list] || OPTS[:verbose] - print "supported theme names: #{Tk::Tile.themes.inspect}\n" + print "supported theme names: #{Tk::Tile.themes.inspect}\n" exit if OPTS[:list] && ARGV.empty? end print "use theme: \"#{OPTS[:theme]}\"\n" if OPTS[:theme] && OPTS[:verbose] @@ -122,7 +122,7 @@ ########################################################################## # replace $0 and $RPAGRAM_NAME ########################################################################## -# When the expand_path of the target script is long, ruby sometimes +# When the expand_path of the target script is long, ruby sometimes # fails to set the path to $0 (the path string is trimmed). # The following replaces $0 and $PROGNAME to avoid such trouble. progname_obj = $0.dup Index: ext/tk/sample/tkhello.rb =================================================================== --- ext/tk/sample/tkhello.rb (revision 23917) +++ ext/tk/sample/tkhello.rb (working copy) @@ -1,6 +1,6 @@ require "tk" -TkButton.new(nil, +TkButton.new(nil, :text => 'hello', :command => proc{print "hello\n"}).pack(:fill=>'x') TkButton.new(nil, Index: ext/tk/sample/tkfrom.rb =================================================================== --- ext/tk/sample/tkfrom.rb (revision 23917) +++ ext/tk/sample/tkfrom.rb (working copy) @@ -22,7 +22,7 @@ @body = [] while line = f.gets() $_.chop! - next if /^From / =~ line # skip From-line + next if /^From / =~ line # skip From-line break if /^$/ =~ line # end of header if /^(\S+):\s*(.*)/ =~ line @header[attr = $1.capitalize] = $2 Index: ext/tk/sample/remote-ip_sample.rb =================================================================== --- ext/tk/sample/remote-ip_sample.rb (revision 23917) +++ ext/tk/sample/remote-ip_sample.rb (working copy) @@ -3,8 +3,8 @@ puts <proc{puts 'This procesure is on the controller-ip (Ruby/Tk)'}, :text=>'print on Ruby/Tk (controller-ip)').pack(:fill=>:x)} ip.eval_proc{TkButton.new(:command=>'puts {This procesure is on the remote-ip (wish)}', :text=>'print on wish (remote-ip)').pack(:fill=>:x)} -# If your remote-ip is Ruby/Tk, you can control the remote Ruby by -# 'ruby' or 'ruby_eval' or 'ruby_cmd' on the Tk interpreter. +# If your remote-ip is Ruby/Tk, you can control the remote Ruby by +# 'ruby' or 'ruby_eval' or 'ruby_cmd' on the Tk interpreter. if ip.is_rubytk? ip.eval_proc{TkButton.new(:command=>'ruby {p 111; p Array.new(3,"ruby")}', :text=>'ruby cmd on the remote-ip').pack(:fill=>:x)} end ip.eval_proc{TkButton.new(:command=>'exit', :text=>'QUIT').pack(:fill=>:x)} -TkButton.new(:command=>proc{exit}, :text=>'QUIT', +TkButton.new(:command=>proc{exit}, :text=>'QUIT', :padx=>10, :pady=>7).pack(:padx=>10, :pady=>7) Tk.mainloop Index: ext/tk/sample/tcltklib/sample1.rb =================================================================== --- ext/tk/sample/tcltklib/sample1.rb (revision 23917) +++ ext/tk/sample/tcltklib/sample1.rb (working copy) @@ -1,5 +1,5 @@ #! /usr/local/bin/ruby -d -#! /usr/local/bin/ruby +# -*- encoding: euc-jp -*- # -d ¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤ë¤È, ¥Ç¥Ð¥Ã¥°¾ðÊó¤òɽ¼¨¤¹¤ë. # tcltk ¥é¥¤¥Ö¥é¥ê¤Î¥µ¥ó¥×¥ë Index: ext/tk/sample/tcltklib/sample2.rb =================================================================== --- ext/tk/sample/tcltklib/sample2.rb (revision 23917) +++ ext/tk/sample/tcltklib/sample2.rb (working copy) @@ -23,37 +23,37 @@ "button", "canvas", "checkbutton", "frame", "label", "pack", "update", "wm") class Othello - + EMPTY = 0 BLACK = 1 WHITE = - BLACK - + attr :in_com_turn attr :game_over - + class Board - + include Observable - + DIRECTIONS = [ [-1, -1], [-1, 0], [-1, 1], [ 0, -1], [ 0, 1], [ 1, -1], [ 1, 0], [ 1, 1] ] - + attr_accessor :com_disk - + def initialize(othello) @othello = othello reset end - + def notify_observers(*arg) if @observer_peers != nil super(*arg) end end - + def reset @data = [ [EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY], @@ -68,19 +68,19 @@ changed notify_observers end - + def man_disk return - @com_disk end - + def other_disk(disk) return - disk end - + def get_disk(row, col) return @data[row][col] end - + def reverse_to(row, col, my_disk, dir_y, dir_x) y = row x = col @@ -100,7 +100,7 @@ x -= dir_x end until y == row && x == col end - + def put_disk(row, col, disk) @data[row][col] = disk changed @@ -109,7 +109,7 @@ reverse_to(row, col, disk, *dir) end end - + def count_disk(disk) num = 0 @data.each do |rows| @@ -121,7 +121,7 @@ end return num end - + def count_point_to(row, col, my_disk, dir_y, dir_x) return 0 if @data[row][col] != EMPTY count = 0 @@ -140,7 +140,7 @@ end return 0 end - + def count_point(row, col, my_disk) count = 0 DIRECTIONS.each do |dir| @@ -148,14 +148,14 @@ end return count end - + def corner?(row, col) return (row == 0 && col == 0) || (row == 0 && col == 7) || (row == 7 && col == 0) || (row == 7 && col == 7) end - + def search(my_disk) max = 0 max_row = nil @@ -173,30 +173,30 @@ return max_row, max_col end end #--------------------------> class Board ends here - + class BoardView < TclTkWidget - + BACK_GROUND_COLOR = "DarkGreen" HILIT_BG_COLOR = "green" BORDER_COLOR = "black" BLACK_COLOR = "black" WHITE_COLOR = "white" STOP_COLOR = "red" - + attr :left attr :top attr :right attr :bottom - + class Square - + attr :oval, TRUE attr :row attr :col - + def initialize(view, row, col) @view = view - @id = @view.e("create rectangle", + @id = @view.e("create rectangle", *(view.tk_rect(view.left + col, view.top + row, view.left + col + 1, @@ -219,7 +219,7 @@ view.click_square(self) })) end - + def blink(color) @view.e("itemconfigure", @id, "-fill #{color}") $update.e() @@ -227,13 +227,13 @@ @view.e("itemconfigure", @id, "-fill #{BACK_GROUND_COLOR}") end end #-----------------------> class Square ends here - + def initialize(othello, board) super($ip, $root, $canvas) @othello = othello @board = board @board.add_observer(self) - + @squares = Array.new(8) for i in 0 .. 7 @squares[i] = Array.new(8) @@ -242,7 +242,7 @@ @top = 0.5 @right = @left + 8 @bottom = @top + 8 - + i = self.e("create rectangle", *tk_rect(@left, @top, @right, @bottom)) self.e("itemconfigure", i, "-width 1m -outline #{BORDER_COLOR} -fill #{BACK_GROUND_COLOR}") @@ -252,15 +252,15 @@ @squares[row][col] = Square.new(self, row, col) end end - + update end - + def tk_rect(left, top, right, bottom) return left.to_s + "c", top.to_s + "c", right.to_s + "c", bottom.to_s + "c" end - + def clear each_square do |square| if square.oval != nil @@ -269,7 +269,7 @@ end end end - + def draw_disk(row, col, disk) if disk == EMPTY if @squares[row][col].oval != nil @@ -278,7 +278,7 @@ end return end - + $update.e() sleep(0.05) oval = @squares[row][col].oval @@ -299,7 +299,7 @@ end self.e("itemconfigure", oval, "-outline #{color} -fill #{color}") end - + def update(row = nil, col = nil) if row && col draw_disk(row, col, @board.get_disk(row, col)) @@ -311,7 +311,7 @@ end @othello.show_point end - + def each_square @squares.each do |rows| rows.each do |square| @@ -319,7 +319,7 @@ end end end - + def click_square(square) if @othello.in_com_turn || @othello.game_over || @board.count_point(square.row, @@ -331,15 +331,15 @@ @board.put_disk(square.row, square.col, @board.man_disk) @othello.com_turn end - + private :draw_disk public :update end #----------------------> class BoardView ends here - + def initialize @msg_label = TclTkWidget.new($ip, $root, $label) $pack.e(@msg_label) - + @board = Board.new(self) @board_view = BoardView.new(self, @board) #### added by Y. Shigehiro @@ -352,39 +352,39 @@ "}") #### ¤³¤³¤Þ¤Ç $pack.e(@board_view, "-fill both -expand true") - + panel = TclTkWidget.new($ip, $root, $frame) - + @play_black = TclTkWidget.new($ip, panel, $checkbutton, "-text {com is black} -command", TclTkCallback.new($ip, proc{ switch_side })) $pack.e(@play_black, "-side left") - + quit = TclTkWidget.new($ip, panel, $button, "-text Quit -command", TclTkCallback.new($ip, proc{ exit })) $pack.e(quit, "-side right -fill x") - + reset = TclTkWidget.new($ip, panel, $button, "-text Reset -command", TclTkCallback.new($ip, proc{ reset_game })) $pack.e(reset, "-side right -fill x") - + $pack.e(panel, "-side bottom -fill x") - + # root = Tk.root $wm.e("title", $root, "Othello") $wm.e("iconname", $root, "Othello") - + @board.com_disk = WHITE @game_over = FALSE - + TclTk.mainloop end - + def switch_side if @in_com_turn @play_black.e("toggle") @@ -393,7 +393,7 @@ com_turn unless @game_over end end - + def reset_game if @board.com_disk == BLACK @board.com_disk = WHITE @@ -404,7 +404,7 @@ $wm.e("title", $root, "Othello") @game_over = FALSE end - + def com_turn @in_com_turn = TRUE $update.e() Index: ext/tk/sample/tkoptdb.rb =================================================================== --- ext/tk/sample/tkoptdb.rb (revision 23917) +++ ext/tk/sample/tkoptdb.rb (working copy) @@ -2,21 +2,21 @@ # # sample script of TkOptionDB # -# If 'LANG' environment variable's value is started by 'ja', -# then read Japanese resource data and display Japanese button text. -# In other case, read English resource data and display English text. +# If 'LANG' environment variable's value is started by 'ja', +# then read Japanese resource data and display Japanese button text. +# In other case, read English resource data and display English text. # require "tk" if __FILE__ == $0 || !TkCore::INTERP.safe? if ENV['LANG'] =~ /^ja/ # read Japanese resource - TkOptionDB.read_with_encoding(File.expand_path('resource.ja', - File.dirname(__FILE__)), + TkOptionDB.read_with_encoding(File.expand_path('resource.ja', + File.dirname(__FILE__)), 'euc-jp') else # read English resource - TkOptionDB.readfile(File.expand_path('resource.en', + TkOptionDB.readfile(File.expand_path('resource.en', File.dirname(__FILE__))) end end @@ -24,7 +24,7 @@ # 'show_msg' and 'bye_msg' procedures can be defined on BTN_CMD resource. # Those procedures are called under $SAFE==2 cmd = TkOptionDB.new_proc_class(:BTN_CMD, [:show_msg, :bye_msg], 3) { - # If you want to check resource string (str), + # If you want to check resource string (str), # please define __check_proc_string__(str) like this. class << self def __check_proc_string__(str) @@ -40,12 +40,12 @@ # following two frame widgets use same database entry TkFrame.new(:class=>'BtnFrame'){|f| pack(:padx=>5, :pady=>5) - TkButton.new(:parent=>f, :widgetname=>'hello'){ + TkButton.new(:parent=>f, :widgetname=>'hello'){ command proc{ print "($SAFE=#{$SAFE} >>>) : " cmd.show_msg(TkOptionDB.inspect) print "(<<< $SAFE=#{$SAFE})" - } + } pack(:fill=>:x, :padx=>10, :pady=>10) } TkButton.new(:command=>proc{ @@ -53,7 +53,7 @@ cmd.bye_msg print "(<<< $SAFE=#{$SAFE} ) : " exit - }, + }, :parent=>f, :widgetname=>'quit'){ pack(:fill=>:x, :padx=>10, :pady=>10) } @@ -62,12 +62,12 @@ class BtnFrame < TkFrame; end BtnFrame.new{|f| pack(:padx=>5, :pady=>5) - TkButton.new(:parent=>f, :widgetname=>'hello'){ + TkButton.new(:parent=>f, :widgetname=>'hello'){ command proc{ print "($SAFE=#{$SAFE} >>>) : " cmd.show_msg(TkOptionDB.inspect) print "(<<< $SAFE=#{$SAFE})" - } + } pack(:fill=>:x, :padx=>10, :pady=>10) } TkButton.new(:command=>proc{ @@ -75,7 +75,7 @@ cmd.bye_msg print "(<<< $SAFE=#{$SAFE})" exit - }, + }, :parent=>f, :widgetname=>'quit'){ pack(:fill=>:x, :padx=>10, :pady=>10) } @@ -84,12 +84,12 @@ # if unknown class, use default option values TkFrame.new(:class=>'BtnFrame2'){|f| pack(:padx=>5, :pady=>5) - TkButton.new(:parent=>f, :widgetname=>'hello'){ + TkButton.new(:parent=>f, :widgetname=>'hello'){ command proc{ print "($SAFE=#{$SAFE} >>>) : " cmd.show_msg(TkOptionDB.inspect) print "(<<< $SAFE=#{$SAFE})" - } + } pack(:fill=>:x, :padx=>10, :pady=>10) } TkButton.new(:command=>proc{ @@ -97,7 +97,7 @@ cmd.bye_msg print "(<<< $SAFE=#{$SAFE})" exit - }, + }, :parent=>f, :widgetname=>'quit'){ pack(:fill=>:x, :padx=>10, :pady=>10) } Index: ext/tk/sample/bindtag_sample.rb =================================================================== --- ext/tk/sample/bindtag_sample.rb (revision 23917) +++ ext/tk/sample/bindtag_sample.rb (working copy) @@ -2,18 +2,18 @@ require 'tk' TkLabel.new(:text=><:left).pack -This is a sample of bindtags and usage of -Tk.callback_break/Tk.callback_continue. -Please check the work of following buttons -(attend the difference between before/after - pressing the bottom button), and see the +This is a sample of bindtags and usage of +Tk.callback_break/Tk.callback_continue. +Please check the work of following buttons +(attend the difference between before/after + pressing the bottom button), and see the source code. EOT def set_class_bind - TkButton.bind('ButtonPress-1', + TkButton.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of TkButton class'}) - TkButton.bind('ButtonRelease-1', + TkButton.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of TkButton class'}) end @@ -23,21 +23,21 @@ r.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of root widget'}) # set 'all' binding -TkBindTag::ALL.bind('ButtonPress-1', +TkBindTag::ALL.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of the tag "all"'}) -TkBindTag::ALL.bind('ButtonRelease-1', +TkBindTag::ALL.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of the tag "all"'}) # create buttons -b1 = TkButton.new(:text=>'button-1', +b1 = TkButton.new(:text=>'button-1', :command=>proc{puts "command of button-1"}).pack -b2 = TkButton.new(:text=>'button-2', +b2 = TkButton.new(:text=>'button-2', :command=>proc{puts "command of button-2"}).pack -b3 = TkButton.new(:text=>'button-3', +b3 = TkButton.new(:text=>'button-3', :command=>proc{puts "command of button-3"}).pack -b4 = TkButton.new(:text=>'button-4', +b4 = TkButton.new(:text=>'button-4', :command=>proc{puts "command of button-4"}).pack -b5 = TkButton.new(:text=>'button-5', +b5 = TkButton.new(:text=>'button-5', :command=>proc{puts "command of button-5"}).pack # set button binding @@ -62,14 +62,14 @@ tag1.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of tag1'}) tag2 = TkBindTag.new -tag2.bind('ButtonPress-1', +tag2.bind('ButtonPress-1', proc{ puts 'bind "ButtonPress-1" of tag2' puts 'call Tk.callback_continue' Tk.callback_continue puts 'never see this message' }) -tag2.bind('ButtonRelease-1', +tag2.bind('ButtonRelease-1', proc{ puts 'bind "ButtonRelease-1" of tag2' puts 'call Tk.callback_continue' @@ -78,14 +78,14 @@ }) tag3 = TkBindTag.new -tag3.bind('ButtonPress-1', +tag3.bind('ButtonPress-1', proc{ puts 'bind "ButtonPress-1" of tag3' puts 'call Tk.callback_break' Tk.callback_break puts 'never see this message' }) -tag3.bind('ButtonRelease-1', +tag3.bind('ButtonRelease-1', proc{ puts 'bind "ButtonRelease-1" of tag3' puts 'call Tk.callback_break' @@ -117,7 +117,7 @@ b5.bindtags([tag1, TkButton, tag2, b5]) # create button to set button class binding -TkButton.new(:text=>'set binding to TkButton class', +TkButton.new(:text=>'set binding to TkButton class', :command=>proc{ puts 'call "set_class_bind"' set_class_bind Index: ext/tk/sample/menubar1.rb =================================================================== --- ext/tk/sample/menubar1.rb (revision 23917) +++ ext/tk/sample/menubar1.rb (working copy) @@ -11,21 +11,21 @@ {:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0}, '---', ['Check_A', TkVariable.new(true), 6], - {:type=>'checkbutton', :label=>'Check_B', + {:type=>'checkbutton', :label=>'Check_B', :variable=>TkVariable.new, :underline=>6}, '---', ['Radio_X', [radio_var, 'x'], 6, '', {:foreground=>'black'}], ['Radio_Y', [radio_var, 'y'], 6], ['Radio_Z', [radio_var, 'z'], 6], '---', - ['cascade', [ - ['sss', proc{p 'sss'}, 0], - ['ttt', proc{p 'ttt'}, 0], - ['uuu', proc{p 'uuu'}, 0], - ['vvv', proc{p 'vvv'}, 0], - ], - 0, '', - {:font=>'Courier 16 italic', + ['cascade', [ + ['sss', proc{p 'sss'}, 0], + ['ttt', proc{p 'ttt'}, 0], + ['uuu', proc{p 'uuu'}, 0], + ['vvv', proc{p 'vvv'}, 0], + ], + 0, '', + {:font=>'Courier 16 italic', :menu_config=>{:font=>'Times -18 bold', :foreground=>'black'}}], '---', ['Quit', proc{exit}, 0]], @@ -33,7 +33,7 @@ [['Edit', 0], ['Cut', proc{puts('Cut clicked')}, 2], ['Copy', proc{puts('Copy clicked')}, 0], - ['Paste', proc{puts('Paste clicked')}, 0]], + ['Paste', proc{puts('Paste clicked')}, 0]], [['Help', 0, {:menu_name=>'help'}], ['About This', proc{puts('Ruby/Tk menubar sample 1')}, 6]] Index: ext/tk/sample/cmd_res_test.rb =================================================================== --- ext/tk/sample/cmd_res_test.rb (revision 23917) +++ ext/tk/sample/cmd_res_test.rb (working copy) @@ -1,5 +1,5 @@ require 'tk' -TkOptionDB.readfile(File.expand_path('cmd_resource', +TkOptionDB.readfile(File.expand_path('cmd_resource', File.dirname(__FILE__))) f = TkFrame.new(:class=>'BtnFrame').pack b = TkButton.new(:parent=>f, :widgetname=>'hello').pack Index: ext/tk/sample/irbtk.rb =================================================================== --- ext/tk/sample/irbtk.rb (revision 23917) +++ ext/tk/sample/irbtk.rb (working copy) @@ -4,8 +4,8 @@ # # If you want to use 'multi-tk.rb', give option '--multi-tk'. # And if you want to use 'remote-tk.rb', give option '--remote-tk'. -# If you want both, you don't need to give both options, because -# 'remote-tk.rb' includes 'multi-tk.rb'. +# If you want both, you don't need to give both options, because +# 'remote-tk.rb' includes 'multi-tk.rb'. # ( There is no trouble even if you give both options. ) # require 'remote-tk' if ARGV.delete('--remote-tk') Index: ext/tk/sample/tktextio.rb =================================================================== --- ext/tk/sample/tktextio.rb (revision 23917) +++ ext/tk/sample/tktextio.rb (working copy) @@ -3,15 +3,15 @@ # TkTextIO class :: handling I/O stream on a TkText widget # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # -# NOTE: TkTextIO supports 'character' (not 'byte') access only. -# So, for example, TkTextIO#getc returns a character, TkTextIO#pos -# means the character position, TkTextIO#read(size) counts by +# NOTE: TkTextIO supports 'character' (not 'byte') access only. +# So, for example, TkTextIO#getc returns a character, TkTextIO#pos +# means the character position, TkTextIO#read(size) counts by # characters, and so on. -# Of course, it is available to make TkTextIO class to suuport -# 'byte' access. However, it may break multi-byte characters. +# Of course, it is available to make TkTextIO class to suuport +# 'byte' access. However, it may break multi-byte characters. # and then, displayed string on the text widget may be garbled. -# I think that it is not good on the supposed situation of using -# TkTextIO. +# I think that it is not good on the supposed situation of using +# TkTextIO. # require 'tk' require 'tk/text' @@ -24,14 +24,14 @@ OPT_DEFAULTS = { 'mode' => nil, - 'overwrite' => false, - 'text' => nil, - 'show' => :pos, - 'wrap' => 'char', - 'sync' => true, - 'prompt' => nil, - 'prompt_cmd' => nil, - 'hist_size' => 1000, + 'overwrite' => false, + 'text' => nil, + 'show' => :pos, + 'wrap' => 'char', + 'sync' => true, + 'prompt' => nil, + 'prompt_cmd' => nil, + 'hist_size' => 1000, } def create_self(keys) @@ -46,7 +46,7 @@ @buf_size = 0 @buf_max = 1024 - @write_buf_queue, @write_buf_mutex, + @write_buf_queue, @write_buf_mutex, @read_buf_queue, @read_buf_mutex = @@create_queues.call @idle_flush = TkTimer.new(:idle, 1, proc{ @flusher.run rescue nil }) @@ -87,7 +87,7 @@ def _get_io_params(keys) opts = {} - self.class.const_get(:OPT_DEFAULTS).each{|k, v| + self.class.const_get(:OPT_DEFAULTS).each{|k, v| if keys.has_key?(k) opts[k] = keys.delete(k) else @@ -261,7 +261,7 @@ Tk.callback_break end end - private :_cb_up, :_cb_down, :_cb_left, :_cb_backspace, + private :_cb_up, :_cb_down, :_cb_left, :_cb_backspace, :_cb_ctrl_a, :_cb_ctrl_u def _setup_console_bindings @@ -484,7 +484,7 @@ Thread.pass if @open[:w] || ! @write_buffer.empty? @write_buf_mutex.synchronize { - _sync_write_buf(@write_buffer) + _sync_write_buf(@write_buffer) @write_buffer[0..-1] = '' } end @@ -666,7 +666,7 @@ @txtpos.set('end - 1 char') elsif rs == '' @count_var.value # make it global - idx = tksearch_with_count([:regexp], @count_var, + idx = tksearch_with_count([:regexp], @count_var, "\n(\n)+", @txtpos, 'end - 1 char') if idx s = get(@txtpos, idx) << "\n" @@ -779,9 +779,9 @@ end def show_mode=(mode) - # define show mode when file position is changed. - # mode == :pos or "pos" or true :: see current file position. - # mode == :insert or "insert" :: see insert cursor position. + # define show mode when file position is changed. + # mode == :pos or "pos" or true :: see current file position. + # mode == :insert or "insert" :: see insert cursor position. # mode == nil or false :: do nothing # else see 'mode' position ('mode' should be text index or mark) case mode @@ -921,9 +921,9 @@ ev_loop = Thread.new{Tk.mainloop} f = TkFrame.new.pack - #tio = TkTextIO.new(f, :show=>:nil, - #tio = TkTextIO.new(f, :show=>:pos, - tio = TkTextIO.new(f, :show=>:insert, + #tio = TkTextIO.new(f, :show=>:nil, + #tio = TkTextIO.new(f, :show=>:pos, + tio = TkTextIO.new(f, :show=>:insert, :text=>">>> This is an initial text line. <<<\n\n"){ # yscrollbar(TkScrollbar.new(f).pack(:side=>:right, :fill=>:y)) pack(:side=>:left, :fill=>:both, :expand=>true) @@ -1045,12 +1045,12 @@ num = 0 # io = TkTextIO.new(:mode=>:console, :prompt=>'').pack #=begin - io = TkTextIO.new(:mode=>:console, + io = TkTextIO.new(:mode=>:console, :prompt_cmd=>proc{ s = "[#{num}]" num += 1 s - }, + }, :prompt=>'-> ').pack #=end Thread.new{loop{sleep 2; io.puts 'hoge'}} Index: ext/tk/sample/demos-jp/plot.rb =================================================================== --- ext/tk/sample/demos-jp/plot.rb (revision 23917) +++ ext/tk/sample/demos-jp/plot.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($plot_demo) && $plot_demo - $plot_demo.destroy + $plot_demo.destroy $plot_demo = nil end @@ -19,7 +19,7 @@ base_frame = TkFrame.new($plot_demo).pack(:fill=>:both, :expand=>true) # label À¸À® -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ï´Êñ¤Ê2¼¡¸µ¤Î¥×¥í¥Ã¥È¤ò´Þ¤ó¤À¥­¥ã¥ó¥Ð¥¹ widget¤Ç¤¹¡£É½¼¨¤µ¤ì¤¿ÅÀ¤ò¥Þ¥¦¥¹¥Ü¥¿¥ó1¤Ç¥É¥é¥Ã¥°¤·¤Æ¥Ç¡¼¥¿¤ò¤¤¤¸¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£"){ pack('side'=>'top') } @@ -57,45 +57,45 @@ # plot À¸À® TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2) TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2) -TkcText.new($plot_canvas, 225, 20, +TkcText.new($plot_canvas, 225, 20, 'text'=>"´Êñ¤Ê¥×¥í¥Ã¥È", 'font'=>plotFont, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) TkcLine.new($plot_canvas, x, 250, x, 245, 'width'=>2) - TkcText.new($plot_canvas, x, 254, + TkcText.new($plot_canvas, x, 254, 'text'=>10*i, 'font'=>plotFont, 'anchor'=>'n') } (0..5).each {|i| y = 250 - (i * 40) TkcLine.new($plot_canvas, 100, y, 105, y, 'width'=>2) - TkcText.new($plot_canvas, 96, y, + TkcText.new($plot_canvas, 96, y, 'text'=>"#{i*50}.0", 'font'=>plotFont, 'anchor'=>'e') } for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] x = 100 + (3*xx) y = 250 - (4*yy)/5 - item = TkcOval.new($plot_canvas, x-6, y-6, x+6, y+6, + item = TkcOval.new($plot_canvas, x-6, y-6, x+6, y+6, 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') item.addtag 'point' end -$plot_canvas.itembind('point', 'Any-Enter', +$plot_canvas.itembind('point', 'Any-Enter', proc{$plot_canvas.itemconfigure 'current','fill','red'}) -$plot_canvas.itembind('point', 'Any-Leave', +$plot_canvas.itembind('point', 'Any-Leave', proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'}) -$plot_canvas.itembind('point', '1', +$plot_canvas.itembind('point', '1', proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y") -$plot_canvas.itembind('point', 'ButtonRelease-1', +$plot_canvas.itembind('point', 'ButtonRelease-1', proc{$plot_canvas.dtag 'selected'}) -$plot_canvas.bind('B1-Motion', +$plot_canvas.bind('B1-Motion', proc{|x,y| plotMove $plot_canvas,x,y}, "%x %y") $plot = {'lastX'=>0, 'lastY'=>0} # plotDown -- -# This method is invoked when the mouse is pressed over one of the +# This method is invoked when the mouse is pressed over one of the # data points. It sets up state to allow the point to be dragged. # # Arguments: Index: ext/tk/sample/demos-jp/unicodeout.rb =================================================================== --- ext/tk/sample/demos-jp/unicodeout.rb (revision 23917) +++ ext/tk/sample/demos-jp/unicodeout.rb (working copy) @@ -8,7 +8,7 @@ # based on Tcl/Tk8.4.4 widget demos if defined?($unicodeout_demo) && $unicodeout_demo - $unicodeout_demo.destroy + $unicodeout_demo.destroy $unicodeout_demo = nil end @@ -20,8 +20,8 @@ base_frame = TkFrame.new($unicodeout_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'5.4i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'5.4i', :justify=>:left, :text=><:top) ¤³¤ì¤Ï¡¤Tk¤Ë¤ª¤±¤ëÈó²¤ÊÆÊ¸»ú½¸¹ç¤òÍѤ¤¤ë¸À¸ì¤ËÂФ¹¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Î\ ¥µ¥ó¥×¥ë¤Ç¤¹¡¥¤¿¤À¤·¡¤²¼¤Îɽ¼¨¤Ë¤ª¤¤¤Æ¤¢¤Ê¤¿¤¬¼ÂºÝ¤Ë¤É¤Î¤è¤¦¤Êɽ¼¨¤ò\ @@ -55,9 +55,9 @@ }).pack(:side=>:left, :expand=>true) } -wait_msg = TkLabel.new(base_frame, - :text=>"¥Õ¥©¥ó¥ÈÆÉ¤ß¹þ¤ß¤Î´°Î»¤Þ¤Ç" + - "¤·¤Ð¤é¤¯¤ªÂÔ¤Á²¼¤µ¤¤¡¥¡¥¡¥", +wait_msg = TkLabel.new(base_frame, + :text=>"¥Õ¥©¥ó¥ÈÆÉ¤ß¹þ¤ß¤Î´°Î»¤Þ¤Ç" + + "¤·¤Ð¤é¤¯¤ªÂÔ¤Á²¼¤µ¤¤¡¥¡¥¡¥", :font=>"Helvetica 12 italic").pack class Unicodeout_SampleFrame < TkFrame @@ -77,10 +77,10 @@ def add_sample(lang, *args) sample_txt = Tk::UTF8_String(args.join('')) - l = TkLabel.new(self, :font=>@@font, :text=>lang+':', + 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, + #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') @@ -96,23 +96,23 @@ $unicodeout_demo.cursor('watch') Tk.update -f.add_sample('Arabic', - '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94', +f.add_sample('Arabic', + '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94', '\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D') f.add_sample('Trad. Chinese', '\u4E2D\u570B\u7684\u6F22\u5B57') f.add_sample('Simpl. Chinese', '\u6C49\u8BED') -f.add_sample('Greek', - '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ', +f.add_sample('Greek', + '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ', '\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1') -f.add_sample('Hebrew', - '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ', +f.add_sample('Hebrew', + '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ', '\u05DC\u05D9\u05D0\u05E8\u05E9\u05D9') -f.add_sample('Japanese', - '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ', +f.add_sample('Japanese', + '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ', '\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA') f.add_sample('Korean', '\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00') -f.add_sample('Russian', - '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ', +f.add_sample('Russian', + '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ', '\u044F\u0437\u044B\u043A') wait_msg.destroy Index: ext/tk/sample/demos-jp/items.rb =================================================================== --- ext/tk/sample/demos-jp/items.rb (revision 23917) +++ ext/tk/sample/demos-jp/items.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($items_demo) && $items_demo - $items_demo.destroy + $items_demo.destroy $items_demo = nil end @@ -73,11 +73,11 @@ c.pack('in'=>cf, 'expand'=>'yes', 'fill'=>'both') else - c.grid('in'=>cf, 'row'=>0, 'column'=>0, + c.grid('in'=>cf, 'row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - vs.grid('row'=>0, 'column'=>1, + vs.grid('row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - hs.grid('row'=>1, 'column'=>0, + hs.grid('row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) TkGrid.columnconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) @@ -118,8 +118,8 @@ # Set up demos within each of the areas of the grid. TkcText.new(cvs, '5c', '.2c', 'text'=>'¥é¥¤¥ó', 'anchor'=>'n') -TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c', - 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt', +TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c', + 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt', 'join'=>'miter', 'tags'=>$tag_item ) TkcLine.new(cvs, '4.67c','1c','4.67c','4c', 'arrow'=>'last', 'tags'=>$tag_item) TkcLine.new(cvs, '6.33c','1c','6.33c','4c', 'arrow'=>'both', 'tags'=>$tag_item) @@ -127,38 +127,38 @@ '4.8c','8.8c','1.2c','8.2c','1.2c','8.2c','4.6c','8.6c','4.6c', '8.6c','1.4c','8.4c','1.4c','8.4c','4.4c', 'width'=>3, 'fill'=>red, 'tags'=>$tag_item ) -TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c', +TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c', 'stipple'=>'@'+[$demo_dir,'..', - 'images','gray25.xbm'].join(File::Separator), + 'images','gray25.xbm'].join(File::Separator), 'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item ) TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c', - 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round', + 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round', 'tags'=>$tag_item ) -TkcText.new(cvs, '15c', '.2c', +TkcText.new(cvs, '15c', '.2c', 'text'=>'¶ÊÀþ (³ê¤é¤«¤Ë¤Ä¤Ê¤¤¤ÀľÀþ)', 'anchor'=>'n') -TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c', +TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c', 'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item ) -TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c', +TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c', 'smooth'=>'on', 'arrow'=>'both', 'width'=>3, 'tags'=>$tag_item ) -TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c', +TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c', '16.5c','4.5c','13.5c','7.5c','12c','6c', - 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round', + 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round', 'stipple'=>'@'+[$demo_dir, '..', - 'images', 'gray25.xbm'].join(File::Separator), + 'images', 'gray25.xbm'].join(File::Separator), 'fill'=>red, 'tags'=>$tag_item ) TkcText.new(cvs, '25c', '.2c', 'text'=>'¿³Ñ·Á', 'anchor'=>'n') TkcPolygon.new(cvs, '21c','1.0c','22.5c','1.75c','24c','1.0c','23.25c','2.5c', '24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c', - 'fill'=>'green', 'outline'=>'black', 'width'=>4, + 'fill'=>'green', 'outline'=>'black', 'width'=>4, 'tags'=>$tag_item ) TkcPolygon.new(cvs, '25c','4c','25c','4c','25c','1c','26c','1c','27c','4c', '28c','1c','29c','1c','29c','4c','29c','4c', 'fill'=>red, 'smooth'=>'on', 'tags'=> $tag_item) TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c', '28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c', - '7.5c','22c','7.5c', + '7.5c','22c','7.5c', 'stipple'=>'@' + [$demo_dir, '..', 'images', 'gray25.xbm'].join(File::Separator), 'outline'=>'black', 'tags'=>$tag_item ) @@ -166,7 +166,7 @@ TkcText.new(cvs, '5c', '8.2c', 'text'=>'¶ë·Á', 'anchor'=>'n') TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c', 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) -TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c', +TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c', 'fill'=>green, 'tags'=>$tag_item ) TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'', 'stipple'=>'@'+[$demo_dir,'..', @@ -176,7 +176,7 @@ TkcText.new(cvs, '15c', '8.2c', 'text'=>'Âʱß', 'anchor'=>'n') TkcOval.new(cvs, '11c','9.5c','14c','12.5c', 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) -TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c', +TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c', 'fill'=>green, 'tags'=>$tag_item ) TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'', 'stipple'=>'@'+[$demo_dir,'..', @@ -185,40 +185,40 @@ TkcText.new(cvs, '25c', '8.2c', 'text'=>'¥Æ¥­¥¹¥È', 'anchor'=>'n') TkcRectangle.new(cvs, '22.4c','8.9c','22.6c','9.1c') -TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c', +TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c', 'text'=>'û¤¤¥Æ¥­¥¹¥È¡£¥ï¡¼¥É¥é¥Ã¥×¡¢º¸Â·¤¨¡¢¥¢¥ó¥«¡¼¤ÏËÌ(¾å)¡£¢¢¤Ï³Æ¥Æ¥­¥¹¥È¤Î¥¢¥ó¥«¡¼¥Ý¥¤¥ó¥È¤ò¼¨¤¹¡£', 'tags'=>$tag_item ) TkcRectangle.new(cvs, '25.4c','10.9c','25.6c','11.1c') -TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue, +TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue, 'text'=>"¤¤¤¯¤Ä¤«¤Î¹Ô¡£\n¤½¤ì¤¾¤ìÆÈΩ¤Ë\n¹Ô·¤¨¡£\nÁ´¤Æº¸Ã¼¤¬¥¢¥ó¥«¡¼¤µ¤ì¤Æ¤¤¤ë¡£", 'justify'=>'center', 'tags'=>$tag_item ) TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c') if $tk_version =~ /^4\.[01]/ - TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, + TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, 'stipple'=>'@' + [$demo_dir, '..', 'images', 'grey.5'].join(File::Separator), 'text'=>'Stippled characters', 'tags'=>$tag_item ) else - TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, - 'stipple'=>'gray50', 'text'=>'Stippled characters', + TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, + 'stipple'=>'gray50', 'text'=>'Stippled characters', 'tags'=>$tag_item ) end TkcText.new(cvs, '5c', '16.2c', 'text'=>'¸Ì', 'anchor'=>'n') -TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black', +TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black', 'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item) -#TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', -# 'outline'=>blue, 'start'=>135, 'extent'=>270, +#TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', +# 'outline'=>blue, 'start'=>135, 'extent'=>270, # 'outlinestipple'=>'@' + ['images', 'grey.25'].join(File::Separator), # 'tags'=>$tag_item) -TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', - 'outline'=>blue, 'start'=>135, 'extent'=>270, +TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', + 'outline'=>blue, 'start'=>135, 'extent'=>270, 'outlinestipple'=>'@'+[$demo_dir, '..', 'images','gray25.xbm'].join(File::Separator), 'tags'=>$tag_item) -TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice', - 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90, +TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice', + 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90, 'tags'=>$tag_item) TkcArc.new(cvs, '5.5c','20.5c','9.5c','23.5c', 'width'=>'4m', 'style'=>'chord', - 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270, + 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270, 'tags'=>$tag_item) TkcText.new(cvs, '15c', '16.2c', 'text'=>'¥Ó¥Ã¥È¥Þ¥Ã¥×', 'anchor'=>'n') @@ -253,17 +253,17 @@ TkButton.new(cvs) {|b| text '²¡¤·¤Æ¤Í' command proc{butPress cvs, red} - TkcWindow.new(cvs, '21c','18c', + TkcWindow.new(cvs, '21c','18c', 'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item) } TkEntry.new(cvs, 'width'=>20, 'relief'=>'sunken') {|e| insert 'end', 'ÊÔ½¸¤·¤Æ¤Í' - TkcWindow.new(cvs, '21c','21c', + TkcWindow.new(cvs, '21c','21c', 'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item) } -TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c', +TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c', 'width'=>'.5c', 'tickinterval'=>0 ) {|scl| - TkcWindow.new(cvs, '28.5c','17.5c', + TkcWindow.new(cvs, '28.5c','17.5c', 'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item) } TkcText.new(cvs, '21c', '17.9c', 'text'=>'¥Ü¥¿¥ó:', 'anchor'=>'sw') @@ -314,7 +314,7 @@ $restoreCmd.call if $restoreCmd end -# Utility methods for stroking out a rectangle and printing what's +# Utility methods for stroking out a rectangle and printing what's # underneath the rectangle's area. def itemMark(c,x,y) @@ -328,7 +328,7 @@ y = c.canvasy(y) if $areaX1 != x && $areaY1 != y c.delete 'area' - c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y, + c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y, '-outline', 'black') $areaX2 = x $areaY2 = y @@ -369,11 +369,11 @@ $lastY = y end -# Method that's invoked when the button embedded in the canvas +# Method that's invoked when the button embedded in the canvas # is invoked. def butPress(w,color) - i = TkcText.new(w, '25c', '18.1c', + i = TkcText.new(w, '25c', '18.1c', 'text'=>'¤¤¤Æ¤Æ!!', 'fill'=>color, 'anchor'=>'n') Tk.after(500, proc{w.delete i}) end Index: ext/tk/sample/demos-jp/entry1.rb =================================================================== --- ext/tk/sample/demos-jp/entry1.rb (revision 23917) +++ ext/tk/sample/demos-jp/entry1.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($entry1_demo) && $entry1_demo - $entry1_demo.destroy + $entry1_demo.destroy $entry1_demo = nil end Index: ext/tk/sample/demos-jp/clrpick.rb =================================================================== --- ext/tk/sample/demos-jp/clrpick.rb (revision 23917) +++ ext/tk/sample/demos-jp/clrpick.rb (working copy) @@ -7,7 +7,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($clrpick_demo) && $clrpick_demo - $clrpick_demo.destroy + $clrpick_demo.destroy $clrpick_demo = nil end @@ -47,7 +47,7 @@ # button À¸À® # TkButton.new($clrpick_demo, 'text'=>'ÇØ·Ê¿§¤òÀßÄê ...') {|b| Tk::Button.new($clrpick_demo, 'text'=>'ÇØ·Ê¿§¤òÀßÄê ...') {|b| - command(proc{setColor $clrpick_demo, b, 'background', + command(proc{setColor $clrpick_demo, b, 'background', ['background', 'highlightbackground']}) pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') } @@ -61,7 +61,7 @@ def setColor(w,button,name,options) w.grab initialColor = button[name] - color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w, + color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w, 'initialcolor'=>initialColor) if color != "" setColor_helper(w,options,color) Index: ext/tk/sample/demos-jp/labelframe.rb =================================================================== --- ext/tk/sample/demos-jp/labelframe.rb (revision 23917) +++ ext/tk/sample/demos-jp/labelframe.rb (working copy) @@ -9,7 +9,7 @@ if defined?($labelframe_demo) && $labelframe_demo - $labelframe_demo.destroy + $labelframe_demo.destroy $labelframe_demo = nil end @@ -22,18 +22,18 @@ base_frame = TkFrame.new($labelframe_demo).pack(:fill=>:both, :expand=>true) # Some information -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'4i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top) -TkLabelFrame ¥¦¥£¥¸¥§¥Ã¥È¤Ï´ØÏ¢¤¹¤ë widget +TkLabelFrame ¥¦¥£¥¸¥§¥Ã¥È¤Ï´ØÏ¢¤¹¤ë widget ·²¤ò¤Þ¤È¤á¤Æ¼è¤ê°·¤¦¤¿¤á¤ËÍѤ¤¤é¤ì¤Þ¤¹¡£¥é ¥Ù¥ë¤ÏÄ̾ï¤Îʸ»úÎó¤Ç¤â²¿¤é¤«¤Î¥¦¥£¥¸¥§¥Ã¥È -¤Ç¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë -Ruby ¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë Tk ¥é¥¤¥Ö¥é¥ê¤¬ +¤Ç¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë +Ruby ¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë Tk ¥é¥¤¥Ö¥é¥ê¤¬ labelframe ¥¦¥£¥¸¥§¥Ã¥È¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤ ¾ì¹ç¡¢¤³¤Î¥Ç¥â¤Ï¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤Ï¤º¤Ç¤¹¡£ ¤½¤Î¾ì¹ç¤Ë¤Ï labelframe ¥¦¥£¥¸¥§¥Ã¥È¤¬¼ÂÁõ -¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Tk +¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Tk ¤òÁȤ߹ç¤ï¤»¤Æ»î¤¹¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ EOL @@ -52,17 +52,17 @@ } # Demo area -w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both, +w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both, :expand=>true) # A group of radiobuttons in a labelframe -TkLabelFrame.new(w, :text=>'ÁªÂòÃÍ', +TkLabelFrame.new(w, :text=>'ÁªÂòÃÍ', :padx=>2, :pady=>2) {|f| grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m') v = TkVariable.new (1..4).each{|i| - TkRadiobutton.new(f, :text=>"This is value #{i}", + TkRadiobutton.new(f, :text=>"This is value #{i}", :variable=>v, :value=>i) { pack(:side=>:top, :fill=>:x, :pady=>2) } @@ -85,7 +85,7 @@ end TkLabelFrame.new(w, :pady=>2, :padx=>2){|f| - TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy, + TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy, :text=>"¥ª¥×¥·¥ç¥ó¤ò»ÈÍÑ", :padx=>0) {|cb| command proc{lfEnableButtons(f)} f.labelwidget(cb) Index: ext/tk/sample/demos-jp/mclist.rb =================================================================== --- ext/tk/sample/demos-jp/mclist.rb (revision 23917) +++ ext/tk/sample/demos-jp/mclist.rb (working copy) @@ -8,7 +8,7 @@ # based on "Id: mclist.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($mclist_demo) && $mclist_demo - $mclist_demo.destroy + $mclist_demo.destroy $mclist_demo = nil end @@ -21,8 +21,8 @@ base_frame = TkFrame.new($mclist_demo).pack(:fill=>:both, :expand=>true) ## Explanatory text -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', - :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', + :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], :text=><:x) Ttk¤È¤Ï¡¤¥Æ¡¼¥Þ»ØÄê²Äǽ¤Ê¿·¤·¤¤¥¦¥£¥¸¥§¥Ã¥È½¸¹ç¤Ç¤¹¡¥\ Ttk::Treeview¥¦¥£¥¸¥§¥Ã¥È¤Ï\ @@ -40,23 +40,23 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'mclist'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'mclist'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $mclist_demo.destroy $mclist_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) } container = Ttk::Frame.new(base_frame) -tree = Ttk::Treeview.new(base_frame, :columns=>%w(country capital currency), +tree = Ttk::Treeview.new(base_frame, :columns=>%w(country capital currency), :show=>:headings) if Tk.windowingsystem != 'aquq' vsb = tree.yscrollbar(Ttk::Scrollbar.new(base_frame)) @@ -74,20 +74,20 @@ ## The data we're going to insert data = [ - ['¥¢¥ë¥¼¥ó¥Á¥ó', '¥Ö¥¨¥Î¥¹¥¢¥¤¥ì¥¹', 'ARS'], - ['¥ª¡¼¥¹¥È¥é¥ê¥¢', '¥­¥ã¥ó¥Ù¥é', 'AUD'], - ['¥Ö¥é¥¸¥ë', '¥Ö¥é¥¸¥ê¥¢', 'BRL'], - ['¥«¥Ê¥À', '¥ª¥¿¥ï', 'CAD'], - ['Ãæ¹ñ', 'Ë̵þ', 'CNY'], - ['¥Õ¥é¥ó¥¹', '¥Ñ¥ê', 'EUR'], - ['¥É¥¤¥Ä', '¥Ù¥ë¥ê¥ó', 'EUR'], - ['¥¤¥ó¥É', '¥Ë¥å¡¼¥Ç¥ê¡¼', 'INR'], - ['¥¤¥¿¥ê¥¢', '¥í¡¼¥Þ', 'EUR'], - ['ÆüËÜ', 'Åìµþ', 'JPY'], - ['¥á¥­¥·¥³', '¥á¥­¥·¥³¥·¥Æ¥£', 'MXN'], - ['¥í¥·¥¢', '¥â¥¹¥¯¥ï', 'RUB'], - ['Æî¥¢¥Õ¥ê¥«', '¥×¥ì¥È¥ê¥¢', 'ZAR'], - ['±Ñ¹ñ', '¥í¥ó¥É¥ó', 'GBP'], + ['¥¢¥ë¥¼¥ó¥Á¥ó', '¥Ö¥¨¥Î¥¹¥¢¥¤¥ì¥¹', 'ARS'], + ['¥ª¡¼¥¹¥È¥é¥ê¥¢', '¥­¥ã¥ó¥Ù¥é', 'AUD'], + ['¥Ö¥é¥¸¥ë', '¥Ö¥é¥¸¥ê¥¢', 'BRL'], + ['¥«¥Ê¥À', '¥ª¥¿¥ï', 'CAD'], + ['Ãæ¹ñ', 'Ë̵þ', 'CNY'], + ['¥Õ¥é¥ó¥¹', '¥Ñ¥ê', 'EUR'], + ['¥É¥¤¥Ä', '¥Ù¥ë¥ê¥ó', 'EUR'], + ['¥¤¥ó¥É', '¥Ë¥å¡¼¥Ç¥ê¡¼', 'INR'], + ['¥¤¥¿¥ê¥¢', '¥í¡¼¥Þ', 'EUR'], + ['ÆüËÜ', 'Åìµþ', 'JPY'], + ['¥á¥­¥·¥³', '¥á¥­¥·¥³¥·¥Æ¥£', 'MXN'], + ['¥í¥·¥¢', '¥â¥¹¥¯¥ï', 'RUB'], + ['Æî¥¢¥Õ¥ê¥«', '¥×¥ì¥È¥ê¥¢', 'ZAR'], + ['±Ñ¹ñ', '¥í¥ó¥É¥ó', 'GBP'], ['¥¢¥á¥ê¥«', '¥ï¥·¥ó¥È¥ó D.C.', 'USD'], ] @@ -95,7 +95,7 @@ font = Ttk::Style.lookup(tree[:style], :font) cols = %w(country capital currency) cols.zip(%w(¹ñ̾ ¼óÅÔ Ä̲ß)).each{|col, name| - tree.heading_configure(col, :text=>name, + tree.heading_configure(col, :text=>name, :command=>proc{sort_by(tree, col, false)}) tree.column_configure(col, :width=>TkFont.measure(font, name)) } @@ -113,8 +113,8 @@ ## Code to do the sorting of the tree contents when clicked on def sort_by(tree, col, direction) - tree.children(nil).map!{|row| [tree.get(row, col), row.id]} . - sort(&((direction)? proc{|x, y| y <=> x}: proc{|x, y| x <=> y})) . + tree.children(nil).map!{|row| [tree.get(row, col), row.id]} . + sort(&((direction)? proc{|x, y| y <=> x}: proc{|x, y| x <=> y})) . each_with_index{|info, idx| tree.move(info[1], nil, idx)} tree.heading_configure(col, :command=>proc{sort_by(tree, col, ! direction)}) Index: ext/tk/sample/demos-jp/tree.rb =================================================================== --- ext/tk/sample/demos-jp/tree.rb (revision 23917) +++ ext/tk/sample/demos-jp/tree.rb (working copy) @@ -8,7 +8,7 @@ # based on "Id: tree.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp" if defined?($tree_demo) && $tree_demo - $tree_demo.destroy + $tree_demo.destroy $tree_demo = nil end @@ -21,8 +21,8 @@ base_frame = TkFrame.new($tree_demo).pack(:fill=>:both, :expand=>true) ## Explanatory text -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', - :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', + :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], :text=><:x) Ttk¤È¤Ï¡¤¥Æ¡¼¥Þ»ØÄê²Äǽ¤Ê¿·¤·¤¤¥¦¥£¥¸¥§¥Ã¥È½¸¹ç¤Ç¤¹¡¥\ ¤³¤Î¥µ¥ó¥×¥ë¤Ï¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¤è¤¦¤Ê³¬ÁØÅª¤Ê¥Ç¡¼¥¿½¸¹ç¤ò\ @@ -38,16 +38,16 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'tree'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'tree'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $tree_demo.destroy $tree_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -56,7 +56,7 @@ ## Code to populate the roots of the tree (can be more than one on Windows) def populate_roots(tree) TkComm.simplelist(Tk.tk_call('file', 'volumes')).sort.each{|dir| - populate_tree(tree, tree.insert(nil, :end, :text=>dir, + populate_tree(tree, tree.insert(nil, :end, :text=>dir, :values=>[dir, 'directory'])) } end @@ -69,7 +69,7 @@ tree.delete(tree.children(node)) Dir.glob("#{path}/*").sort.each{|f| type = File.ftype(f) - id = tree.insert(node, :end, + id = tree.insert(node, :end, :text=>File.basename(f), :values=>[f, type]).id if type == 'directory' ## Make it so that this node is openable @@ -95,7 +95,7 @@ end ## Create the tree and set it up -tree = Ttk::Treeview.new(base_frame, :columns=>%w(fullpath type size), +tree = Ttk::Treeview.new(base_frame, :columns=>%w(fullpath type size), :displaycolumns=>['size']) if Tk.windowingsystem != 'aqua' vsb = tree.yscrollbar(Ttk::Scrollbar.new(base_frame)) Index: ext/tk/sample/demos-jp/style.rb =================================================================== --- ext/tk/sample/demos-jp/style.rb (revision 23917) +++ ext/tk/sample/demos-jp/style.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($style_demo) && $style_demo - $style_demo.destroy + $style_demo.destroy $style_demo = nil end @@ -76,13 +76,13 @@ # when /^8.*/ # unless $style_demo_do_first # $style_demo_do_first = true -# Tk.tk_call('font', 'create', '@bigascii', +# Tk.tk_call('font', 'create', '@bigascii', # '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*') -# Tk.tk_call('font', 'create', '@smallascii', +# Tk.tk_call('font', 'create', '@smallascii', # '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*') -# Tk.tk_call('font', 'create', '@cBigFont', +# Tk.tk_call('font', 'create', '@cBigFont', # '-compound', '@bigascii @msg_knj') -# Tk.tk_call('font', 'create', '@cSmallFont', +# Tk.tk_call('font', 'create', '@cSmallFont', # '-compound', '@smallascii @kanji') # end # style_tag_big = TkTextTag.new(t, 'font'=>'@cBigFont') @@ -96,24 +96,24 @@ style_tag_raised = TkTextTag.new(t, 'relief'=>'raised', 'borderwidth'=>1) style_tag_sunken = TkTextTag.new(t, 'relief'=>'sunken', 'borderwidth'=>1) else - style_tag_color1 = TkTextTag.new(t, 'background'=>'black', + style_tag_color1 = TkTextTag.new(t, 'background'=>'black', 'foreground'=>'white') - style_tag_color2 = TkTextTag.new(t, 'background'=>'black', + style_tag_color2 = TkTextTag.new(t, 'background'=>'black', 'foreground'=>'white') - style_tag_raised = TkTextTag.new(t, 'background'=>'white', + style_tag_raised = TkTextTag.new(t, 'background'=>'white', 'relief'=>'raised', 'borderwidth'=>1) - style_tag_sunken = TkTextTag.new(t, 'background'=>'white', + style_tag_sunken = TkTextTag.new(t, 'background'=>'white', 'relief'=>'sunken', 'borderwidth'=>1) end # ¥Æ¥­¥¹¥È¥¿¥°ÀßÄê (¤½¤Î¾) if $tk_version =~ /^4\.[01]/ - style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, + style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', + 'borderwidth'=>0, 'bgstipple'=>'gray25') else - style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, + style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', + 'borderwidth'=>0, 'bgstipple'=>'gray12') end style_tag_fgstipple = TkTextTag.new(t, 'fgstipple'=>'gray50') @@ -217,9 +217,9 @@ 9. ¥Þ¡¼¥¸¥ó', style_tag_big) insert('end', '¥Æ¥­¥¹¥È¤Îº¸Â¦¤Ë;ʬ¤Ê¶õÇò¤òÃÖ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹: ') - insert('end', '¤³¤ÎÃÊÍî¤Ï¥Þ¡¼¥¸¥ó¤Î»ÈÍÑÎã¤Ç¤¹¡£¥¹¥¯¥ê¡¼¥ó', + insert('end', '¤³¤ÎÃÊÍî¤Ï¥Þ¡¼¥¸¥ó¤Î»ÈÍÑÎã¤Ç¤¹¡£¥¹¥¯¥ê¡¼¥ó', style_tag_margins) - insert('end', '¾å¤ÇÀÞ¤êÊÖ¤µ¤ì¤ÆÉ½¼¨¤µ¤ì¤Æ¤¤¤ë1¹Ô¤Î¥Æ¥­¥¹¥È¤Ç¤¹¡£', + insert('end', '¾å¤ÇÀÞ¤êÊÖ¤µ¤ì¤ÆÉ½¼¨¤µ¤ì¤Æ¤¤¤ë1¹Ô¤Î¥Æ¥­¥¹¥È¤Ç¤¹¡£', style_tag_margins) insert('end', 'º¸Â¦¤Ë¤Ï2¼ïÎà¤Î¥Þ¡¼¥¸¥ó¤ò»ý¤Á¤Þ¤¹¡£', style_tag_margins) insert('end', '1¹ÔÌܤËÂФ¹¤ë¤â¤Î¤È¡¢', style_tag_margins) @@ -241,9 +241,9 @@ insert('end', '¤Î¶õ´Ö¤òÃÖ ¤¯¤«¤ò¼¨¤·¤Þ¤¹¡£ ') - insert('end', '¤³¤ì¤é¤Î¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿ÃÊÍî¤Ï¤É¤Î¤è¤¦¤Ë', + insert('end', '¤³¤ì¤é¤Î¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿ÃÊÍî¤Ï¤É¤Î¤è¤¦¤Ë', style_tag_spacing) - insert('end', '¥¹¥Ú¡¼¥·¥ó¥°¤¬¤¬¹Ô¤ï¤ì¤ë¤Î¤«¤ò¼¨¤·¤Þ¤¹¡£', + insert('end', '¥¹¥Ú¡¼¥·¥ó¥°¤¬¤¬¹Ô¤ï¤ì¤ë¤Î¤«¤ò¼¨¤·¤Þ¤¹¡£', style_tag_spacing) insert('end', '³ÆÃÊÍî¤Ï¼ÂºÝ¤Ï¥Æ¥­¥¹¥Èwidget', style_tag_spacing) insert('end', '¤Î1¹Ô¤Ç¡¢widget¤Ë¤è¤Ã¤ÆÀÞ¤ê¾ö¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£ @@ -253,11 +253,11 @@ insert('end', '¤³¤ì¤Ë¤è¤ê¡¢ÃÊÍî¤Î´Ö¤ËÂ礭¤Ê´Ö³Ö¤¬', style_tag_spacing) insert('end', '¸ºß¤·¤Æ¤¤¤Þ¤¹¡£', style_tag_spacing) insert('end', 'Spacing2¤Ï2point¤ËÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£', style_tag_spacing) - insert('end', '¤³¤ì¤ÇÃÊÍî¤ÎÃæ¤Ë¤Û¤ó¤Î¾¯¤·´Ö³Ö¤¬Â¸ºß¤·¤Æ¤¤¤Þ¤¹¡£', + insert('end', '¤³¤ì¤ÇÃÊÍî¤ÎÃæ¤Ë¤Û¤ó¤Î¾¯¤·´Ö³Ö¤¬Â¸ºß¤·¤Æ¤¤¤Þ¤¹¡£', style_tag_spacing) insert('end', 'Spacing3¤Ï¤³¤ÎÎã¤Ç¤Ï»ÈÍѤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ ', style_tag_spacing) - insert('end', '´Ö³Ö¤¬¤É¤³¤Ë¤¢¤ë¤«¤ò¸«¤¿¤±¤ì¤Ð¡¢¤³¤ì¤é¤ÎÃÊÍî¤Î', + insert('end', '´Ö³Ö¤¬¤É¤³¤Ë¤¢¤ë¤«¤ò¸«¤¿¤±¤ì¤Ð¡¢¤³¤ì¤é¤ÎÃÊÍî¤Î', style_tag_spacing) insert('end', '¤Ê¤«¤Ç¥Æ¥­¥¹¥È¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£ÁªÂò¤Î', style_tag_spacing) insert('end', 'ȿž¤·¤¿Éôʬ¤Ë¤Ï;ʬ¤Ë¤È¤é¤ì¤¿´Ö³Ö¤¬', style_tag_spacing) Index: ext/tk/sample/demos-jp/cscroll.rb =================================================================== --- ext/tk/sample/demos-jp/cscroll.rb (revision 23917) +++ ext/tk/sample/demos-jp/cscroll.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($cscroll_demo) && $cscroll_demo - $cscroll_demo.destroy + $cscroll_demo.destroy $cscroll_demo = nil end @@ -19,7 +19,7 @@ base_frame = TkFrame.new($cscroll_demo).pack(:fill=>:both, :expand=>true) # label À¸À® -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤ä¥Þ¥¦¥¹¤Î¥Ü¥¿¥ó2 ¤Ç¥¹¥¯¥í¡¼¥ë¤Ç¤­¤ë¥­¥ã¥ó¥Ð¥¹ widget ¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£»Í³Ñ¤Î¾å¤Ç¥Ü¥¿¥ó1 ¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¤½¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬É¸½à½ÐÎϤ˽ÐÎϤµ¤ì¤Þ¤¹¡£"){ pack('side'=>'top') } @@ -53,14 +53,14 @@ end # canvas ÀßÄê -$cscroll_canvas = TkCanvas.new(base_frame, +$cscroll_canvas = TkCanvas.new(base_frame, 'relief'=>'sunken', 'borderwidth'=>2, 'scrollregion'=>['-11c', '-11c', '50c', '20c'] ) {|c| if $tk_version =~ /^4\.[01]/ - pack('expand'=>'yes', 'fill'=>'both') + pack('expand'=>'yes', 'fill'=>'both') else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, + grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') end @@ -69,18 +69,18 @@ if $tk_version =~ /^4\.[01]/ pack('side'=>'right', 'fill'=>'y') else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, + grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') end } - TkScrollbar.new(base_frame, 'orient'=>'horiz', + TkScrollbar.new(base_frame, 'orient'=>'horiz', 'command'=>proc{|*args| c.xview(*args)}) {|hs| c.xscrollcommand(proc{|first,last| hs.set first,last}) if $tk_version =~ /^4\.[01]/ - pack('side'=>'bottom', 'fill'=>'x') + pack('side'=>'bottom', 'fill'=>'x') else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, + grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') end } @@ -91,9 +91,9 @@ x = -10+3*i y = -10 (0..9).each{|j| - TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c", + TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c", 'outline'=>'black', 'fill'=>bg, 'tags'=>'rect') - TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c", + TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c", 'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text') y += 3 } @@ -104,7 +104,7 @@ $cscroll_canvas.itembind('all', '1', proc{scrollButton $cscroll_canvas}) $cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas}) $cscroll_canvas.bind('2', proc{|x,y| $cscroll_canvas.scan_mark(x,y)}, '%x %y') -$cscroll_canvas.bind('B2-Motion', +$cscroll_canvas.bind('B2-Motion', proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y') def scrollEnter(c) Index: ext/tk/sample/demos-jp/search.rb =================================================================== --- ext/tk/sample/demos-jp/search.rb (revision 23917) +++ ext/tk/sample/demos-jp/search.rb (working copy) @@ -58,13 +58,13 @@ def textToggle(cmd1,sleep1,cmd2,sleep2) sleep_list = [sleep2, sleep1] - TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep}, + TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep}, -1, cmd1, cmd2).start(sleep1) end # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($search_demo) && $search_demo - $search_demo.destroy + $search_demo.destroy $search_demo = nil end @@ -98,35 +98,35 @@ # frame À¸À® TkFrame.new(base_frame) {|f| - TkLabel.new(f, 'text'=>'¥Õ¥¡¥¤¥ë̾:', + TkLabel.new(f, 'text'=>'¥Õ¥¡¥¤¥ë̾:', 'width'=>13, 'anchor'=>'w').pack('side'=>'left') $search_fileName = TkVariable.new - TkEntry.new(f, 'width'=>40, + TkEntry.new(f, 'width'=>40, 'textvariable'=>$search_fileName) { pack('side'=>'left') bind('Return', proc{textLoadFile($search_text, $search_fileName.value) $search_string_entry.focus}) focus } - TkButton.new(f, 'text'=>'ÆÉ¤ß¹þ¤ß', - 'command'=>proc{textLoadFile($search_text, + TkButton.new(f, 'text'=>'ÆÉ¤ß¹þ¤ß', + 'command'=>proc{textLoadFile($search_text, $search_fileName.value)})\ .pack('side'=>'left', 'pady'=>5, 'padx'=>10) }.pack('side'=>'top', 'fill'=>'x') TkFrame.new(base_frame) {|f| - TkLabel.new(f, 'text'=>'¸¡º÷ʸ»úÎó:', + TkLabel.new(f, 'text'=>'¸¡º÷ʸ»úÎó:', 'width'=>13, 'anchor'=>'w').pack('side'=>'left') $search_searchString = TkVariable.new - $search_string_entry = TkEntry.new(f, 'width'=>40, + $search_string_entry = TkEntry.new(f, 'width'=>40, 'textvariable'=>$search_searchString) { pack('side'=>'left') - bind('Return', proc{textSearch($search_text, $search_searchString.value, + bind('Return', proc{textSearch($search_text, $search_searchString.value, $search_Tag)}) } - TkButton.new(f, 'text'=>'ȿž', - 'command'=>proc{textSearch($search_text, - $search_searchString.value, + TkButton.new(f, 'text'=>'ȿž', + 'command'=>proc{textSearch($search_text, + $search_searchString.value, $search_Tag)}) { pack('side'=>'left', 'pady'=>5, 'padx'=>10) } @@ -139,26 +139,26 @@ pack('side'=>'right', 'fill'=>'y') } pack('expand'=>'yes', 'fill'=>'both') -} +} # Set up display styles for text highlighting. if TkWinfo.depth($search_demo) > 1 textToggle(proc{ - $search_Tag.configure('background'=>'#ce5555', + $search_Tag.configure('background'=>'#ce5555', 'foreground'=>'white') }, - 800, + 800, proc{ $search_Tag.configure('background'=>'', 'foreground'=>'') }, 200 ) else textToggle(proc{ - $search_Tag.configure('background'=>'black', + $search_Tag.configure('background'=>'black', 'foreground'=>'white') }, - 800, + 800, proc{ $search_Tag.configure('background'=>'', 'foreground'=>'') }, Index: ext/tk/sample/demos-jp/image3.rb =================================================================== --- ext/tk/sample/demos-jp/image3.rb (revision 23917) +++ ext/tk/sample/demos-jp/image3.rb (working copy) @@ -9,7 +9,7 @@ # toplevel widget if defined?($image3_demo) && $image3_demo - $image3_demo.destroy + $image3_demo.destroy $image3_demo = nil end @@ -22,7 +22,7 @@ base_frame = TkFrame.new($image3_demo).pack(:fill=>:both, :expand=>true) -# +# def loadDir3(w) w.delete(0,'end') Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f| @@ -38,10 +38,10 @@ # Arguments: # w - Name of the toplevel window of the demo. def selectAndLoadDir3(w, lbox) - dir = Tk.chooseDirectory(:initialdir=>$dirName.value, + dir = Tk.chooseDirectory(:initialdir=>$dirName.value, :parent=>w, :mustexist=>true) if dir.length > 0 - $dirName.value = dir + $dirName.value = dir loadDir3(lbox) end end @@ -94,11 +94,11 @@ image3_df = TkLabelFrame.new(base_frame, :text=>'¥Ç¥£¥ì¥¯¥È¥ê:') -image3_ff = TkLabelFrame.new(base_frame, :text=>'¥Õ¥¡¥¤¥ë:', +image3_ff = TkLabelFrame.new(base_frame, :text=>'¥Õ¥¡¥¤¥ë:', :padx=>'2m', :pady=>'2m') image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) { pack(:side=>:left, :fill=>:y, :expand=>true) - yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y, + yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y, :expand=>true)) insert(0, *(%w(earth.gif earthris.gif teapot.ppm))) bind('Double-1', proc{|x,y| loadImage3(self, x, y)}, '%x %y') @@ -109,7 +109,7 @@ bind('Return', proc{loadDir3(image3_lbx)}) } -TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"¥Ç¥£¥ì¥¯¥È¥êÁªÂò", +TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"¥Ç¥£¥ì¥¯¥È¥êÁªÂò", :command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) { pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m') } @@ -121,7 +121,7 @@ Tk.grid(image3_df, '-', :sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f) -Tk.grid(image3_ff, image3_if, +Tk.grid(image3_ff, image3_if, :sticky=>:nw, :padx=>'1m', :pady=>'1m', :in=>image3_f) TkGrid.columnconfigure(image3_f, 1, :weight=>1) Index: ext/tk/sample/demos-jp/sayings.rb =================================================================== --- ext/tk/sample/demos-jp/sayings.rb (revision 23917) +++ ext/tk/sample/demos-jp/sayings.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($sayings_demo) && $sayings_demo - $sayings_demo.destroy + $sayings_demo.destroy $sayings_demo = nil end @@ -67,11 +67,11 @@ sayings_lbox.pack('expand'=>'yes', 'fill'=>'y') else - sayings_lbox.grid('row'=>0, 'column'=>0, + sayings_lbox.grid('row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - sv.grid('row'=>0, 'column'=>1, + sv.grid('row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - sh.grid('row'=>1, 'column'=>0, + sh.grid('row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(w, 0, 'weight'=>1, 'minsize'=>0) TkGrid.columnconfigure(w, 0, 'weight'=>1, 'minsize'=>0) Index: ext/tk/sample/demos-jp/check.rb =================================================================== --- ext/tk/sample/demos-jp/check.rb (revision 23917) +++ ext/tk/sample/demos-jp/check.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($check_demo) && $check_demo - $check_demo.destroy + $check_demo.destroy $check_demo = nil end @@ -54,7 +54,7 @@ TkButton.new(frame) { text 'ÊÑ¿ô»²¾È' command proc{ - showVars(base_frame, + showVars(base_frame, ['wipers', wipers], ['brakes', brakes], ['sober', sober]) } }.pack('side'=>'left', 'expand'=>'yes') Index: ext/tk/sample/demos-jp/radio3.rb =================================================================== --- ext/tk/sample/demos-jp/radio3.rb (revision 23917) +++ ext/tk/sample/demos-jp/radio3.rb (working copy) @@ -10,7 +10,7 @@ # toplevel widget if defined?($radio3_demo) && $radio3_demo - $radio3_demo.destroy + $radio3_demo.destroy $radio3_demo = nil end @@ -23,7 +23,7 @@ base_frame = TkFrame.new($radio3_demo).pack(:fill=>:both, :expand=>true) -# label +# label msg = TkLabel.new(base_frame) { font $font wraplength '5i' @@ -37,50 +37,50 @@ color = TkVariable.new align = TkVariable.new -# frame +# frame TkFrame.new(base_frame) {|frame| - TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), + TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - TkButton.new(frame, :text=>'ÊÑ¿ô»²¾È', - :image=>$image['view'], :compound=>:left, + TkGrid('x', + TkButton.new(frame, :text=>'ÊÑ¿ô»²¾È', + :image=>$image['view'], :compound=>:left, :command=>proc{ - showVars(base_frame, ['size', size], + showVars(base_frame, ['size', size], ['color', color], ['compound', align]) - }), - TkButton.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'radio3'}), - TkButton.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + }), + TkButton.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'radio3'}), + TkButton.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $radio3_demo $radio3_demo = nil $showVarsWin[tmppath.path] = nil tmppath.destroy - }), + }), :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) TkGrid(frame, :row=>3, :column=>0, :columnspan=>3, :sticky=>'nsew') } -# frame -f_left = TkLabelFrame.new(base_frame, 'text'=>'ʸ»ú¥µ¥¤¥º', +# frame +f_left = TkLabelFrame.new(base_frame, 'text'=>'ʸ»ú¥µ¥¤¥º', 'pady'=>2, 'padx'=>2) -f_mid = TkLabelFrame.new(base_frame, 'text'=>'¿§', +f_mid = TkLabelFrame.new(base_frame, 'text'=>'¿§', 'pady'=>2, 'padx'=>2) -f_right = TkLabelFrame.new(base_frame, 'text'=>'¥Ó¥Ã¥È¥Þ¥Ã¥×ÇÛÃÖ', +f_right = TkLabelFrame.new(base_frame, 'text'=>'¥Ó¥Ã¥È¥Þ¥Ã¥×ÇÛÃÖ', 'pady'=>2, 'padx'=>2) f_left .grid('column'=>0, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2) f_mid .grid('column'=>1, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2) f_right.grid('column'=>2, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c') -TkButton.new(base_frame, 'text'=>'¥È¥é¥¤¥¹¥Æ¡¼¥È', +TkButton.new(base_frame, 'text'=>'¥È¥é¥¤¥¹¥Æ¡¼¥È', 'command'=>proc{size.value = 'multi'; color.value = 'multi'}){ grid('column'=>2, 'row'=>2, 'pady'=>'.5c', 'padx'=>'.5c') } -# radiobutton +# radiobutton [10, 12, 14, 18, 24].each {|sz| TkRadioButton.new(f_left) { text "¥Ý¥¤¥ó¥È¥µ¥¤¥º #{sz}" @@ -103,14 +103,14 @@ }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x') } -# label = TkLabel.new(f_right, 'text'=>'¥é¥Ù¥ë', 'bitmap'=>'questhead', -label = Tk::Label.new(f_right, 'text'=>'¥é¥Ù¥ë', 'bitmap'=>'questhead', +# label = TkLabel.new(f_right, 'text'=>'¥é¥Ù¥ë', 'bitmap'=>'questhead', +label = Tk::Label.new(f_right, 'text'=>'¥é¥Ù¥ë', 'bitmap'=>'questhead', 'compound'=>'left') label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') label.height(TkWinfo.reqheight(label)) a_btn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a| - TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', - 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7, + TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', + 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7, 'command'=>proc{label.compound(align.value)}) } Index: ext/tk/sample/demos-jp/text.rb =================================================================== --- ext/tk/sample/demos-jp/text.rb (revision 23917) +++ ext/tk/sample/demos-jp/text.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($text_demo) && $text_demo - $text_demo.destroy + $text_demo.destroy $text_demo = nil end Index: ext/tk/sample/demos-jp/menu8x.rb =================================================================== --- ext/tk/sample/demos-jp/menu8x.rb (revision 23917) +++ ext/tk/sample/demos-jp/menu8x.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($menu8x_demo) && $menu8x_demo - $menu8x_demo.destroy + $menu8x_demo.destroy $menu8x_demo = nil end @@ -65,7 +65,7 @@ # ¾õÂÖɽ¼¨¤ÎÀ¸À® $menu8xstatus = TkVariable.new(" ") TkFrame.new(base_frame) {|frame| - TkLabel.new(frame, 'textvariable'=>$menu8xstatus, 'relief'=>'sunken', + TkLabel.new(frame, 'textvariable'=>$menu8xstatus, 'relief'=>'sunken', 'bd'=>1, 'font'=>['Helvetica', '10'], 'anchor'=>'w')\ .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) @@ -116,9 +116,9 @@ m.add('cascade', 'label'=>'Basic', 'menu'=>basic_menu, 'underline'=>0) add('command', 'label'=>'²¿¤â¤·¤Ê¤¤Ä¹¤¤¥¨¥ó¥È¥ê') ['A','B','C','D','E','F','G'].each{|c| - # add('command', 'label'=>"ʸ»ú \"#{c}\" ¤ò°õ»ú", 'underline'=>4, - add('command', 'label'=>"Print letter \"#{c}\" (ʸ»ú \"#{c}\" ¤ò°õ»ú)", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", + # add('command', 'label'=>"ʸ»ú \"#{c}\" ¤ò°õ»ú", 'underline'=>4, + add('command', 'label'=>"Print letter \"#{c}\" (ʸ»ú \"#{c}\" ¤ò°õ»ú)", + 'underline'=>14, 'accelerator'=>"Meta+#{c}", 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu8x_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } @@ -126,17 +126,17 @@ TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| m.add('cascade', 'label'=>'Cascades', 'menu'=>cascade_menu, 'underline'=>0) - add('command', 'label'=>'Print hello(¤³¤ó¤Ë¤Á¤Ï)', - 'command'=>proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}, + add('command', 'label'=>'Print hello(¤³¤ó¤Ë¤Á¤Ï)', + 'command'=>proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}, 'accelerator'=>"#{modifier}+H", 'underline'=>6) $menu8x_demo.bind("#{modifier}-h", proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}) - add('command', 'label'=>'Print goodbye(¤µ¤è¤¦¤Ê¤é)', - 'command'=>proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}, + add('command', 'label'=>'Print goodbye(¤µ¤è¤¦¤Ê¤é)', + 'command'=>proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}, 'accelerator'=>"#{modifier}+G", 'underline'=>6) $menu8x_demo.bind("#{modifier}-g", proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}) TkMenu.new(m, 'tearoff'=>false) {|cascade_check| - cascade_menu.add('cascade', 'label'=>'Check buttons(¥Á¥§¥Ã¥¯¥Ü¥¿¥ó)', + cascade_menu.add('cascade', 'label'=>'Check buttons(¥Á¥§¥Ã¥¯¥Ü¥¿¥ó)', 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'¥ª¥¤¥ëÅÀ¸¡', 'variable'=>oil) @@ -147,18 +147,18 @@ lights = TkVariable.new(0) add('check', 'label'=>'¥é¥¤¥ÈÅÀ¸¡', 'variable'=>lights) add('separator') - add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', - 'command'=>proc{showVars($menu8x_demo, - ['¥ª¥¤¥ëÅÀ¸¡', oil], - ['¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥óÅÀ¸¡', trans], - ['¥Ö¥ì¡¼¥­ÅÀ¸¡', brakes], + add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', + 'command'=>proc{showVars($menu8x_demo, + ['¥ª¥¤¥ëÅÀ¸¡', oil], + ['¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥óÅÀ¸¡', trans], + ['¥Ö¥ì¡¼¥­ÅÀ¸¡', brakes], ['¥é¥¤¥ÈÅÀ¸¡', lights])} ) invoke 1 invoke 3 } TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| - cascade_menu.add('cascade', 'label'=>'Radio buttons(¥é¥¸¥ª¥Ü¥¿¥ó)', + cascade_menu.add('cascade', 'label'=>'Radio buttons(¥é¥¸¥ª¥Ü¥¿¥ó)', 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new add('radio', 'label'=>'10 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>10) @@ -172,9 +172,9 @@ add('radio', 'label'=>'¥Ü¡¼¥ë¥É', 'variable'=>style, 'value'=>'bold') add('radio', 'label'=>'¥¤¥¿¥ê¥Ã¥¯', 'variable'=>style, 'value'=>'italic') add('separator') - add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', - 'command'=>proc{showVars($menu8x_demo, - ['¥Ý¥¤¥ó¥È¥µ¥¤¥º', pointSize], + add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', + 'command'=>proc{showVars($menu8x_demo, + ['¥Ý¥¤¥ó¥È¥µ¥¤¥º', pointSize], ['¥¹¥¿¥¤¥ë', style])} ) invoke 1 invoke 7 @@ -183,16 +183,16 @@ TkMenu.new(m, 'tearoff'=>false) {|icon_menu| m.add('cascade', 'label'=>'Icons', 'menu'=>icon_menu, 'underline'=>0) - add('command', + add('command', 'bitmap'=>'@'+[$demo_dir,'..', 'images','pattern.xbm'].join(File::Separator), - 'hidemargin'=>1, - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', + 'hidemargin'=>1, + 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', 'text'=>'º£¤¢¤Ê¤¿¤¬ÁªÂò¤·¤¿¥á¥Ë¥å¡¼¤Î¹àÌܤϥƥ­¥¹¥È¤Ç¤Ï¤Ê¤¯¥Ó¥Ã¥È¥Þ¥Ã¥×¤òɽ¼¨¤·¤Æ¤¤¤Þ¤·¤¿¡£¤½¤ì°Ê³°¤ÎÅÀ¤Ç¤Ï¾¤Î¥á¥Ë¥å¡¼¹àÌܤÈÊѤï¤ê¤Þ¤»¤ó¡£', - 'bitmap'=>'', 'default'=>0, + 'bitmap'=>'', 'default'=>0, 'buttons'=>'λ²ò')} ) ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, 'hidemargin'=>1, + add('command', 'bitmap'=>icon, 'hidemargin'=>1, 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) } @@ -203,7 +203,7 @@ m.add('cascade', 'label'=>'More', 'menu'=>more_menu, 'underline'=>0) [ '¥¨¥ó¥È¥ê','Ê̤Υ¨¥ó¥È¥ê','²¿¤â¤·¤Ê¤¤','¤Û¤È¤ó¤É²¿¤â¤·¤Ê¤¤', '¿ÍÀ¸¤ò°ÕµÁ¤¢¤ë¤â¤Î¤Ë' ].each{|i| - add('command', 'label'=>i, + add('command', 'label'=>i, 'command'=>proc{print "You invoked \"#{i}\"\n"}) } } @@ -211,7 +211,7 @@ TkMenu.new(m) {|colors_menu| m.add('cascade', 'label'=>'Colors', 'menu'=>colors_menu, 'underline'=>1) ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, + add('command', 'label'=>c, 'background'=>c, 'command'=>proc{print "You invoked \"#{c}\"\n"}) } } @@ -219,8 +219,8 @@ $menu8x_demo.configure('menu'=>m) } -TkMenu.bind('', - proc{|w| +TkMenu.bind('', + proc{|w| begin label = w.entrycget('active', 'label') rescue Index: ext/tk/sample/demos-jp/ctext.rb =================================================================== --- ext/tk/sample/demos-jp/ctext.rb (revision 23917) +++ ext/tk/sample/demos-jp/ctext.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($ctext_demo) && $ctext_demo - $ctext_demo.destroy + $ctext_demo.destroy $ctext_demo = nil end @@ -19,7 +19,7 @@ base_frame = TkFrame.new($ctext_demo).pack(:fill=>:both, :expand=>true) # label À¸À® -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥­¥ã¥ó¥Ð¥¹widget¤Î¥Æ¥­¥¹¥Èµ¡Ç½¤ò¥Ç¥â¤¹¤ë¤¿¤á¤Î¥Æ¥­¥¹¥Èʸ»úÎó¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥Þ¥¦¥¹¤ò»Í³Ñ¤ÎÃæ¤Ë»ý¤Ã¤Æ¤¤¤­¡¢¥¯¥ê¥Ã¥¯¤¹¤ë¤È°ÌÃÖ¤®¤áÍѤÎÅÀ¤«¤é¤ÎÁêÂаÌÃÖ¤òÊѤ¨¤¿¤ê¡¢¹Ô·¤¨¤òÊѤ¨¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Þ¤¿°Ê²¼¤Î¤è¤¦¤ÊÊÔ½¸¤Î¤¿¤á¤Î´Êñ¤Ê¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¡£ 1. ¥Þ¥¦¥¹¤ò»ý¤Ã¤Æ¤¤¤­¡¢¥¯¥ê¥Ã¥¯¤·¡¢ÆþÎϤǤ­¤Þ¤¹¡£ @@ -50,7 +50,7 @@ $ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # canvas À¸À® -$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat', +$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat', 'borderwidth'=>0, 'width'=>500, 'height'=>350) $ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both') @@ -62,7 +62,7 @@ end # canvas ÀßÄê -TkcRectangle.new($ctext_canvas, 245, 195, 255, 205, +TkcRectangle.new($ctext_canvas, 245, 195, 255, 205, 'outline'=>'black', 'fill'=>'red') ctag_text_param = { @@ -80,24 +80,24 @@ $ctag_text.bind('1', proc{|x,y| textB1Press $ctext_canvas,x,y}, "%x %y") $ctag_text.bind('B1-Motion', proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") -$ctag_text.bind('Shift-1', - proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"}, +$ctag_text.bind('Shift-1', + proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"}, "%x %y") -$ctag_text.bind('Shift-B1-Motion', +$ctag_text.bind('Shift-B1-Motion', proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") $ctag_text.bind('KeyPress', proc{|a| textInsert $ctext_canvas,a}, "%A") $ctag_text.bind('Return', proc{textInsert $ctext_canvas,"\n"}) $ctag_text.bind('Control-h', proc{textBs $ctext_canvas}) $ctag_text.bind('BackSpace', proc{textBs $ctext_canvas}) $ctag_text.bind('Delete', proc{textDel $ctext_canvas}) -$ctag_text.bind('2', proc{|x,y| textPaste $ctext_canvas, "@#{x},#{y}"}, +$ctag_text.bind('2', proc{|x,y| textPaste $ctext_canvas, "@#{x},#{y}"}, "%x %y") -# Next, create some items that allow the text's anchor position +# Next, create some items that allow the text's anchor position # to be edited. def mkTextConfig(w,x,y,option,value,color) - item = TkcRectangle.new(w, x, y, x+30, y+30, + item = TkcRectangle.new(w, x, y, x+30, y+30, 'outline'=>'black', 'fill'=>color, 'width'=>1) item.bind('1', proc{$ctag_text.configure option, value}) w.addtag_withtag('config', item) @@ -115,15 +115,15 @@ mkTextConfig $ctext_canvas, x, y+60, 'anchor', 'ne', color mkTextConfig $ctext_canvas, x+30, y+60, 'anchor', 'n', color mkTextConfig $ctext_canvas, x+60, y+60, 'anchor', 'nw', color -item = TkcRectangle.new($ctext_canvas, x+40, y+40, x+50, y+50, +item = TkcRectangle.new($ctext_canvas, x+40, y+40, x+50, y+50, 'outline'=>'black', 'fill'=>'red') item.bind('1', proc{$ctag_text.configure 'anchor', 'center'}) if $tk_version =~ /^4.*/ - TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', + TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', + 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', 'anchor'=>'s', 'fill'=>'brown') else - TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', + TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', 'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown') end @@ -137,18 +137,18 @@ mkTextConfig $ctext_canvas, x+30, y, 'justify', 'center', color mkTextConfig $ctext_canvas, x+60, y, 'justify', 'right', color if $tk_version =~ /^4.*/ - TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', + TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', + 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', 'anchor'=>'s', 'fill'=>'brown') else - TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', + TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', 'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown') end $ctext_canvas.itembind('config', 'Enter', proc{textEnter $ctext_canvas}) -$ctext_canvas.itembind('config', 'Leave', +$ctext_canvas.itembind('config', 'Leave', proc{$ctext_canvas\ - .itemconfigure('current', + .itemconfigure('current', 'fill'=>$textConfigFill)}) $textConfigFill = '' Index: ext/tk/sample/demos-jp/ttkmenu.rb =================================================================== --- ext/tk/sample/demos-jp/ttkmenu.rb (revision 23917) +++ ext/tk/sample/demos-jp/ttkmenu.rb (working copy) @@ -8,7 +8,7 @@ # based on "Id: ttkmenu.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($ttkmenu_demo) && $ttkmenu_demo - $ttkmenu_demo.destroy + $ttkmenu_demo.destroy $ttkmenu_demo = nil end @@ -20,7 +20,7 @@ base_frame = Ttk::Frame.new($ttkmenu_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) Ttk¤È¤Ï¡¤¥Æ¡¼¥Þ»ØÄê²Äǽ¤Ê¿·¤·¤¤¥¦¥£¥¸¥§¥Ã¥È½¸¹ç¤Ç¤¹¡¥\ ¤³¤ì¤Ë¤è¤ê¥Æ¡¼¥Þ¤ËÂбþ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¥¦¥£¥¸¥§¥Ã¥È¤Î¤Ò¤È¤Ä¤Ë\ @@ -45,16 +45,16 @@ Ttk::Frame.new($ttkmenu_demo) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttkmenu'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttkmenu'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttkmenu_demo.destroy $ttkmenu_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) Index: ext/tk/sample/demos-jp/ttknote.rb =================================================================== --- ext/tk/sample/demos-jp/ttknote.rb (revision 23917) +++ ext/tk/sample/demos-jp/ttknote.rb (working copy) @@ -8,7 +8,7 @@ # based on "Id: ttknote.tcl,v 1.5 2007/12/13 15:27:07 dgp Exp" if defined?($ttknote_demo) && $ttknote_demo - $ttknote_demo.destroy + $ttknote_demo.destroy $ttknote_demo = nil end @@ -22,16 +22,16 @@ Ttk::Frame.new($ttknote_demo) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttknote'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttknote'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttknote_demo.destroy $ttknote_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -40,13 +40,13 @@ base_frame = Ttk::Frame.new($ttknote_demo).pack(:fill=>:both, :expand=>true) ## Make the notebook and set up Ctrl+Tab traversal -notebook = Ttk::Notebook.new(base_frame).pack(:fill=>:both, :expand=>true, +notebook = Ttk::Notebook.new(base_frame).pack(:fill=>:both, :expand=>true, :padx=>2, :pady=>3) notebook.enable_traversal ## Popuplate the first pane f_msg = Ttk::Frame.new(notebook) -msg_m = Ttk::Label.new(f_msg, :font=>$font, :wraplength=>'5i', +msg_m = Ttk::Label.new(f_msg, :font=>$font, :wraplength=>'5i', :justify=>:left, :anchor=>'n', :text=><'¤¹¤Æ¤­¤À¡ª(Neat!)', :underline=>6, +msg_b = Ttk::Button.new(f_msg, :text=>'¤¹¤Æ¤­¤À¡ª(Neat!)', :underline=>6, :command=>proc{ neat.value = '¤¢¤¡¡¤¤½¤Î¤È¤ª¤ê¤µ¡¥¡¥¡¥' Tk.after_cancel(after_id) if after_id Index: ext/tk/sample/demos-jp/ruler.rb =================================================================== --- ext/tk/sample/demos-jp/ruler.rb (revision 23917) +++ ext/tk/sample/demos-jp/ruler.rb (working copy) @@ -18,7 +18,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($ruler_demo) && $ruler_demo - $ruler_demo.destroy + $ruler_demo.destroy $ruler_demo = nil end @@ -32,7 +32,7 @@ base_frame = TkFrame.new($ruler_demo).pack(:fill=>:both, :expand=>true) # label À¸À® -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', 'text'=>"¤³¤Î¥­¥ã¥ó¥Ð¥¹widget¤Ï¥ë¡¼¥é¡¼¤ÎÌÏ·¿¤Ç¤¹¡£¥ë¡¼¥é¡¼¤Î±¦¤Ë¤¢¤ë¤Î¤Ï¥¿¥Ö¥¹¥È¥Ã¥×¤Î°æ¸Í¤Ç¡¢¤³¤³¤«¤é°ú¤ÃÄ¥¤Ã¤Æ¤¯¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥¿¥Ö¥¹¥È¥Ã¥×¤òºî¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢¤¹¤Ç¤Ë¤¢¤ë¥¿¥Ö¥¹¥È¥Ã¥×¤òư¤«¤¹¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¥¿¥Ö¥¹¥È¥Ã¥×¤ò¾åÊý¤Þ¤¿¤Ï²¼Êý¤Ë¤«¤¹¤ì¤ÆÉ½¼¨¤µ¤ì¤ë¤Þ¤Ç¥É¥é¥Ã¥°¤¹¤ë¤È¡¢¥Þ¥¦¥¹¥Ü¥¿¥ó¤òÎ¥¤·¤¿»þ¤Ë¤½¤Î¥¿¥Ö¥¹¥È¥Ã¥×¤Ï¾Ã¤¨¤Þ¤¹¡£"){ pack('side'=>'top') } @@ -62,8 +62,8 @@ # ÃÍÀßÄê unless Struct.const_defined?("RulerInfo") - $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y, - :top, :bottom, :size, :normalStyle, + $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y, + :top, :bottom, :size, :normalStyle, :activeStyle, :deleteStyle).new end $demo_rulerInfo.grid = '.25c' @@ -75,17 +75,17 @@ $demo_rulerInfo.normalStyle = {'fill'=>'black'} if TkWinfo.depth($ruler_canvas) > 1 $demo_rulerInfo.activeStyle = {'fill'=>'red', 'stipple'=>''} - $demo_rulerInfo.deleteStyle = {'fill'=>'red', - 'stipple'=>'@'+[$demo_dir, '..', + $demo_rulerInfo.deleteStyle = {'fill'=>'red', + 'stipple'=>'@'+[$demo_dir, '..', 'images', 'gray25.xbm'].join(File::Separator)} else $demo_rulerInfo.activeStyle = {'fill'=>'black', 'stipple'=>''} - $demo_rulerInfo.deleteStyle = {'fill'=>'black', - 'stipple'=>'@'+[$demo_dir, '..', + $demo_rulerInfo.deleteStyle = {'fill'=>'black', + 'stipple'=>'@'+[$demo_dir, '..', 'images', 'gray25.xbm'].join(File::Separator)} end -TkcLine.new($ruler_canvas, +TkcLine.new($ruler_canvas, '1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1) (0..11).each{|i| x = i+1 @@ -99,21 +99,21 @@ $rulerTag_well = TkcTag.new($ruler_canvas) $ruler_canvas\ .addtag_withtag($rulerTag_well, - TkcRectangle.new($ruler_canvas, - '13.2c', '1c', '13.8c', '0.5c', - 'outline'=>'black', + TkcRectangle.new($ruler_canvas, + '13.2c', '1c', '13.8c', '0.5c', + 'outline'=>'black', 'fill'=>($ruler_canvas\ .configinfo('background'))[4]) ) $ruler_canvas\ .addtag_withtag($rulerTag_well, - rulerMkTab($ruler_canvas, - TkWinfo.pixels($ruler_canvas, '13.5c'), + rulerMkTab($ruler_canvas, + TkWinfo.pixels($ruler_canvas, '13.5c'), TkWinfo.pixels($ruler_canvas, '.65c') ) ) $rulerTag_well.bind('1', proc{|x,y| rulerNewTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.itembind('tab', '1', +$ruler_canvas.itembind('tab', '1', proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.bind('B1-Motion', +$ruler_canvas.bind('B1-Motion', proc{|x,y| rulerMoveTab($ruler_canvas,x,y)}, '%x %y') $ruler_canvas.bind('Any-ButtonRelease-1', proc{rulerReleaseTab($ruler_canvas)}) Index: ext/tk/sample/demos-jp/arrow.rb =================================================================== --- ext/tk/sample/demos-jp/arrow.rb (revision 23917) +++ ext/tk/sample/demos-jp/arrow.rb (working copy) @@ -25,65 +25,65 @@ # Create the arrow and outline. c.delete('all') - TkcLine.new(c, v.x1, v.y, v.x2, v.y, - { 'width'=>10 * v.width, - 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c], - 'arrow'=>'last' + TkcLine.new(c, v.x1, v.y, v.x2, v.y, + { 'width'=>10 * v.width, + 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c], + 'arrow'=>'last' }.update(v.bigLineStyle) ) xtip = v.x2 - 10*v.b deltaY = 10*v.c + 5*v.width - TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY, - v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y, + TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY, + v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y, 'width'=>2, 'capstyle'=>'round', 'joinstyle'=>'round') # Create the boxes for reshaping the line and arrowhead. - TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5, + TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5, {'tags'=>['box1', $arrowTag_box]}.update(v.boxStyle) ) - TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5, + TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5, {'tags'=>['box2', $arrowTag_box]}.update(v.boxStyle) ) - TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5, + TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5, {'tags'=>['box3', $arrowTag_box]}.update(v.boxStyle) ) c.itemconfigure cur, v.activeStyle if cur # Create three arrows in actual size with the same parameters TkcLine.new(c, v.x2+50, 0, v.x2+50, 1000, 'width'=>2) tmp = v.x2+100 - TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width, + TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width, 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width, + TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width, 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width, + TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width, 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - # Create a bunch of other arrows and text items showing the + # Create a bunch of other arrows and text items showing the # current dimensions. tmp = v.x2+10 - TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY, + TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY, 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x2+15, v.y-deltaY+5*v.c, 'text'=>v.c, 'anchor'=>'w') tmp = v.x1-10 - TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width, + TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width, 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x1-15, v.y, 'text'=>v.width, 'anchor'=>'e') tmp = v.y+5*v.width+10*v.c+10 - TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp, + TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp, 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x2-5*v.a, tmp+5, 'text'=>v.a, 'anchor'=>'n') tmp = tmp+25 - TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp, + TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp, 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x2-5*v.b, tmp+5, 'text'=>v.b, 'anchor'=>'n') if $tk_version =~ /^4.*/ - TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', + TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') - TkcText.new(c, v.x1, 330, + TkcText.new(c, v.x1, 330, 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]",'anchor'=>'w', 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') else - TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', + TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', 'font'=>'Helvetica 18') - TkcText.new(c, v.x1, 330, + TkcText.new(c, v.x1, 330, 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]", 'anchor'=>'w', 'font'=>'Helvetica 18') end @@ -93,7 +93,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($arrow_demo) && $arrow_demo - $arrow_demo.destroy + $arrow_demo.destroy $arrow_demo = nil end @@ -107,7 +107,7 @@ base_frame = TkFrame.new($arrow_demo).pack(:fill=>:both, :expand=>true) # label À¸À® -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', 'text'=>"¤³¤Î widget ¤Ç¡¢¥­¥ã¥ó¥Ð¥¹¤Ç»È¤ï¤ì¤ë¥é¥¤¥ó¤Ë¤Ä¤¤¤ÆÍÍ¡¹¤ÊÉý¤äÌð°õ¤ÎƬ¤Î·Á¤ò»î¤·¤Æ¤ß¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Àþ¤ÎÉý¤äÌð°õ¤Î·Á¤òÊѤ¨¤ë¤Ë¤Ï¡¢³ÈÂ礵¤ì¤¿Ìð°õ¤Ë¤Ä¤¤¤Æ¤¤¤ë 3¤Ä¤Î»Í³Ñ¤ò¥É¥é¥Ã¥°¤·¤Æ¤¯¤À¤µ¤¤¡£±¦Â¦¤ÎÌð°õ¤ÏÉáÄ̤ÎÂ礭¤µ¤Ç¤Î¥µ¥ó¥×¥ë¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£²¼¤Î¥Æ¥­¥¹¥È¤Ï¥é¥¤¥ó¥¢¥¤¥Æ¥à¤ËÂФ¹¤ëÀßÄꥪ¥×¥·¥ç¥ó¤Ç¤¹¡£"){ pack('side'=>'top') } @@ -132,14 +132,14 @@ $arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # canvas ÀßÄê -$arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350, +$arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350, 'relief'=>'sunken', 'borderwidth'=>2) $arrow_canvas.pack('expand'=>'yes', 'fill'=>'both') # ÃÍÀßÄê unless Struct.const_defined?("ArrowInfo") - $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc, - :x1, :x2, :y, :smallTips, :count, + $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc, + :x1, :x2, :y, :smallTips, :count, :bigLineStyle, :boxStyle, :activeStyle).new end $demo_arrowInfo.a = 8 @@ -157,7 +157,7 @@ $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1} $demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1} else - $demo_arrowInfo.bigLineStyle = {'fill'=>'black', + $demo_arrowInfo.bigLineStyle = {'fill'=>'black', 'stipple'=>'@'+[$demo_dir,'..','images','grey.25'].join(File::Separator)} $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1} $demo_arrowInfo.activeStyle = {'fill'=>'black','outline'=>'black','width'=>1} @@ -168,16 +168,16 @@ $arrowTag_box.bind('Leave', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.boxStyle)}) $arrowTag_box.bind('B1-Enter', proc{}) $arrowTag_box.bind('B1-Leave', proc{}) -$arrow_canvas.itembind('box1', '1', +$arrow_canvas.itembind('box1', '1', proc{$demo_arrowInfo.motionProc \ = proc{|x,y| arrowMove1 $arrow_canvas, x, y}}) -$arrow_canvas.itembind('box2', '1', +$arrow_canvas.itembind('box2', '1', proc{$demo_arrowInfo.motionProc \ = proc{|x,y| arrowMove2 $arrow_canvas, x, y}}) -$arrow_canvas.itembind('box3', '1', +$arrow_canvas.itembind('box3', '1', proc{$demo_arrowInfo.motionProc \ = proc{|x,y| arrowMove3 $arrow_canvas, x, y}}) -$arrowTag_box.bind('B1-Motion', +$arrowTag_box.bind('B1-Motion', proc{|x,y| $demo_arrowInfo.motionProc.call(x,y)}, "%x %y") $arrow_canvas.bind('Any-ButtonRelease-1', proc{arrowSetup $arrow_canvas}) Index: ext/tk/sample/demos-jp/menubu.rb =================================================================== --- ext/tk/sample/demos-jp/menubu.rb (revision 23917) +++ ext/tk/sample/demos-jp/menubu.rb (working copy) @@ -17,7 +17,7 @@ for i in rest menu.add 'radio', 'label'=>i, 'variable'=>varName end - + return menu end @@ -189,7 +189,7 @@ TkFrame.new(center) {|f| menubuttonoptions = TkVariable.new mbutton = TkMenubutton.new(f) - options = optionMenu(mbutton, menubuttonoptions, + options = optionMenu(mbutton, menubuttonoptions, 'one', 'two', 'three') mbutton.pack('side'=>'left', 'padx'=>25, 'pady'=>25) paletteColor = TkVariable.new Index: ext/tk/sample/demos-jp/textpeer.rb =================================================================== --- ext/tk/sample/demos-jp/textpeer.rb (revision 23917) +++ ext/tk/sample/demos-jp/textpeer.rb (working copy) @@ -5,7 +5,7 @@ # based on Tcl/Tk8.5.0 widget demos if defined?($textpeer_demo) && $textpeer_demo - $textpeer_demo.destroy + $textpeer_demo.destroy $textpeer_demo = nil end @@ -43,11 +43,11 @@ peer = TkText::Peer.new(txt, win, :widgetname=>"text#{cnt}") sbar = TkScrollbar.new(win, :widgetname=>"sb#{cnt}") peer.yscrollbar sbar - b1 = TkButton.new(win, :widgetname=>"clone#{cnt}", - :text=>'¥Ô¥¢(peer)¤ÎºîÀ®', + b1 = TkButton.new(win, :widgetname=>"clone#{cnt}", + :text=>'¥Ô¥¢(peer)¤ÎºîÀ®', :command=>proc{makeClone(count, win, peer)}) - b2 = TkButton.new(win, :widgetname=>"kill#{cnt}", - :text=>'¥Ô¥¢(peer)¤Î¾Ãµî', + b2 = TkButton.new(win, :widgetname=>"kill#{cnt}", + :text=>'¥Ô¥¢(peer)¤Î¾Ãµî', :command=>proc{killClone(win, cnt)}) row = cnt * 2 TkGrid.configure(peer, sbar, b1, :sticky=>'nsew', :row=>row) @@ -57,7 +57,7 @@ end def killClone(win, cnt) - Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}", + Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}", "#{win.path}.clone#{cnt}", "#{win.path}.kill#{cnt}") end Index: ext/tk/sample/demos-jp/states.rb =================================================================== --- ext/tk/sample/demos-jp/states.rb (revision 23917) +++ ext/tk/sample/demos-jp/states.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($states_demo) && $states_demo - $states_demo.destroy + $states_demo.destroy $states_demo = nil end Index: ext/tk/sample/demos-jp/form.rb =================================================================== --- ext/tk/sample/demos-jp/form.rb (revision 23917) +++ ext/tk/sample/demos-jp/form.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($form_demo) && $form_demo - $form_demo.destroy + $form_demo.destroy $form_demo = nil end Index: ext/tk/sample/demos-jp/menu.rb =================================================================== --- ext/tk/sample/demos-jp/menu.rb (revision 23917) +++ ext/tk/sample/demos-jp/menu.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($menu_demo) && $menu_demo - $menu_demo.destroy + $menu_demo.destroy $menu_demo = nil end @@ -88,9 +88,9 @@ m.configure('menu'=>basic_menu) add('command', 'label'=>'²¿¤â¤·¤Ê¤¤Ä¹¤¤¥¨¥ó¥È¥ê') ['A','B','C','D','E','F','G'].each{|c| - # add('command', 'label'=>"ʸ»ú \"#{c}\" ¤ò°õ»ú", 'underline'=>4, - add('command', 'label'=>"Print letter \"#{c}\" (ʸ»ú \"#{c}\" ¤ò°õ»ú)", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", + # add('command', 'label'=>"ʸ»ú \"#{c}\" ¤ò°õ»ú", 'underline'=>4, + add('command', 'label'=>"Print letter \"#{c}\" (ʸ»ú \"#{c}\" ¤ò°õ»ú)", + 'underline'=>14, 'accelerator'=>"Meta+#{c}", 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } @@ -101,18 +101,18 @@ pack('side'=>'left') TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| m.configure('menu'=>cascade_menu) - add('command', 'label'=>'Print hello(¤³¤ó¤Ë¤Á¤Ï)', - 'command'=>proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}, + add('command', 'label'=>'Print hello(¤³¤ó¤Ë¤Á¤Ï)', + 'command'=>proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}, 'accelerator'=>"#{modifier}+H", 'underline'=>6) $menu_demo.bind("#{modifier}-h", proc{print "Hello(¤³¤ó¤Ë¤Á¤Ï)\n"}) - add('command', 'label'=>'Print goodbye(¤µ¤è¤¦¤Ê¤é)', - 'command'=>proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}, + add('command', 'label'=>'Print goodbye(¤µ¤è¤¦¤Ê¤é)', + 'command'=>proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}, 'accelerator'=>"#{modifier}+G", 'underline'=>6) $menu_demo.bind("#{modifier}-g", proc{print "Goodbye(¤µ¤è¤¦¤Ê¤é)\n"}) # TkMenu.new(m, 'tearoff'=>false) {|cascade_check| TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_check| - cascade_menu.add('cascade', 'label'=>'Check buttons(¥Á¥§¥Ã¥¯¥Ü¥¿¥ó)', + cascade_menu.add('cascade', 'label'=>'Check buttons(¥Á¥§¥Ã¥¯¥Ü¥¿¥ó)', 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'¥ª¥¤¥ëÅÀ¸¡', 'variable'=>oil) @@ -123,11 +123,11 @@ lights = TkVariable.new(0) add('check', 'label'=>'¥é¥¤¥ÈÅÀ¸¡', 'variable'=>lights) add('separator') - add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', - 'command'=>proc{showVars($menu_demo, - ['¥ª¥¤¥ëÅÀ¸¡', oil], - ['¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥óÅÀ¸¡', trans], - ['¥Ö¥ì¡¼¥­ÅÀ¸¡', brakes], + add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', + 'command'=>proc{showVars($menu_demo, + ['¥ª¥¤¥ëÅÀ¸¡', oil], + ['¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥óÅÀ¸¡', trans], + ['¥Ö¥ì¡¼¥­ÅÀ¸¡', brakes], ['¥é¥¤¥ÈÅÀ¸¡', lights])} ) invoke 1 invoke 3 @@ -135,7 +135,7 @@ #TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_radio| - cascade_menu.add('cascade', 'label'=>'Radio buttons(¥é¥¸¥ª¥Ü¥¿¥ó)', + cascade_menu.add('cascade', 'label'=>'Radio buttons(¥é¥¸¥ª¥Ü¥¿¥ó)', 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new add('radio', 'label'=>'10 ¥Ý¥¤¥ó¥È', 'variable'=>pointSize, 'value'=>10) @@ -149,9 +149,9 @@ add('radio', 'label'=>'¥Ü¡¼¥ë¥É', 'variable'=>style, 'value'=>'bold') add('radio', 'label'=>'¥¤¥¿¥ê¥Ã¥¯', 'variable'=>style, 'value'=>'italic') add('separator') - add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', - 'command'=>proc{showVars($menu_demo, - ['¥Ý¥¤¥ó¥È¥µ¥¤¥º', pointSize], + add('command', 'label'=>'¸½ºß¤ÎÃͤòɽ¼¨', + 'command'=>proc{showVars($menu_demo, + ['¥Ý¥¤¥ó¥È¥µ¥¤¥º', pointSize], ['¥¹¥¿¥¤¥ë', style])} ) invoke 1 invoke 7 @@ -163,15 +163,15 @@ pack('side'=>'left') TkMenu.new(m, 'tearoff'=>false) {|icon_menu| m.configure('menu'=>icon_menu) - add('command', + add('command', 'bitmap'=>'@'+[$demo_dir,'..', 'images','pattern.xbm'].join(File::Separator), - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', + 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', 'text'=>'º£¤¢¤Ê¤¿¤¬ÁªÂò¤·¤¿¥á¥Ë¥å¡¼¤Î¹àÌܤϥƥ­¥¹¥È¤Ç¤Ï¤Ê¤¯¥Ó¥Ã¥È¥Þ¥Ã¥×¤òɽ¼¨¤·¤Æ¤¤¤Þ¤·¤¿¡£¤½¤ì°Ê³°¤ÎÅÀ¤Ç¤Ï¾¤Î¥á¥Ë¥å¡¼¹àÌܤÈÊѤï¤ê¤Þ¤»¤ó¡£', - 'bitmap'=>'', 'default'=>0, + 'bitmap'=>'', 'default'=>0, 'buttons'=>'λ²ò')} ) ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, + add('command', 'bitmap'=>icon, 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) } } @@ -183,7 +183,7 @@ m.configure('menu'=>more_menu) [ '¥¨¥ó¥È¥ê','Ê̤Υ¨¥ó¥È¥ê','²¿¤â¤·¤Ê¤¤','¤Û¤È¤ó¤É²¿¤â¤·¤Ê¤¤', '¿ÍÀ¸¤ò°ÕµÁ¤¢¤ë¤â¤Î¤Ë' ].each{|i| - add('command', 'label'=>i, + add('command', 'label'=>i, 'command'=>proc{print "You invoked \"#{i}\"\n"}) } } @@ -194,7 +194,7 @@ TkMenu.new(m) {|colors_menu| m.configure('menu'=>colors_menu) ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, + add('command', 'label'=>c, 'background'=>c, 'command'=>proc{print "You invoked \"#{c}\"\n"}) } } Index: ext/tk/sample/demos-jp/image2.rb =================================================================== --- ext/tk/sample/demos-jp/image2.rb (revision 23917) +++ ext/tk/sample/demos-jp/image2.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($image2_demo) && $image2_demo - $image2_demo.destroy + $image2_demo.destroy $image2_demo = nil end Index: ext/tk/sample/demos-jp/paned2.rb =================================================================== --- ext/tk/sample/demos-jp/paned2.rb (revision 23917) +++ ext/tk/sample/demos-jp/paned2.rb (working copy) @@ -8,7 +8,7 @@ # based on "Id: paned2.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp" if defined?($paned2_demo) && $paned2_demo - $paned2_demo.destroy + $paned2_demo.destroy $paned2_demo = nil end @@ -20,8 +20,8 @@ base_frame = TkFrame.new($paned2_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'4i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top) ²¼¤Î¥¹¥¯¥í¡¼¥ë¥Ð¡¼ÉÕ¤­¤Î¥¦¥£¥¸¥§¥Ã¥È¤¬ÃÖ¤«¤ì¤¿Æó¤Ä¤Î¥¦¥£¥ó¥É¥¦¤Î´Ö¤Î»ÅÀÚ¤êÏȤϡ¢°ì¤Ä¤ÎÎΰè¤ò¤½¤ì¤¾¤ì¤Î¥¦¥£¥ó¥É¥¦¤Î¤¿¤á¤Ëʬ³ä¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¹¡£º¸¥Ü¥¿¥ó¤Ç»ÅÀÚ¤ê¤òÁàºî¤¹¤ë¤È¡¢Ê¬³ä¥µ¥¤¥ºÊѹ¹¤ÎÁàºîÅÓÃæ¤Ç¤ÏºÆÉ½¼¨¤Ï¤Ê¤µ¤ì¤º¡¢³ÎÄꤵ¤»¤¿¤È¤­¤Ëɽ¼¨¤¬¹¹¿·¤µ¤ì¤Þ¤¹¡£¥Þ¥¦¥¹¤Ë¤è¤ë»ÅÀÚ¤ê¤ÎÁàºî¤ËÄɿ路¤Æ¥µ¥¤¥º¤òÊѹ¹¤·¤¿É½¼¨¤¬¤Ê¤ï¤ì¤ë¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢¥Þ¥¦¥¹¤ÎÃæ±û¥Ü¥¿¥ó¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£ ¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë Ruby ¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë Tk ¥é¥¤¥Ö¥é¥ê¤¬ panedwindow ¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤ @@ -47,23 +47,23 @@ paneList = TkVariable.new # define as normal variable (not array) paneList.value = [ # ruby's array --> tcl's list 'Ruby/Tk ¤Î¥¦¥£¥¸¥§¥Ã¥È°ìÍ÷', - 'TkButton', - 'TkCanvas', - 'TkCheckbutton', - 'TkEntry', - 'TkFrame', - 'TkLabel', - 'TkLabelframe', - 'TkListbox', - 'TkMenu', - 'TkMenubutton', - 'TkMessage', - 'TkPanedwindow', - 'TkRadiobutton', - 'TkScale', - 'TkScrollbar', - 'TkSpinbox', - 'TkText', + 'TkButton', + 'TkCanvas', + 'TkCheckbutton', + 'TkEntry', + 'TkFrame', + 'TkLabel', + 'TkLabelframe', + 'TkListbox', + 'TkMenu', + 'TkMenubutton', + 'TkMessage', + 'TkPanedwindow', + 'TkRadiobutton', + 'TkScale', + 'TkScrollbar', + 'TkSpinbox', + 'TkText', 'TkToplevel' ] @@ -74,20 +74,20 @@ add(TkFrame.new(f){|paned2_top| TkListbox.new(paned2_top, :listvariable=>paneList) { # Invert the first item to highlight it - itemconfigure(0, :background=>self.cget(:foreground), + itemconfigure(0, :background=>self.cget(:foreground), :foreground=>self.cget(:background) ) - yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, + yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, :fill=>:y)) pack(:fill=>:both, :expand=>true) } - }, + }, TkFrame.new(f, :height=>120) {|paned2_bottom| # The bottom window is a text widget with scrollbar paned2_xscr = TkScrollbar.new(paned2_bottom) paned2_yscr = TkScrollbar.new(paned2_bottom) paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) { - insert('1.0', '¤³¤³¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢' + + insert('1.0', '¤³¤³¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢' + '¤´¤¯ÉáÄ̤Υƥ­¥¹¥È¥¦¥£¥¸¥§¥Ã¥È¤Ç¤¹¡£') xscrollbar(paned2_xscr) yscrollbar(paned2_yscr) Index: ext/tk/sample/demos-jp/bitmap.rb =================================================================== --- ext/tk/sample/demos-jp/bitmap.rb (revision 23917) +++ ext/tk/sample/demos-jp/bitmap.rb (working copy) @@ -15,7 +15,7 @@ def bitmapRow(w,*args) TkFrame.new(w){|row| pack('side'=>'top', 'fill'=>'both') - for bitmap in args + for bitmap in args TkFrame.new(row){|base| pack('side'=>'left', 'fill'=>'both', 'pady'=>'.25c', 'padx'=>'.25c') TkLabel.new(base, 'text'=>bitmap, 'width'=>9).pack('side'=>'bottom') @@ -27,7 +27,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($bitmap_demo) && $bitmap_demo - $bitmap_demo.destroy + $bitmap_demo.destroy $bitmap_demo = nil end @@ -41,7 +41,7 @@ base_frame = TkFrame.new($bitmap_demo).pack(:fill=>:both, :expand=>true) # label À¸À® -TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left', +TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left', 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¡¢Tk ¤ËÁȤ߹þ¤Þ¤ì¤¿¤¹¤Ù¤Æ¤Î¥Ó¥Ã¥È¥Þ¥Ã¥×¤¬¡¢¤½¤ì¤é¤Î̾Á°¤È¶¦¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Tcl ¤Î¥¹¥¯¥ê¥×¥ÈÃæ¤Ç¤Ï¡¢¤½¤ì¤¾¤ì¤Î̾Á°¤òÍѤ¤¤Æ»²¾È¤·¤Þ¤¹¡£"){ pack('side'=>'top') } Index: ext/tk/sample/demos-jp/label.rb =================================================================== --- ext/tk/sample/demos-jp/label.rb (revision 23917) +++ ext/tk/sample/demos-jp/label.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($label_demo) && $label_demo - $label_demo.destroy + $label_demo.destroy $label_demo = nil end @@ -49,12 +49,12 @@ # label demo Íѥե졼¥àÀ¸À® f_left = TkFrame.new(base_frame) f_right = TkFrame.new(base_frame) -[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes', +[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes', 'padx'=>10, 'pady'=>10, 'fill'=>'both')} # label À¸À® [ TkLabel.new(f_left, 'text'=>'ºÇ½é¤Î¥é¥Ù¥ë'), - TkLabel.new(f_left, 'text'=>'2 ÈÖÌÜ¡£¤Á¤ç¤Ã¤ÈÉ⤭¾å¤¬¤é¤»¤Æ¤ß¤Þ¤·¤¿', + TkLabel.new(f_left, 'text'=>'2 ÈÖÌÜ¡£¤Á¤ç¤Ã¤ÈÉ⤭¾å¤¬¤é¤»¤Æ¤ß¤Þ¤·¤¿', 'relief'=>'raised'), TkLabel.new(f_left, 'text'=>'3 ÈÖÌÜ¡£ÄÀ¤ó¤Ç¤¤¤Þ¤¹ ', 'relief'=>'sunken') ].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')} Index: ext/tk/sample/demos-jp/radio2.rb =================================================================== --- ext/tk/sample/demos-jp/radio2.rb (revision 23917) +++ ext/tk/sample/demos-jp/radio2.rb (working copy) @@ -10,7 +10,7 @@ # toplevel widget if defined?($radio2_demo) && $radio2_demo - $radio2_demo.destroy + $radio2_demo.destroy $radio2_demo = nil end @@ -23,7 +23,7 @@ base_frame = TkFrame.new($radio2_demo).pack(:fill=>:both, :expand=>true) -# label +# label msg = TkLabel.new(base_frame) { font $font wraplength '5i' @@ -32,12 +32,12 @@ } msg.pack('side'=>'top') -# +# size = TkVariable.new color = TkVariable.new align = TkVariable.new -# frame +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { #text 'λ²ò' @@ -58,24 +58,24 @@ TkButton.new(frame) { text 'ÊÑ¿ô»²¾È' command proc{ - showVars(base_frame, + showVars(base_frame, ['size', size], ['color', color], ['compound', align]) } }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame -f_left = TkLabelFrame.new(base_frame, 'text'=>'ʸ»ú¥µ¥¤¥º', +# frame +f_left = TkLabelFrame.new(base_frame, 'text'=>'ʸ»ú¥µ¥¤¥º', 'pady'=>2, 'padx'=>2) -f_mid = TkLabelFrame.new(base_frame, 'text'=>'¿§', +f_mid = TkLabelFrame.new(base_frame, 'text'=>'¿§', 'pady'=>2, 'padx'=>2) -f_right = TkLabelFrame.new(base_frame, 'text'=>'¥Ó¥Ã¥È¥Þ¥Ã¥×ÇÛÃÖ', +f_right = TkLabelFrame.new(base_frame, 'text'=>'¥Ó¥Ã¥È¥Þ¥Ã¥×ÇÛÃÖ', 'pady'=>2, 'padx'=>2) f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -# radiobutton +# radiobutton [10, 12, 18, 24].each {|sz| TkRadioButton.new(f_left) { text "¥Ý¥¤¥ó¥È¥µ¥¤¥º #{sz}" @@ -95,15 +95,15 @@ }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x') } -# label = TkLabel.new(f_right, 'text'=>'¥é¥Ù¥ë', 'bitmap'=>'questhead', -label = Tk::Label.new(f_right, 'text'=>'¥é¥Ù¥ë', 'bitmap'=>'questhead', +# label = TkLabel.new(f_right, 'text'=>'¥é¥Ù¥ë', 'bitmap'=>'questhead', +label = Tk::Label.new(f_right, 'text'=>'¥é¥Ù¥ë', 'bitmap'=>'questhead', 'compound'=>'left') label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') label.height(TkWinfo.reqheight(label)) abtn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a| lower = a.downcase - TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', - 'value'=>lower, 'indicatoron'=>0, 'width'=>7, + TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', + 'value'=>lower, 'indicatoron'=>0, 'width'=>7, 'command'=>proc{label.compound(align.value)}) } Index: ext/tk/sample/demos-jp/knightstour.rb =================================================================== --- ext/tk/sample/demos-jp/knightstour.rb (revision 23917) +++ ext/tk/sample/demos-jp/knightstour.rb (working copy) @@ -157,16 +157,16 @@ frame = Ttk::Frame.new($knightstour) sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'knightstour'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'knightstour'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $knightstour.destroy $knightstour = nil - }), + }), :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) frame @@ -178,7 +178,7 @@ $knightstour.withdraw base_f = Ttk::Frame.new($knightstour) @board = Tk::Canvas.new(base_f, :width=>240, :height=>240) - @log = Tk::Text.new(base_f, :width=>12, :height=>1, + @log = Tk::Text.new(base_f, :width=>12, :height=>1, :font=>'Arial 8', :background=>'white') scr = @log.yscrollbar(Ttk::Scrollbar.new(base_f)) @@ -188,13 +188,13 @@ tool_f = Ttk::Frame.new($knightstour) label = Ttk::Label.new(tool_f, :text=>'¼Â¹Ô®ÅÙ') - scale = Ttk::Scale.new(tool_f, :from=>8, :to=>2000, :variable=>@delay, + scale = Ttk::Scale.new(tool_f, :from=>8, :to=>2000, :variable=>@delay, :command=>proc{|n| set_delay(n)}) - check = Ttk::Checkbutton.new(tool_f, :text=>'È¿Éü', + check = Ttk::Checkbutton.new(tool_f, :text=>'È¿Éü', :variable=>@continuous) - @start_btn = Ttk::Button.new(tool_f, :text=>'³«»Ï', + @start_btn = Ttk::Button.new(tool_f, :text=>'³«»Ï', :command=>proc{tour()}) - @exit_btn = Ttk::Button.new(tool_f, :text=>'½ªÎ»', + @exit_btn = Ttk::Button.new(tool_f, :text=>'½ªÎ»', :command=>proc{_exit()}) 7.downto(0){|row| @@ -207,16 +207,16 @@ dfill = 'tan4' end coords = [col * 30 + 4, row * 30 + 4, col * 30 + 30, row * 30 + 30] - @board.create(TkcRectangle, coords, + @board.create(TkcRectangle, coords, :fill=>fill, :disabledfill=>dfill, :width=>2, :state=>:disabled) } } @knight_font = TkFont.new(:size=>-24) - @knight = TkcText.new(@board, 0, 0, :font=>@knight_font, - :text=>Tk::UTF8_String.new('\u265e'), - :anchor=>'nw', # :tags=>'knight', + @knight = TkcText.new(@board, 0, 0, :font=>@knight_font, + :text=>Tk::UTF8_String.new('\u265e'), + :anchor=>'nw', # :tags=>'knight', :fill=>'black', :activefill=>'#600000') @knight.coords(@board.coords(rand(64)+1)[0..1]) @knight.bind('ButtonPress-1', '%W %x %y'){|w,x,y| drag_start(w,x,y)} Index: ext/tk/sample/demos-jp/floor.rb =================================================================== --- ext/tk/sample/demos-jp/floor.rb (revision 23917) +++ ext/tk/sample/demos-jp/floor.rb (working copy) @@ -18,7 +18,7 @@ w.delete('all') $activeFloor = active - # First go through the three floors, displaying the backgrounds for + # First go through the three floors, displaying the backgrounds for # each floor. floor_bg1(w,$floor_colors['bg1'],$floor_colors['outline1']) @@ -29,12 +29,12 @@ w.raise("floor#{active}") - # Create a dummy item just to mark this point in the display list, + # Create a dummy item just to mark this point in the display list, # so we can insert highlights here. TkcRectangle.new(w,0,100,1,101, 'fill'=>'', 'outline'=>'', 'tags'=>'marker') - # Add the walls and labels for the active floor, along with + # Add the walls and labels for the active floor, along with # transparent polygons that define the rooms on the floor. # Make sure that the room polygons are on top. @@ -299,7 +299,7 @@ TkcLine.new(w,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg']) TkcLine.new(w,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) TkcLine.new(w,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,107,300,159,300,159,248,107,248,107,300, + TkcLine.new(w,107,300,159,300,159,248,107,248,107,300, 'fill'=>outline, 'tags'=>['floor3','bg']) end @@ -313,316 +313,316 @@ # color - Color to use for drawing foreground information. def floor_fg1(w,color) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '101' $floorItems['101'] = i - TkcText.new(w,358,209, 'text'=>'101', 'fill'=>color, + TkcText.new(w,358,209, 'text'=>'101', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Pub Lift1' $floorItems['Pub Lift1'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift1', 'fill'=>color, + TkcText.new(w,323,223, 'text'=>'Pub Lift1', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Priv Lift1' $floorItems['Priv Lift1'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift1', 'fill'=>color, + TkcText.new(w,323,188, 'text'=>'Priv Lift1', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, + i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '110' $floorItems['110'] = i - TkcText.new(w,21.5,363, 'text'=>'110', 'fill'=>color, + TkcText.new(w,21.5,363, 'text'=>'110', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, + i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '109' $floorItems['109'] = i - TkcText.new(w,67,363, 'text'=>'109', 'fill'=>color, + TkcText.new(w,67,363, 'text'=>'109', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, + i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '111' $floorItems['111'] = i - TkcText.new(w,28.5,276.5, 'text'=>'111', 'fill'=>color, + TkcText.new(w,28.5,276.5, 'text'=>'111', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, + i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '117B' $floorItems['117B'] = i - TkcText.new(w,88.5,278.5, 'text'=>'117B', 'fill'=>color, + TkcText.new(w,88.5,278.5, 'text'=>'117B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, + i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '112' $floorItems['112'] = i - TkcText.new(w,28.5,227.5, 'text'=>'112', 'fill'=>color, + TkcText.new(w,28.5,227.5, 'text'=>'112', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, + i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '113' $floorItems['113'] = i - TkcText.new(w,28.5,179.5, 'text'=>'113', 'fill'=>color, + TkcText.new(w,28.5,179.5, 'text'=>'113', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, + i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '117A' $floorItems['117A'] = i - TkcText.new(w,82,180.5, 'text'=>'117A', 'fill'=>color, + TkcText.new(w,82,180.5, 'text'=>'117A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, + i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '117' $floorItems['117'] = i - TkcText.new(w,65,235, 'text'=>'117', 'fill'=>color, + TkcText.new(w,65,235, 'text'=>'117', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, + i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '114' $floorItems['114'] = i - TkcText.new(w,28.5,135, 'text'=>'114', 'fill'=>color, + TkcText.new(w,28.5,135, 'text'=>'114', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, + i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '115' $floorItems['115'] = i - TkcText.new(w,74,141.5, 'text'=>'115', 'fill'=>color, + TkcText.new(w,74,141.5, 'text'=>'115', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, + i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '116' $floorItems['116'] = i - TkcText.new(w,48.5,70, 'text'=>'116', 'fill'=>color, + TkcText.new(w,48.5,70, 'text'=>'116', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, + i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '118' $floorItems['118'] = i - TkcText.new(w,108.5,102, 'text'=>'118', 'fill'=>color, + TkcText.new(w,108.5,102, 'text'=>'118', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,178,128,178,132,216,132,216,91, - 163,91,163,112,149,112,149,128, + 163,91,163,112,149,112,149,128, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '120' $floorItems['120'] = i - TkcText.new(w,189.5,111.5, 'text'=>'120', 'fill'=>color, + TkcText.new(w,189.5,111.5, 'text'=>'120', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192, - 156,192,156,169,175,169,175,246,79,246, + 156,192,156,169,175,169,175,246,79,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '122' $floorItems['122'] = i - TkcText.new(w,131,207.5, 'text'=>'122', 'fill'=>color, + TkcText.new(w,131,207.5, 'text'=>'122', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, + i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '121' $floorItems['121'] = i - TkcText.new(w,146,180, 'text'=>'121', 'fill'=>color, + TkcText.new(w,146,180, 'text'=>'121', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, + i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '106A' $floorItems['106A'] = i - TkcText.new(w,112.5,304.5, 'text'=>'106A', 'fill'=>color, + TkcText.new(w,112.5,304.5, 'text'=>'106A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, + i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '105' $floorItems['105'] = i - TkcText.new(w,124.5,278.5, 'text'=>'105', 'fill'=>color, + TkcText.new(w,124.5,278.5, 'text'=>'105', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, + i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '106B' $floorItems['106B'] = i - TkcText.new(w,163,304.5, 'text'=>'106B', 'fill'=>color, + TkcText.new(w,163,304.5, 'text'=>'106B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, + i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '104' $floorItems['104'] = i - TkcText.new(w,184,278.5, 'text'=>'104', 'fill'=>color, + TkcText.new(w,184,278.5, 'text'=>'104', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, + i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '108' $floorItems['108'] = i - TkcText.new(w,114.5,361, 'text'=>'108', 'fill'=>color, + TkcText.new(w,114.5,361, 'text'=>'108', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, + i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '107' $floorItems['107'] = i - TkcText.new(w,198,361, 'text'=>'107', 'fill'=>color, + TkcText.new(w,198,361, 'text'=>'107', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, + i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Smoking' $floorItems['Smoking'] = i - TkcText.new(w,280,341, 'text'=>'Smoking', 'fill'=>color, + TkcText.new(w,280,341, 'text'=>'Smoking', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, + i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '123' $floorItems['123'] = i - TkcText.new(w,245.5,190.5, 'text'=>'123', 'fill'=>color, + TkcText.new(w,245.5,190.5, 'text'=>'123', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, + i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '103' $floorItems['103'] = i - TkcText.new(w,259,287, 'text'=>'103', 'fill'=>color, + TkcText.new(w,259,287, 'text'=>'103', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, + i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '124' $floorItems['124'] = i - TkcText.new(w,356,150, 'text'=>'124', 'fill'=>color, + TkcText.new(w,356,150, 'text'=>'124', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, + i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '125' $floorItems['125'] = i - TkcText.new(w,392,217.5, 'text'=>'125', 'fill'=>color, + TkcText.new(w,392,217.5, 'text'=>'125', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, + i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '126' $floorItems['126'] = i - TkcText.new(w,436.5,185.5, 'text'=>'126', 'fill'=>color, + TkcText.new(w,436.5,185.5, 'text'=>'126', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,409,209,409,229,399,229,399,253, - 486,253,486,239,474,239,474,209, + 486,253,486,239,474,239,474,209, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '127' $floorItems['127'] = i - TkcText.new(w,436.5,'231', 'text'=>'127', 'fill'=>color, + TkcText.new(w,436.5,'231', 'text'=>'127', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,501,164,501,174,495,174,495,188, - 490,188,490,204,476,204,476,164, + 490,188,490,204,476,204,476,164, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'MShower' $floorItems['MShower'] = i - TkcText.new(w,488.5,'184', 'text'=>'MShower', 'fill'=>color, + TkcText.new(w,488.5,'184', 'text'=>'MShower', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, + i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Closet' $floorItems['Closet'] = i - TkcText.new(w,502.5,190, 'text'=>'Closet', 'fill'=>color, + TkcText.new(w,502.5,190, 'text'=>'Closet', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, + i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'WShower' $floorItems['WShower'] = i - TkcText.new(w,494.5,230, 'text'=>'WShower', 'fill'=>color, + TkcText.new(w,494.5,230, 'text'=>'WShower', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166, 697,166,697,275,553,275,531,254,515,254, - 515,174,503,174,503,161,486,161, + 515,174,503,174,503,161,486,161, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '130' $floorItems['130'] = i - TkcText.new(w,638.5,205, 'text'=>'130', 'fill'=>color, + TkcText.new(w,638.5,205, 'text'=>'130', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,308,242,339,242,339,248,342,248, 342,246,397,246,397,276,393,276, - 393,309,300,309,300,248,308,248, + 393,309,300,309,300,248,308,248, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '102' $floorItems['102'] = i - TkcText.new(w,367.5,278.5, 'text'=>'102', 'fill'=>color, + TkcText.new(w,367.5,278.5, 'text'=>'102', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, + i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '128' $floorItems['128'] = i - TkcText.new(w,441.5,265.5, 'text'=>'128', 'fill'=>color, + TkcText.new(w,441.5,265.5, 'text'=>'128', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,510,309,486,309,486,255,530,255, 552,277,561,277,561,325,510,325, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '129' $floorItems['129'] = i - TkcText.new(w,535.5,293, 'text'=>'129', 'fill'=>color, + TkcText.new(w,535.5,293, 'text'=>'129', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,696,281,740,281,740,387,642,387, - 642,389,561,389,561,277,696,277, + 642,389,561,389,561,277,696,277, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '133' $floorItems['133'] = i - TkcText.new(w,628.5,335, 'text'=>'133', 'fill'=>color, + TkcText.new(w,628.5,335, 'text'=>'133', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, + i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '132' $floorItems['132'] = i - TkcText.new(w,771,334, 'text'=>'132', 'fill'=>color, + TkcText.new(w,771,334, 'text'=>'132', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, + i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '134' $floorItems['134'] = i - TkcText.new(w,749.5,224, 'text'=>'134', 'fill'=>color, + TkcText.new(w,749.5,224, 'text'=>'134', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, + i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '135' $floorItems['135'] = i - TkcText.new(w,763,148.5, 'text'=>'135', 'fill'=>color, + TkcText.new(w,763,148.5, 'text'=>'135', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366, 304,312,396,312,396,288,400,288,404,288, 409,290,413,292,418,297,421,302,422,309, 421,318,417,325,411,330,405,332,397,333, 344,333,340,334,336,336,335,338,332,342, - 331,347,332,351,334,354,336,357,341,359, + 331,347,332,351,334,354,336,357,341,359, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Ramona Stair' $floorItems['Ramona Stair'] = i - TkcText.new(w,368,323, 'text'=>'Ramona Stair', 'fill'=>color, + TkcText.new(w,368,323, 'text'=>'Ramona Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20, - 122,28,123,32,123,68,220,68,220,87,90,87,90,23, + 122,28,123,32,123,68,220,68,220,87,90,87,90,23, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'University Stair' $floorItems['University Stair'] = i - TkcText.new(w,155,77.5, 'text'=>'University Stair', 'fill'=>color, + TkcText.new(w,155,77.5, 'text'=>'University Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56, 358,48,363,39,365,29,348,25,335,22,321,14, 300,5,283,1,260,0,246,0,242,2,236,4,231,8, - 227,13,223,17,221,22,220,34,260,34, + 227,13,223,17,221,22,220,34,260,34, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Plaza Stair' $floorItems['Plaza Stair'] = i - TkcText.new(w,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, + TkcText.new(w,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49, 323,56,337,70,350,83,365,94,377,100, - 386,104,386,128,220,128, + 386,104,386,128,220,128, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Plaza Deck' $floorItems['Plaza Deck'] = i - TkcText.new(w,303,81, 'text'=>'Plaza Deck', 'fill'=>color, + TkcText.new(w,303,81, 'text'=>'Plaza Deck', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '106' $floorItems['106'] = i - TkcText.new(w,131.5,318.5, 'text'=>'106', 'fill'=>color, + TkcText.new(w,131.5,318.5, 'text'=>'106', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115, 95,128,114,128,114,151,157,151,157,153,112,153, - 112,130,97,130,97,168,175,168,175,131,146,131, + 112,130,97,130,97,168,175,168,175,131,146,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '119' $floorItems['119'] = i - TkcText.new(w,143.5,133, 'text'=>'119', 'fill'=>color, + TkcText.new(w,143.5,133, 'text'=>'119', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) TkcLine.new(w,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall']) TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall']) @@ -795,321 +795,321 @@ def floor_fg2(w,color) i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222, - 800,222,800,168,748,168, + 800,222,800,168,748,168, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '238' $floorItems['238'] = i - TkcText.new(w,774,195, 'text'=>'238', 'fill'=>color, + TkcText.new(w,774,195, 'text'=>'238', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '237' $floorItems['237'] = i - TkcText.new(w,763,148.5, 'text'=>'237', 'fill'=>color, + TkcText.new(w,763,148.5, 'text'=>'237', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324, 643,324,643,291,641,291,641,205,696,205, 696,291,694,291,694,314,715,314,715,291, - 715,205,755,205,755,190,724,190,724,187, + 715,205,755,205,755,190,724,190,724,187, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '246' $floorItems['246'] = i - TkcText.new(w,600,264, 'text'=>'246', 'fill'=>color, + TkcText.new(w,600,264, 'text'=>'246', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, + i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '247' $floorItems['247'] = i - TkcText.new(w,668.5,296.5, 'text'=>'247', 'fill'=>color, + TkcText.new(w,668.5,296.5, 'text'=>'247', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246, 397,246,397,255,476,255,476,250,482,250,559,250, - 559,274,482,274,482,278,396,278,396,274,232,274, + 559,274,482,274,482,278,396,278,396,274,232,274, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '202' $floorItems['202'] = i - TkcText.new(w,285.5,260, 'text'=>'202', 'fill'=>color, + TkcText.new(w,285.5,260, 'text'=>'202', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196, 306,196,306,180,175,180,175,169,156,169, - 156,196,176,196,176,228, + 156,196,176,196,176,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '206' $floorItems['206'] = i - TkcText.new(w,143,267, 'text'=>'206', 'fill'=>color, + TkcText.new(w,143,267, 'text'=>'206', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, + i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '212' $floorItems['212'] = i - TkcText.new(w,28.5,307.5, 'text'=>'212', 'fill'=>color, + TkcText.new(w,28.5,307.5, 'text'=>'212', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, + i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '245' $floorItems['245'] = i - TkcText.new(w,521.5,300.5, 'text'=>'245', 'fill'=>color, + TkcText.new(w,521.5,300.5, 'text'=>'245', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, + i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '244' $floorItems['244'] = i - TkcText.new(w,579.5,357.5, 'text'=>'244', 'fill'=>color, + TkcText.new(w,579.5,357.5, 'text'=>'244', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, + i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '243' $floorItems['243'] = i - TkcText.new(w,622,357.5, 'text'=>'243', 'fill'=>color, + TkcText.new(w,622,357.5, 'text'=>'243', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, + i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '242' $floorItems['242'] = i - TkcText.new(w,666.5,340.5, 'text'=>'242', 'fill'=>color, + TkcText.new(w,666.5,340.5, 'text'=>'242', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, + i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = 'Barbecue Deck' $floorItems['Barbecue Deck'] = i - TkcText.new(w,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, + TkcText.new(w,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, + i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '240' $floorItems['240'] = i - TkcText.new(w,736,288, 'text'=>'240', 'fill'=>color, + TkcText.new(w,736,288, 'text'=>'240', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, + i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '241' $floorItems['241'] = i - TkcText.new(w,722,340.5, 'text'=>'241', 'fill'=>color, + TkcText.new(w,722,340.5, 'text'=>'241', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, + i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '239' $floorItems['239'] = i - TkcText.new(w,736,233.5, 'text'=>'239', 'fill'=>color, + TkcText.new(w,736,233.5, 'text'=>'239', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, + i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '248' $floorItems['248'] = i - TkcText.new(w,669,241.5, 'text'=>'248', 'fill'=>color, + TkcText.new(w,669,241.5, 'text'=>'248', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, + i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '236' $floorItems['236'] = i - TkcText.new(w,700,160, 'text'=>'236', 'fill'=>color, + TkcText.new(w,700,160, 'text'=>'236', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, + i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '235' $floorItems['235'] = i - TkcText.new(w,651.5,160, 'text'=>'235', 'fill'=>color, + TkcText.new(w,651.5,160, 'text'=>'235', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,626,143,633,143,633,135,572,135, - 572,143,579,143,579,185,626,185, + 572,143,579,143,579,185,626,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '234' $floorItems['234'] = i - TkcText.new(w,606,160, 'text'=>'234', 'fill'=>color, + TkcText.new(w,606,160, 'text'=>'234', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,557,135,571,135,571,145,578,145, - 578,185,527,185,527,131,557,131, + 578,185,527,185,527,131,557,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '233' $floorItems['233'] = i - TkcText.new(w,552.5,158, 'text'=>'233', 'fill'=>color, + TkcText.new(w,552.5,158, 'text'=>'233', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,249,557,249,557,205,476,205, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '230' $floorItems['230'] = i - TkcText.new(w,516.5,227, 'text'=>'230', 'fill'=>color, + TkcText.new(w,516.5,227, 'text'=>'230', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, + i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '232' $floorItems['232'] = i - TkcText.new(w,500.5,158, 'text'=>'232', 'fill'=>color, + TkcText.new(w,500.5,158, 'text'=>'232', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, + i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '229' $floorItems['229'] = i - TkcText.new(w,485.5,195, 'text'=>'229', 'fill'=>color, + TkcText.new(w,485.5,195, 'text'=>'229', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, + i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '227' $floorItems['227'] = i - TkcText.new(w,436.5,185.5, 'text'=>'227', 'fill'=>color, + TkcText.new(w,436.5,185.5, 'text'=>'227', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, + i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '228' $floorItems['228'] = i - TkcText.new(w,436.5,231, 'text'=>'228', 'fill'=>color, + TkcText.new(w,436.5,231, 'text'=>'228', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, + i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '226' $floorItems['226'] = i - TkcText.new(w,392,217.5, 'text'=>'226', 'fill'=>color, + TkcText.new(w,392,217.5, 'text'=>'226', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, + i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '225' $floorItems['225'] = i - TkcText.new(w,356.5,150, 'text'=>'225', 'fill'=>color, + TkcText.new(w,356.5,150, 'text'=>'225', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, + i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '224' $floorItems['224'] = i - TkcText.new(w,270,223.5, 'text'=>'224', 'fill'=>color, + TkcText.new(w,270,223.5, 'text'=>'224', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, + i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '223' $floorItems['223'] = i - TkcText.new(w,292,157, 'text'=>'223', 'fill'=>color, + TkcText.new(w,292,157, 'text'=>'223', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, + i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '222' $floorItems['222'] = i - TkcText.new(w,244.5,157, 'text'=>'222', 'fill'=>color, + TkcText.new(w,244.5,157, 'text'=>'222', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, + i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '221' $floorItems['221'] = i - TkcText.new(w,198,157, 'text'=>'221', 'fill'=>color, + TkcText.new(w,198,157, 'text'=>'221', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, + i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '204' $floorItems['204'] = i - TkcText.new(w,324,301.5, 'text'=>'204', 'fill'=>color, + TkcText.new(w,324,301.5, 'text'=>'204', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, + i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '205' $floorItems['205'] = i - TkcText.new(w,265.5,307, 'text'=>'205', 'fill'=>color, + TkcText.new(w,265.5,307, 'text'=>'205', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,256,385,256,340,212,340,212,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '207' $floorItems['207'] = i - TkcText.new(w,234,362.5, 'text'=>'207', 'fill'=>color, + TkcText.new(w,234,362.5, 'text'=>'207', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, + i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '208' $floorItems['208'] = i - TkcText.new(w,187,362.5, 'text'=>'208', 'fill'=>color, + TkcText.new(w,187,362.5, 'text'=>'208', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, + i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '209' $floorItems['209'] = i - TkcText.new(w,138.5,362.5, 'text'=>'209', 'fill'=>color, + TkcText.new(w,138.5,362.5, 'text'=>'209', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, + i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '217' $floorItems['217'] = i - TkcText.new(w,71,192, 'text'=>'217', 'fill'=>color, + TkcText.new(w,71,192, 'text'=>'217', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, + i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '217A' $floorItems['217A'] = i - TkcText.new(w,93,179.5, 'text'=>'217A', 'fill'=>color, + TkcText.new(w,93,179.5, 'text'=>'217A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, + i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '216' $floorItems['216'] = i - TkcText.new(w,71,145.5, 'text'=>'216', 'fill'=>color, + TkcText.new(w,71,145.5, 'text'=>'216', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, + i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '215' $floorItems['215'] = i - TkcText.new(w,28.5,157, 'text'=>'215', 'fill'=>color, + TkcText.new(w,28.5,157, 'text'=>'215', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, + i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '214' $floorItems['214'] = i - TkcText.new(w,28.5,203.5, 'text'=>'214', 'fill'=>color, + TkcText.new(w,28.5,203.5, 'text'=>'214', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, + i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '213' $floorItems['213'] = i - TkcText.new(w,28.5,252, 'text'=>'213', 'fill'=>color, + TkcText.new(w,28.5,252, 'text'=>'213', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, + i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '210' $floorItems['210'] = i - TkcText.new(w,90.5,362.5, 'text'=>'210', 'fill'=>color, + TkcText.new(w,90.5,362.5, 'text'=>'210', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, + i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '211' $floorItems['211'] = i - TkcText.new(w,33,364.5, 'text'=>'211', 'fill'=>color, + TkcText.new(w,33,364.5, 'text'=>'211', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, + i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '203' $floorItems['203'] = i - TkcText.new(w,367.5,292.5, 'text'=>'203', 'fill'=>color, + TkcText.new(w,367.5,292.5, 'text'=>'203', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198, - 154,198,154,192,109,192,109,169,99,169, + 154,198,154,192,109,192,109,169,99,169, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '220' $floorItems['220'] = i - TkcText.new(w,132.5,208.5, 'text'=>'220', 'fill'=>color, + TkcText.new(w,132.5,208.5, 'text'=>'220', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = 'Priv Lift2' $floorItems['Priv Lift2'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift2', 'fill'=>color, + TkcText.new(w,323,188, 'text'=>'Priv Lift2', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = 'Pub Lift 2' $floorItems['Pub Lift 2'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, + TkcText.new(w,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, + i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '218' $floorItems['218'] = i - TkcText.new(w,136,149.5, 'text'=>'218', 'fill'=>color, + TkcText.new(w,136,149.5, 'text'=>'218', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, + i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '219' $floorItems['219'] = i - TkcText.new(w,132.5,180, 'text'=>'219', 'fill'=>color, + TkcText.new(w,132.5,180, 'text'=>'219', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '201' $floorItems['201'] = i - TkcText.new(w,358,209, 'text'=>'201', 'fill'=>color, + TkcText.new(w,358,209, 'text'=>'201', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) TkcLine.new(w,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall']) TkcLine.new(w,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall']) @@ -1280,206 +1280,206 @@ 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '316' $floorItems['316'] = i - TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color, + TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, + i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '309' $floorItems['309'] = i - TkcText.new(w,138.5,345.5, 'text'=>'309', 'fill'=>color, + TkcText.new(w,138.5,345.5, 'text'=>'309', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, + i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '308' $floorItems['308'] = i - TkcText.new(w,187.5,345.5, 'text'=>'308', 'fill'=>color, + TkcText.new(w,187.5,345.5, 'text'=>'308', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, + i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '307' $floorItems['307'] = i - TkcText.new(w,234,345.5, 'text'=>'307', 'fill'=>color, + TkcText.new(w,234,345.5, 'text'=>'307', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, + i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '305' $floorItems['305'] = i - TkcText.new(w,270.5,301.5, 'text'=>'305', 'fill'=>color, + TkcText.new(w,270.5,301.5, 'text'=>'305', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,251,219,251,203,244,203,244,219, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '324B' $floorItems['324B'] = i - TkcText.new(w,247.5,211, 'text'=>'324B', 'fill'=>color, + TkcText.new(w,247.5,211, 'text'=>'324B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, + i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '324A' $floorItems['324A'] = i - TkcText.new(w,247.5,240.5, 'text'=>'324A', 'fill'=>color, + TkcText.new(w,247.5,240.5, 'text'=>'324A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, + i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '320' $floorItems['320'] = i - TkcText.new(w,200,157, 'text'=>'320', 'fill'=>color, + TkcText.new(w,200,157, 'text'=>'320', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, + i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '310' $floorItems['310'] = i - TkcText.new(w,90.5,345.5, 'text'=>'310', 'fill'=>color, + TkcText.new(w,90.5,345.5, 'text'=>'310', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, + i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '312' $floorItems['312'] = i - TkcText.new(w,45.5,299, 'text'=>'312', 'fill'=>color, + TkcText.new(w,45.5,299, 'text'=>'312', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, + i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '313' $floorItems['313'] = i - TkcText.new(w,45.5,252, 'text'=>'313', 'fill'=>color, + TkcText.new(w,45.5,252, 'text'=>'313', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, + i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '314' $floorItems['314'] = i - TkcText.new(w,40.5,203.5, 'text'=>'314', 'fill'=>color, + TkcText.new(w,40.5,203.5, 'text'=>'314', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, + i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '315' $floorItems['315'] = i - TkcText.new(w,59,157, 'text'=>'315', 'fill'=>color, + TkcText.new(w,59,157, 'text'=>'315', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, + i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '316B' $floorItems['316B'] = i - TkcText.new(w,95,215, 'text'=>'316B', 'fill'=>color, + TkcText.new(w,95,215, 'text'=>'316B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, + i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '316A' $floorItems['316A'] = i - TkcText.new(w,95,191, 'text'=>'316A', 'fill'=>color, + TkcText.new(w,95,191, 'text'=>'316A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198, - 174,198,174,226,101,226,101,179,97,179, + 174,198,174,226,101,226,101,179,97,179, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '319' $floorItems['319'] = i - TkcText.new(w,141.5,209, 'text'=>'319', 'fill'=>color, + TkcText.new(w,141.5,209, 'text'=>'319', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, + i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '311' $floorItems['311'] = i - TkcText.new(w,29.5,361, 'text'=>'311', 'fill'=>color, + TkcText.new(w,29.5,361, 'text'=>'311', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, + i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '318' $floorItems['318'] = i - TkcText.new(w,132.5,180, 'text'=>'318', 'fill'=>color, + TkcText.new(w,132.5,180, 'text'=>'318', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, + i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '317' $floorItems['317'] = i - TkcText.new(w,136,149.5, 'text'=>'317', 'fill'=>color, + TkcText.new(w,136,149.5, 'text'=>'317', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, + i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '323' $floorItems['323'] = i - TkcText.new(w,290,207.5, 'text'=>'323', 'fill'=>color, + TkcText.new(w,290,207.5, 'text'=>'323', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, + i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '325' $floorItems['325'] = i - TkcText.new(w,290,235.5, 'text'=>'325', 'fill'=>color, + TkcText.new(w,290,235.5, 'text'=>'325', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, + i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '321' $floorItems['321'] = i - TkcText.new(w,243.5,157, 'text'=>'321', 'fill'=>color, + TkcText.new(w,243.5,157, 'text'=>'321', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,314,169,306,169,306,192,273,192, - 264,181,264,135,314,135, + 264,181,264,135,314,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '322' $floorItems['322'] = i - TkcText.new(w,293.5,163.5, 'text'=>'322', 'fill'=>color, + TkcText.new(w,293.5,163.5, 'text'=>'322', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = 'Pub Lift3' $floorItems['Pub Lift3'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift3', 'fill'=>color, + TkcText.new(w,323,223, 'text'=>'Pub Lift3', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = 'Priv Lift3' $floorItems['Priv Lift3'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift3', 'fill'=>color, + TkcText.new(w,323,188, 'text'=>'Priv Lift3', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, + i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '303' $floorItems['303'] = i - TkcText.new(w,373.5,292.5, 'text'=>'303', 'fill'=>color, + TkcText.new(w,373.5,292.5, 'text'=>'303', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,272,203,272,249,252,249,252,230, - 244,230,244,221,252,221,252,203, + 244,230,244,221,252,221,252,203, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '324' $floorItems['324'] = i - TkcText.new(w,262,226, 'text'=>'324', 'fill'=>color, + TkcText.new(w,262,226, 'text'=>'324', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, + i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '304' $floorItems['304'] = i - TkcText.new(w,324,301.5, 'text'=>'304', 'fill'=>color, + TkcText.new(w,324,301.5, 'text'=>'304', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '301' $floorItems['301'] = i - TkcText.new(w,358,209, 'text'=>'301', 'fill'=>color, + TkcText.new(w,358,209, 'text'=>'301', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, + i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '327' $floorItems['327'] = i - TkcText.new(w,387,215.5, 'text'=>'327', 'fill'=>color, + TkcText.new(w,387,215.5, 'text'=>'327', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, + i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '326' $floorItems['326'] = i - TkcText.new(w,365.5,150, 'text'=>'326', 'fill'=>color, + TkcText.new(w,365.5,150, 'text'=>'326', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282, - 375,274,397,274,397,248,339,248,339,242,308,242, + 375,274,397,274,397,248,339,248,339,242,308,242, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '302' $floorItems['302'] = i - TkcText.new(w,319.5,261, 'text'=>'302', 'fill'=>color, + TkcText.new(w,319.5,261, 'text'=>'302', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203, 272,193,263,180,242,180,175,180,175,169,156,169, 156,196,177,196,177,228,107,228,70,228,70,275,107,275, - 107,248,160,248,160,301,107,301,107,275,70,275, + 107,248,160,248,160,301,107,301,107,275,70,275, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '306' $floorItems['306'] = i - TkcText.new(w,200.5,284.5, 'text'=>'306', 'fill'=>color, + TkcText.new(w,200.5,284.5, 'text'=>'306', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall']) TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall']) @@ -1574,7 +1574,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($floor_demo) && $floor_demo - $floor_demo.destroy + $floor_demo.destroy $floor_demo = nil end @@ -1590,7 +1590,7 @@ base_frame = TkFrame.new($floor_demo).pack(:fill=>:both, :expand=>true) # label À¸À® -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥Ç¥£¥¸¥¿¥ë¥¨¥¯¥¤¥Ã¥×¥á¥ó¥È¼Ò¤Î¥¦¥§¥¹¥¿¥ó¥ê¥µ¡¼¥Á¥é¥Ü¥é¥È¥ê (DECWRL) ¤Î´Ö¼è¤ê¤¬½ñ¤«¤ì¤¿¥­¥ã¥ó¥Ð¥¹ widget ¤¬Æþ¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤Ï 3³¬·ú¤Æ¤Ç¡¢¾ï¤Ë¤½¤Î¤¦¤Á¤Î1³¬Ê¬¤¬ÁªÂò¡¢¤Ä¤Þ¤ê¤½¤Î´Ö¼è¤ê¤¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤¢¤ë³¬¤òÁªÂò¤¹¤ë¤Ë¤Ï¡¢¤½¤Î¾å¤Ç¥Þ¥¦¥¹¤Îº¸¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£¥Þ¥¦¥¹¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë³¬¤Î¾å¤òư¤¯¤È¡¢¤½¤Î²¼¤Ë¤¢¤ëÉô²°¤Î¿§¤¬ÊѤï¤ê¡¢Éô²°Èֹ椬¡ÖÉô²°ÈÖ¹æ:¡×¥¨¥ó¥È¥ê¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£¤Þ¤¿¡¢¥¨¥ó¥È¥ê¤ËÉô²°ÈÖ¹æ¤ò½ñ¤¯¤È¤½¤ÎÉô²°¤Î¿§¤¬ÊѤï¤ê¤Þ¤¹¡£"){ pack('side'=>'top') } @@ -1622,10 +1622,10 @@ if $tk_version =~ /^4\.[01]/ $floor_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken', 'highlightthickness'=>2) - $floor_canvas = TkCanvas.new($floor_canvas_frame, - 'width'=>900, 'height'=>500, 'borderwidth'=>0, + $floor_canvas = TkCanvas.new($floor_canvas_frame, + 'width'=>900, 'height'=>500, 'borderwidth'=>0, 'highlightthickness'=>0) {|c| - TkScrollbar.new(base_frame, 'orient'=>'horiz', + TkScrollbar.new(base_frame, 'orient'=>'horiz', 'command'=>proc{|*args| c.xview(*args)}){|hs| c.xscrollcommand(proc{|first,last| hs.set first,last}) pack('side'=>'bottom', 'fill'=>'x') @@ -1646,20 +1646,20 @@ v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical') TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1| - $floor_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, - 'borderwidth'=>0, + $floor_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, + 'borderwidth'=>0, 'highlightthickness'=>0) { xscrollcommand(proc{|first,last| h.set first,last}) yscrollcommand(proc{|first,last| v.set first,last}) pack('expand'=>'yes', 'fill'=>'both') } - grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, + grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') } - v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, + v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, + h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) @@ -1676,7 +1676,7 @@ # Create an entry for displaying and typing in current room. $currentRoom = TkVariable.new -$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken', +$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken', 'bd'=>2, 'textvariable'=>$currentRoom) # Choose colors, then fill in the floorplan. @@ -1713,7 +1713,7 @@ $floor_canvas.itembind('room', 'Enter', proc{newRoom $floor_canvas}) $floor_canvas.itembind('room', 'Leave', proc{$currentRoom.value = ''}) $floor_canvas.bind('2', proc{|x,y| $floor_canvas.scan_mark x,y}, '%x %y') -$floor_canvas.bind('B2-Motion', +$floor_canvas.bind('B2-Motion', proc{|x,y| $floor_canvas.scan_dragto x,y}, '%x %y') $floor_canvas.bind('Destroy', proc{$currentRoom.unset}) $currentRoom.value = '' Index: ext/tk/sample/demos-jp/widget =================================================================== --- ext/tk/sample/demos-jp/widget (revision 23917) +++ ext/tk/sample/demos-jp/widget (working copy) @@ -2,7 +2,8 @@ # -*- coding: euc-jp -*- # ´Á»ú¥³¡¼¥ÉÀßÄê ( tk.rb ¤Î¥í¡¼¥É»þ¤Î encoding ¿äÄê/ÀßÄê¤Ë»È¤ï¤ì¤ë ) -if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!!!! +#if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!!!! +unless defined?(::Encoding.default_external) $KCODE = 'euc' else DEFAULT_TK_ENCODING = 'EUC-JP' @@ -189,10 +190,14 @@ yscrollcommand proc{|first,last| scr.set first,last} } scr.command(proc{|*args| txt.yview(*args)}) + # txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both', 'padx'=>1) - txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both') +# txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both') # textFrame.pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>2) textFrame.pack('expand'=>'yes', 'fill'=>'both') + # $root.withdraw.deiconify + Tk.update_idletasks + txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both') statusBar = TkFrame.new($root) {|f| if $tk_version =~ /^4.*/ @@ -881,18 +886,12 @@ $code_window.title("Demo code: #{file}") $code_window.iconname(file) -# fid = open(file, 'r') - fid = open([$demo_dir, file].join(File::Separator), 'r') + code = open([$demo_dir, file].join(File::Separator), 'r'){|fid| fid.read } $code_text.delete('1.0', 'end') - #$code_text.insert('1.0', `cat #{file}`) - $code_text.insert('1.0', fid.read) - #$code_mark = TkTextMark.new($code_text, '1.0') - #$code_text.set_insert('1.0') + code.force_encoding('EUC-JP') if defined?(::Encoding.default_external) + $code_text.insert('1.0', code) TkTextMarkInsert.new($code_text,'1.0') - $set_linenum.call($code_text) - - fid.close end def showCode2(demo) @@ -973,14 +972,12 @@ $code_window.title("Demo code: #{file}") $code_window.iconname(file) - fid = open([$demo_dir, file].join(File::Separator), 'r') + code = open([$demo_dir, file].join(File::Separator), 'r'){|fid| fid.read } $code_text.delete('1.0', 'end') - $code_text.insert('1.0', fid.read) + code.force_encoding('EUC-JP') if defined?(::Encoding.default_external) + $code_text.insert('1.0', code) TkTextMarkInsert.new($code_text,'1.0') - $set_linenum.call($code_text) - - fid.close end if $tk_major_ver < 8 @@ -1077,7 +1074,7 @@ # def aboutBox Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo', - 'message'=>"Ruby/Tk ¥¦¥£¥¸¥§¥Ã¥È¥Ç¥â Ver.1.7.0-jp\n\n" + + 'message'=>"Ruby/Tk ¥¦¥£¥¸¥§¥Ã¥È¥Ç¥â Ver.1.7.1-jp\n\n" + "based on demos of Tk8.1 -- 8.5 " + "( Copyright of Tcl/Tk demos:: " + "(c) 1996-1997 Sun Microsystems, Inc. / " + Index: ext/tk/sample/demos-jp/entry3.rb =================================================================== --- ext/tk/sample/demos-jp/entry3.rb (revision 23917) +++ ext/tk/sample/demos-jp/entry3.rb (working copy) @@ -8,7 +8,7 @@ # based on Tcl/Tk8.4.4 widget demos if defined?($entry3_demo) && $entry3_demo - $entry3_demo.destroy + $entry3_demo.destroy $entry3_demo = nil end @@ -20,8 +20,8 @@ base_frame = TkFrame.new($entry3_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'5i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'5i', :justify=>:left, :text=><:top) °Ê²¼¤Ë¤Ï£´¼ïÎà¤Î¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥³Æ¥¨¥ó¥È¥ê¥Ü¥Ã¥¯¥¹¤Ï¡¤\ ¥Þ¥¦¥¹¥¯¥ê¥Ã¥¯¤ÇÁªÂò¤·Ê¸»ú¤òÂǤÁ¹þ¤à¤³¤È¤¬²Äǽ¤Ç¤¹¤¬¡¤¤½¤ì¤¾¤ì¤¬¤É¤Î¤è¤¦¤Ê\ @@ -68,20 +68,20 @@ def focusAndFlash(widget, fg, bg, count=5) return if count <= 0 if fg && !fg.empty? && bg && !bg.empty? - TkTimer.new(200, count, - proc{widget.configure(:foreground=>bg, :background=>fg)}, + TkTimer.new(200, count, + proc{widget.configure(:foreground=>bg, :background=>fg)}, proc{widget.configure(:foreground=>fg, :background=>bg)} ).start else # TkTimer.new(150, 3){Tk.bell}.start Tk.bell - TkTimer.new(200, count, - proc{widget.configure(:foreground=>'white', - :background=>'black')}, - proc{widget.configure(:foreground=>'black', + TkTimer.new(200, count, + proc{widget.configure(:foreground=>'white', + :background=>'black')}, + proc{widget.configure(:foreground=>'black', :background=>'white')} ).at_end{begin - widget.configure(:foreground=>fg, + widget.configure(:foreground=>fg, :background=>bg) rescue # ignore @@ -91,7 +91,7 @@ end l1 = TkLabelFrame.new(base_frame, :text=>"À°¿ô¥¨¥ó¥È¥ê") -TkEntry.new(l1, :validate=>:focus, +TkEntry.new(l1, :validate=>:focus, :vcmd=>[ proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' ]) {|e| @@ -102,7 +102,7 @@ } l2 = TkLabelFrame.new(base_frame, :text=>"ŤµÀ©ÌóÉÕ¤­¥¨¥ó¥È¥ê") -TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell}, +TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell}, :vcmd=>[proc{|s| s.length < 10}, '%P'] ).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') @@ -176,7 +176,7 @@ def validatePhoneChange(widget, vmode, idx, char) return true if idx == nil - Tk.after_idle(proc{widget.configure(:validate=>vmode, + Tk.after_idle(proc{widget.configure(:validate=>vmode, :invcmd=>proc{Tk.bell})}) if !(idx<3 || idx==6 || idx==7 || idx==11 || idx>15) && char =~ /[0-9A-Za-z]/ widget.delete(idx) @@ -191,10 +191,10 @@ l3 = TkLabelFrame.new(base_frame, :text=>"ÊÆ¹ñÅÅÏÃÈֹ楨¥ó¥È¥ê") -TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, - :textvariable=>entry3content, +TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, + :textvariable=>entry3content, :vcmd=>[ - proc{|w,v,i,s| validatePhoneChange(w,v,i,s)}, + proc{|w,v,i,s| validatePhoneChange(w,v,i,s)}, "%W %v %i %S" ]){|e| # Click to focus goes to the first editable character... @@ -210,9 +210,9 @@ } l4 = TkLabelFrame.new(base_frame, :text=>"¥Ñ¥¹¥ï¡¼¥É¥¨¥ó¥È¥ê") -TkEntry.new(l4, :validate=>:key, :show=>'*', +TkEntry.new(l4, :validate=>:key, :show=>'*', :vcmd=>[ - proc{|s| s.length <= 8}, + proc{|s| s.length <= 8}, '%P' ]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') Index: ext/tk/sample/demos-jp/twind.rb =================================================================== --- ext/tk/sample/demos-jp/twind.rb (revision 23917) +++ ext/tk/sample/demos-jp/twind.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($twind_demo) && $twind_demo - $twind_demo.destroy + $twind_demo.destroy $twind_demo = nil end @@ -39,10 +39,10 @@ # frame À¸À® $twind_text = nil -TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, +TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, 'relief'=>'sunken') {|f| - $twind_text = TkText.new(f, 'setgrid'=>'true', 'font'=>$font, - 'width'=>'70', 'height'=>35, 'wrap'=>'word', + $twind_text = TkText.new(f, 'setgrid'=>'true', 'font'=>$font, + 'width'=>'70', 'height'=>35, 'wrap'=>'word', 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| TkScrollbar.new(f) {|s| command proc{|*args| t.yview(*args)} @@ -52,11 +52,11 @@ }.pack('expand'=>'yes', 'fill'=>'both') # ¥¿¥°À¸À® -$tag_center = TkTextTag.new($twind_text, +$tag_center = TkTextTag.new($twind_text, 'justify' =>'center', 'spacing1'=>'5m', 'spacing3'=>'5m' ) -$tag_buttons = TkTextTag.new($twind_text, +$tag_buttons = TkTextTag.new($twind_text, 'lmargin1'=>'1c', 'lmargin2'=>'1c', 'rmargin' =>'1c', @@ -65,14 +65,14 @@ 'spacing3'=>0 ) # ¥Æ¥­¥¹¥È¤ÎÀ¸À® -$twind_text.insert('end', +$twind_text.insert('end', '¥Æ¥­¥¹¥Èwidget¾å¤Ë¾¤Îwidget¤òÁȤ߹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£') $twind_text.insert('end', 'ÁȤ߹þ¤ß¥¦¥£¥ó¥É¥¦¤È¸Æ¤Ð¤ì¡¢Ç¤°Õ¤Îwidget¤¬²Äǽ¤Ç¤¹¡£') $twind_text.insert('end', 'Î㤨¤Ð¡¢¤³¤³¤Ë2¤Ä¤Î¥Ü¥¿¥ówidget¤¬ÁȤ߹þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£') $twind_text.insert('end', 'ºÇ½é¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤È¿åÊ¿Êý¸þ¤Î¥¹¥¯¥í¡¼¥ë¤ò') -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { #text 'ON' text '¥ª¥ó' @@ -81,7 +81,7 @@ }) $twind_text.insert('end', "¤Ë¤·¤Þ¤¹¡£¤Þ¤¿2¤Ä¤á¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È\n") $twind_text.insert('end', '¿åÊ¿Êý¸þ¤Î¥¹¥¯¥í¡¼¥ë¤ò') -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { #text 'OFF' text '¥ª¥Õ' @@ -91,7 +91,7 @@ $twind_text.insert('end', '¤Ë¤·¤Þ¤¹¡£') $twind_text.insert('end', '¤â¤¦¤Ò¤È¤Ä¤ÎÎã¤Ç¤¹¡£') -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { text '¤³¤³¤ò¥¯¥ê¥Ã¥¯' command proc{textWindPlot $twind_text} @@ -101,7 +101,7 @@ $mark_plot = TkTextMark.new($twind_text, 'insert') $mark_plot.gravity='left' $twind_text.insert('end', '¥Þ¥¦¥¹¤Ç¥Ç¡¼¥¿¤òÉÁ²è¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£') -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { text '¾Ãµî' command proc{textWindDel $twind_text} @@ -125,7 +125,7 @@ ') -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) {|b| text '¥Ç¥Õ¥©¥ë¥È' command proc{embDefBg $twind_text} @@ -134,7 +134,7 @@ }, 'padx'=>3 ) embToggle = TkVariable.new('Short') -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkCheckButton.new($twind_text) { textvariable embToggle indicatoron 0 @@ -145,21 +145,21 @@ pady 5 padx 2 }, - 'padx'=>3, + 'padx'=>3, 'pady'=>2 ) -[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', - 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', - 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', - 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' +[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', + 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', + 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', + 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' ].each{|twind_color| - TkTextWindow.new($twind_text, 'end', + TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { text twind_color cursor 'top_left_arrow' command proc{$twind_text.bg twind_color} }, - 'padx'=>3, + 'padx'=>3, 'pady'=>2 ) } @@ -217,39 +217,39 @@ TkcLine.new($twind_plot, 100, 250, 400, 250, 'width'=>2) TkcLine.new($twind_plot, 100, 250, 100, 50, 'width'=>2) - TkcText.new($twind_plot, 225, 20, + TkcText.new($twind_plot, 225, 20, 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) TkcLine.new($twind_plot, x, 250, x, 245, 'width'=>2) - TkcText.new($twind_plot, x, 254, + TkcText.new($twind_plot, x, 254, 'text'=>10*i, 'font'=>font, 'anchor'=>'n') } (0..5).each {|i| y = 250 - (i * 40) TkcLine.new($twind_plot, 100, y, 105, y, 'width'=>2) - TkcText.new($twind_plot, 96, y, + TkcText.new($twind_plot, 96, y, 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') } for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] x = 100 + (3*xx) y = 250 - (4*yy)/5 - item = TkcOval.new($twind_plot, x-6, y-6, x+6, y+6, + item = TkcOval.new($twind_plot, x-6, y-6, x+6, y+6, 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') item.addtag 'point' end - $twind_plot.itembind('point', 'Any-Enter', + $twind_plot.itembind('point', 'Any-Enter', proc{$twind_plot.itemconfigure 'current', 'fill', 'red'}) - $twind_plot.itembind('point', 'Any-Leave', + $twind_plot.itembind('point', 'Any-Leave', proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) - $twind_plot.itembind('point', '1', + $twind_plot.itembind('point', '1', proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y") - $twind_plot.itembind('point', 'ButtonRelease-1', + $twind_plot.itembind('point', 'ButtonRelease-1', proc{$twind_plot.dtag 'selected'}) - $twind_plot.bind('B1-Motion', + $twind_plot.bind('B1-Motion', proc{|x,y| embPlotMove $twind_plot,x,y}, "%x %y") while ($twind_text.get($mark_plot) =~ /[ \t\n]/) $twind_text.delete $mark_plot Index: ext/tk/sample/demos-jp/ttkprogress.rb =================================================================== --- ext/tk/sample/demos-jp/ttkprogress.rb (revision 23917) +++ ext/tk/sample/demos-jp/ttkprogress.rb (working copy) @@ -7,7 +7,7 @@ # based on "Id: ttkprogress.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($ttkprogress_demo) && $ttkprogress_demo - $ttkprogress_demo.destroy + $ttkprogress_demo.destroy $ttkprogress_demo = nil end @@ -19,7 +19,7 @@ base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) ²¼¤Ë¤¢¤ë¤Î¤ÏÆó¤Ä¤Î¥×¥í¥°¥ì¥¹¥Ð¡¼¤Ç¤¹¡¥\ ¾å¤Î¤â¤Î¤Ï"determinate"¥¿¥¤¥×¤Î¥×¥í¥°¥ì¥¹¥Ð¡¼¤Ç¡¤\ @@ -37,16 +37,16 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttkprogress'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttkprogress'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttkprogress_demo.destroy $ttkprogress_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -57,9 +57,9 @@ p1 = Ttk::Progressbar.new(frame, :mode=>:determinate) p2 = Ttk::Progressbar.new(frame, :mode=>:indeterminate) -start = Ttk::Button.new(frame, :text=>'Start Progress', +start = Ttk::Button.new(frame, :text=>'Start Progress', :command=>proc{ p1.start; p2.start }) -stop = Ttk::Button.new(frame, :text=>'Stop Progress', +stop = Ttk::Button.new(frame, :text=>'Stop Progress', :command=>proc{ p1.stop; p2.stop }) Tk.grid(p1, '-', :pady=>5, :padx=>10) Index: ext/tk/sample/demos-jp/icon.rb =================================================================== --- ext/tk/sample/demos-jp/icon.rb (revision 23917) +++ ext/tk/sample/demos-jp/icon.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($icon_demo) && $icon_demo - $icon_demo.destroy + $icon_demo.destroy $icon_demo = nil end Index: ext/tk/sample/demos-jp/check2.rb =================================================================== --- ext/tk/sample/demos-jp/check2.rb (revision 23917) +++ ext/tk/sample/demos-jp/check2.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($check2_demo) && $check2_demo - $check2_demo.destroy + $check2_demo.destroy $check2_demo = nil end @@ -35,35 +35,35 @@ # frame À¸À® TkFrame.new(base_frame) {|frame| - TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), + TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - TkButton.new(frame, :text=>'ÊÑ¿ô»²¾È', - :image=>$image['view'], :compound=>:left, + TkGrid('x', + TkButton.new(frame, :text=>'ÊÑ¿ô»²¾È', + :image=>$image['view'], :compound=>:left, :command=>proc{ - showVars($check2_demo, - ['safety', safety], ['wipers', wipers], + showVars($check2_demo, + ['safety', safety], ['wipers', wipers], ['brakes', brakes], ['sober', sober]) - }), - TkButton.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'check2'}), - TkButton.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + }), + TkButton.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'check2'}), + TkButton.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $check2_demo $check2_demo = nil $showVarsWin[tmppath.path] = nil tmppath.destroy - }), + }), :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) }.pack('side'=>'bottom', 'fill'=>'x') # checkbutton À¸À® -TkCheckButton.new(base_frame, :text=>'°ÂÁ´À­¸¡ºº', :variable=>safety, - :relief=>:flat, :onvalue=>'all', :offvalue=>'none', +TkCheckButton.new(base_frame, :text=>'°ÂÁ´À­¸¡ºº', :variable=>safety, + :relief=>:flat, :onvalue=>'all', :offvalue=>'none', :tristatevalue=>'partial'){ pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') } @@ -71,7 +71,7 @@ [ TkCheckButton.new(base_frame, 'text'=>'¥ï¥¤¥Ñ¡¼ OK', 'variable'=>wipers), TkCheckButton.new(base_frame, 'text'=>'¥Ö¥ì¡¼¥­ OK', 'variable'=>brakes), TkCheckButton.new(base_frame, 'text'=>'±¿Å¾¼ê ÁÇÌÌ', 'variable'=>sober) -].each{|w| +].each{|w| w.relief('flat') w.pack('side'=>'top', 'padx'=>15, 'pady'=>2, 'anchor'=>'w') } Index: ext/tk/sample/demos-jp/toolbar.rb =================================================================== --- ext/tk/sample/demos-jp/toolbar.rb (revision 23917) +++ ext/tk/sample/demos-jp/toolbar.rb (working copy) @@ -7,7 +7,7 @@ # based on "Id: toolbar.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($toolbar_demo) && $toolbar_demo - $toolbar_demo.destroy + $toolbar_demo.destroy $toolbar_demo = nil end @@ -86,28 +86,28 @@ text = TkText.new(base_frame, :width=>40, :height=>10) ## Toolbar contents -tb_btn = Ttk::Button.new(tbar_base, :text=>'¥Ü¥¿¥ó', :style=>'Toolbutton', +tb_btn = Ttk::Button.new(tbar_base, :text=>'¥Ü¥¿¥ó', :style=>'Toolbutton', :command=>proc{ text.insert(:end, "¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤Þ¤·¤¿¡¥\n") }) -tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'¥Á¥§¥Ã¥¯¥Ü¥¿¥ó', - :style=>'Toolbutton', - :variable=>(check = TkVariable.new), +tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'¥Á¥§¥Ã¥¯¥Ü¥¿¥ó', + :style=>'Toolbutton', + :variable=>(check = TkVariable.new), :command=>proc{ text.insert(:end, "¥Á¥§¥Ã¥¯¥Ü¥¿¥ó¤ÎÃͤÏ#{check.value}¤Ç¤¹¡¥\n") }) tb_mbtn = Ttk::Menubutton.new(tbar_base, :text=>'¥á¥Ë¥å¡¼') -tb_combo = Ttk::Combobox.new(tbar_base, :value=>TkFont.families, +tb_combo = Ttk::Combobox.new(tbar_base, :value=>TkFont.families, :state=>:readonly) tb_mbtn.menu(menu = Tk::Menu.new(tb_mbtn)) menu.add(:command, :label=>'Just', :command=>proc{text.insert(:end, "Just\n")}) menu.add(:command, :label=>'An', :command=>proc{text.insert(:end, "An\n")}) -menu.add(:command, :label=>'Example', +menu.add(:command, :label=>'Example', :command=>proc{text.insert(:end, "Example\n")}) tb_combo.bind(''){ text.font.family = tb_combo.get } ## Arrange contents -Tk.grid(tb_btn, tb_chk, tb_mbtn, tb_combo, +Tk.grid(tb_btn, tb_chk, tb_mbtn, tb_combo, :in=>contents, :padx=>2, :sticky=>'ns') Tk.grid(tbar_base, :sticky=>'ew') Tk.grid(sep, :sticky=>'ew') @@ -120,16 +120,16 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'toolbar'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'toolbar'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $toolbar_demo.destroy $toolbar_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) Tk.grid(frame, :sticky=>'ew') Index: ext/tk/sample/demos-jp/image1.rb =================================================================== --- ext/tk/sample/demos-jp/image1.rb (revision 23917) +++ ext/tk/sample/demos-jp/image1.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($image1_demo) && $image1_demo - $image1_demo.destroy + $image1_demo.destroy $image1_demo = nil end Index: ext/tk/sample/demos-jp/ttkpane.rb =================================================================== --- ext/tk/sample/demos-jp/ttkpane.rb (revision 23917) +++ ext/tk/sample/demos-jp/ttkpane.rb (working copy) @@ -7,7 +7,7 @@ # based on "Id: ttkpane.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($ttkpane_demo) && $ttkpane_demo - $ttkpane_demo.destroy + $ttkpane_demo.destroy $ttkpane_demo = nil end @@ -19,7 +19,7 @@ base_frame = TkFrame.new($ttkpane_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) ¤³¤Î¥Ç¥â¤Ï¡¤Ëä¤á¹þ¤ß´Ø·¸¤Ë¤¢¤ë¥Æ¡¼¥ÞÉÕ¤­¥Ú¥¤¥ó¥É¥¦¥£¥ó¥É¥¦¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡¥\ ¤½¤ì¤¾¤ì¤ÎÂ礭¤µ¤Ï¡¤´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ú¥¤¥ó¤Î´Ö¤Ë¤¢¤ë¥¨¥ê¥¢¤ò¤Ä¤«¤ó¤Ç\ @@ -32,16 +32,16 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttkpane'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttkpane'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttkpane_demo.destroy $ttkpane_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -61,26 +61,26 @@ end # Fill the button pane -Ttk::Button.new(left_top, :text=>'²¡¤·¤Æ¤Í', +Ttk::Button.new(left_top, :text=>'²¡¤·¤Æ¤Í', :command=>proc{ - Tk.messageBox(:type=>'ok', :icon=>'info', - :message=>'¤¤¤Æ¤Æ¡ª', - :detail=>'That hurt...', :parent=>base_frame, + Tk.messageBox(:type=>'ok', :icon=>'info', + :message=>'¤¤¤Æ¤Æ¡ª', + :detail=>'That hurt...', :parent=>base_frame, :title=>'Button Pressed') }).pack(:padx=>2, :pady=>5) zones_list = [ - [':Europe/Berlin'], - [':America/Argentina/Buenos_Aires', ':America/Buenos_Aires'], - [':Africa/Johannesburg'], - [':Europe/London'], - [':America/Los_Angeles'], + [':Europe/Berlin'], + [':America/Argentina/Buenos_Aires', ':America/Buenos_Aires'], + [':Africa/Johannesburg'], + [':Europe/London'], + [':America/Los_Angeles'], [':Europe/Moscow'], - [':America/New_York'], - [':Asia/Singapore'], - [':Australia/Sydney'], - [':Asia/Tokyo'], + [':America/New_York'], + [':Asia/Singapore'], + [':Australia/Sydney'], + [':Asia/Tokyo'], ] zones = [] @@ -158,7 +158,7 @@ case tzinfo when :tcl update_proc = proc{|now, tz, label| - time[label] = Tk.tk_call('clock', 'format', now.tv_sec, + time[label] = Tk.tk_call('clock', 'format', now.tv_sec, '-timezone', tz, '-format', '%T') } when :tzinfo @@ -179,7 +179,7 @@ zones.each_with_index{|(zone, label), idx| Ttk::Separator.new(left_bot).pack(:fill=>:x) if idx > 0 Ttk::Label.new(left_bot, :text=>label, :anchor=>'w').pack(:fill=>:x) - Ttk::Label.new(left_bot, :textvariable=>time.ref(label), + Ttk::Label.new(left_bot, :textvariable=>time.ref(label), :anchor=>'w').pack(:fill=>:x) } Index: ext/tk/sample/demos-jp/paned1.rb =================================================================== --- ext/tk/sample/demos-jp/paned1.rb (revision 23917) +++ ext/tk/sample/demos-jp/paned1.rb (working copy) @@ -8,7 +8,7 @@ # based on "Id: paned1.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp" if defined?($paned1_demo) && $paned1_demo - $paned1_demo.destroy + $paned1_demo.destroy $paned1_demo = nil end @@ -20,8 +20,8 @@ base_frame = TkFrame.new($paned1_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'4i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top) ²¼¤Î¿§ÉÕ¤±¤µ¤ì¤¿Æó¤Ä¤Î¥¦¥£¥ó¥É¥¦¤Î´Ö¤Î»ÅÀÚ¤êÏȤϡ¢°ì¤Ä¤ÎÎΰè¤ò¤½¤ì¤¾¤ì¤Î¥¦¥£¥ó¥É¥¦¤Î¤¿¤á¤Ëʬ³ä¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¹¡£º¸¥Ü¥¿¥ó¤Ç»ÅÀÚ¤ê¤òÁàºî¤¹¤ë¤È¡¢Ê¬³ä¥µ¥¤¥ºÊѹ¹¤ÎÁàºîÅÓÃæ¤Ç¤ÏºÆÉ½¼¨¤Ï¤Ê¤µ¤ì¤º¡¢³ÎÄꤵ¤»¤¿¤È¤­¤Ëɽ¼¨¤¬¹¹¿·¤µ¤ì¤Þ¤¹¡£¥Þ¥¦¥¹¤Ë¤è¤ë»ÅÀÚ¤ê¤ÎÁàºî¤ËÄɿ路¤Æ¥µ¥¤¥º¤òÊѹ¹¤·¤¿É½¼¨¤¬¤Ê¤ï¤ì¤ë¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢¥Þ¥¦¥¹¤ÎÃæ±û¥Ü¥¿¥ó¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£ ¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë Ruby ¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë Tk ¥é¥¤¥Ö¥é¥ê¤¬ panedwindow ¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤ @@ -45,7 +45,7 @@ } TkPanedwindow.new(base_frame, :orient=>:horizontal){|f| - add(Tk::Label.new(f, :text=>"This is the\nleft side", :bg=>'yellow'), + add(Tk::Label.new(f, :text=>"This is the\nleft side", :bg=>'yellow'), Tk::Label.new(f, :text=>"This is the\nright side", :bg=>'cyan')) pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m') Index: ext/tk/sample/demos-jp/ttkbut.rb =================================================================== --- ext/tk/sample/demos-jp/ttkbut.rb (revision 23917) +++ ext/tk/sample/demos-jp/ttkbut.rb (working copy) @@ -9,7 +9,7 @@ # based on "Id: ttkbut.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp" if defined?($ttkbut_demo) && $ttkbut_demo - $ttkbut_demo.destroy + $ttkbut_demo.destroy $ttkbut_demo = nil end @@ -21,7 +21,7 @@ base_frame = TkFrame.new($ttkbut_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) Ttk¤È¤Ï¡¤¥Æ¡¼¥Þ»ØÄê²Äǽ¤Ê¿·¤·¤¤¥¦¥£¥¸¥§¥Ã¥È½¸¹ç¤Ç¤¹¡¥\ º£¡¤¤¢¤Ê¤¿¤¬Ìܤˤ·¤Æ¤¤¤ë¤Î¤ÏTtk¤Î¥Æ¡¼¥Þ²½¥é¥Ù¥ë¤Ç¡¤\ @@ -40,11 +40,11 @@ ## Add buttons for setting the theme buttons = Ttk::Labelframe.new(base_frame, :text=>'¥Ü¥¿¥ó') # Ttk::Style.theme_names.each{|theme| -# Ttk::Button.new(buttons, :text=>theme, +# Ttk::Button.new(buttons, :text=>theme, # :command=>proc{Ttk::Style.theme_use theme}).pack(:pady=>2) # } Ttk.themes.each{|theme| - Ttk::Button.new(buttons, :text=>theme, + Ttk::Button.new(buttons, :text=>theme, :command=>proc{Ttk.set_theme theme}).pack(:pady=>2) } @@ -68,9 +68,9 @@ ## Set up the checkbutton group checks = Ttk::Labelframe.new(base_frame, :text=>'¥Á¥§¥Ã¥¯¥Ü¥¿¥ó') enabled = TkVariable.new(true) -e = Ttk::Checkbutton.new(checks, :text=>'Í­¸ú²½', :variable=>enabled, +e = Ttk::Checkbutton.new(checks, :text=>'Í­¸ú²½', :variable=>enabled, :command=>proc{ - setState($ttkbut_demo, + setState($ttkbut_demo, ((enabled.bool)? "!disabled" : "disabled"), e) }) @@ -96,15 +96,15 @@ happyness = TkVariable.new -r1 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r1 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Great', :value=>'great') -r2 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r2 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Good', :value=>'good') -r3 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r3 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Ok', :value=>'ok') -r4 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r4 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Poor', :value=>'poor') -r5 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r5 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Awful', :value=>'awful') Tk.pack(r1, r2, r3, r4, r5, :fill=>:x, :padx=>3, :pady=>2) @@ -113,26 +113,26 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'ÊÑ¿ô»²¾È', - :image=>$image['view'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'ÊÑ¿ô»²¾È', + :image=>$image['view'], :compound=>:left, :command=>proc{ - showVars(base_frame, ['Í­¸ú²½', enabled], - ['¥Á¡¼¥º', cheese], ['¥È¥Þ¥È', tomato], - ['¥Ð¥¸¥ë', basil], ['¥ª¥ì¥¬¥Î', oregano], + showVars(base_frame, ['Í­¸ú²½', enabled], + ['¥Á¡¼¥º', cheese], ['¥È¥Þ¥È', tomato], + ['¥Ð¥¸¥ë', basil], ['¥ª¥ì¥¬¥Î', oregano], ['¹¬Ê¡ÅÙ', happyness]) - }), - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttkbut'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + }), + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttkbut'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $ttkbut_demo $ttkbut_demo = nil $showVarsWin[tmppath.path] = nil tmppath.destroy - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x, :expand=>true) Index: ext/tk/sample/demos-jp/menu84.rb =================================================================== --- ext/tk/sample/demos-jp/menu84.rb (revision 23917) +++ ext/tk/sample/demos-jp/menu84.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget if defined?($menu84_demo) && $menu84_demo - $menu84_demo.destroy + $menu84_demo.destroy $menu84_demo = nil end @@ -37,9 +37,9 @@ menustatus = TkVariable.new(" ") TkFrame.new(base_frame) {|frame| - TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken', - 'bd'=>1, 'font'=>['Helvetica', '10'], - 'anchor'=>'w').pack('side'=>'left', 'padx'=>2, + TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken', + 'bd'=>1, 'font'=>['Helvetica', '10'], + 'anchor'=>'w').pack('side'=>'left', 'padx'=>2, 'expand'=>true, 'fill'=>'both') pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) } @@ -94,8 +94,8 @@ $menu84_frame.add('cascade', 'label'=>'Basic', 'menu'=>m, 'underline'=>0) add('command', 'label'=>'Long entry that does nothing') ['A','B','C','D','E','F','G'].each{|c| - add('command', 'label'=>"Print letter \"#{c}\"", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", + add('command', 'label'=>"Print letter \"#{c}\"", + 'underline'=>14, 'accelerator'=>"Meta+#{c}", 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } @@ -103,17 +103,17 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| $menu84_frame.add('cascade', 'label'=>'Cascades', 'menu'=>m, 'underline'=>0) - add('command', 'label'=>'Print hello', - 'command'=>proc{print "Hello\n"}, + add('command', 'label'=>'Print hello', + 'command'=>proc{print "Hello\n"}, 'accelerator'=>"#{modifier}+H", 'underline'=>6) $menu84_demo.bind("#{modifier}-h", proc{print "Hello\n"}) - add('command', 'label'=>'Print goodbye', - 'command'=>proc{print "Goodbye\n"}, + add('command', 'label'=>'Print goodbye', + 'command'=>proc{print "Goodbye\n"}, 'accelerator'=>"#{modifier}+G", 'underline'=>6) $menu84_demo.bind("#{modifier}-g", proc{print "Goodbye\n"}) TkMenu.new(m, 'tearoff'=>false) {|cascade_check| - m.add('cascade', 'label'=>'Check button', + m.add('cascade', 'label'=>'Check button', 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'¥ª¥¤¥ë¸¡ºº', 'variable'=>oil) @@ -124,18 +124,18 @@ lights = TkVariable.new(0) add('check', 'label'=>'¥é¥¤¥È¸¡ºº', 'variable'=>lights) add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['¥ª¥¤¥ë', oil], - ['¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥ó', trans], - ['¥Ö¥ì¡¼¥­', brakes], + add('command', 'label'=>'Show current values', + 'command'=>proc{showVars($menu84_demo, + ['¥ª¥¤¥ë', oil], + ['¥È¥é¥ó¥¹¥ß¥Ã¥·¥ç¥ó', trans], + ['¥Ö¥ì¡¼¥­', brakes], ['¥é¥¤¥È', lights])} ) invoke 1 invoke 3 } TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| - m.add('cascade', 'label'=>'Radio buttons', + m.add('cascade', 'label'=>'Radio buttons', 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10) @@ -149,9 +149,9 @@ add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold') add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') add('separator') - add('command', 'label'=>'¸½ºßÃͤÎɽ¼¨', - 'command'=>proc{showVars($menu84_demo, - ['pointSize', pointSize], + add('command', 'label'=>'¸½ºßÃͤÎɽ¼¨', + 'command'=>proc{showVars($menu84_demo, + ['pointSize', pointSize], ['style', style])} ) invoke 1 invoke 7 @@ -160,15 +160,15 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| $menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0) - add('command', 'hidemargin'=>1, + add('command', 'hidemargin'=>1, 'bitmap'=>'@'+[$demo_dir,'..', 'images','pattern.xbm'].join(File::Separator), - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', + 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', 'text'=>'¤¢¤Ê¤¿¤¬ÁªÂò¤·¤¿¥á¥Ë¥å¡¼¹àÌܤϡ¢Ê¸»úÎó¤ÎÂå¤ï¤ê¤Ë¥Ó¥Ã¥È¥Þ¥Ã¥×¥¤¥á¡¼¥¸¤Ç¹àÌܤòɽ¼¨¤·¤¿¤â¤Î¤Ç¤¹¡£¤½¤ì°Ê³°¤ÎÅÀ¤Ç¤Ï¡¢¤Û¤«¤Î¥á¥Ë¥å¡¼¹àÌÜ¤È¤Î´Ö¤ÇÆÃ¤Ë°ã¤¤¤¬¤¢¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£', - 'bitmap'=>'', 'default'=>0, + 'bitmap'=>'', 'default'=>0, 'buttons'=>'ÊĤ¸¤ë')} ) ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, 'hidemargin'=>1, + add('command', 'bitmap'=>icon, 'hidemargin'=>1, 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) } @@ -179,14 +179,14 @@ $menu84_frame.add('cascade', 'label'=>'More', 'menu'=>m, 'underline'=>0) [ 'An entry','Another entry','Does nothing','Does almost nothing', 'Make life meaningful' ].each{|i| - add('command', 'label'=>i, + add('command', 'label'=>i, 'command'=>proc{print "You invoked \"#{i}\"\n"}) } - m.entryconfigure('Does almost nothing', - 'bitmap'=>'questhead', 'compound'=>'left', + m.entryconfigure('Does almost nothing', + 'bitmap'=>'questhead', 'compound'=>'left', 'command'=>proc{ - TkDialog.new('title'=>'Compound Menu Entry', + TkDialog.new('title'=>'Compound Menu Entry', 'message'=>'¤¢¤Ê¤¿¤¬ÁªÂò¤·¤¿¥á¥Ë¥å¡¼¹àÌܤϡ¢¥Ó¥Ã¥È¥Þ¥Ã¥×¥¤¥á¡¼¥¸¤Èʸ»úÎó¤È¤òƱ»þ¤Ë°ì¤Ä¤Î¹àÌܤËɽ¼¨¤¹¤ë¤è¤¦¤Ë¤·¤¿¤â¤Î¤Ç¤¹¡£¤½¤ì°Ê³°¤ÎÅÀ¤Ç¤Ï¡¢¤Û¤«¤Î¥á¥Ë¥å¡¼¹àÌÜ¤È¤Î´Ö¤ÇÆÃ¤Ë°ã¤¤¤¬¤¢¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£', 'buttons'=>['λ²ò'], 'bitmap'=>'') }) @@ -195,7 +195,7 @@ TkMenu.new($menu84_frame) {|m| $menu84_frame.add('cascade', 'label'=>'Colors', 'menu'=>m, 'underline'=>0) ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, + add('command', 'label'=>c, 'background'=>c, 'command'=>proc{print "You invoked \"#{c}\"\n"}) } } Index: ext/tk/sample/demos-jp/msgbox2.rb =================================================================== --- ext/tk/sample/demos-jp/msgbox2.rb (revision 23917) +++ ext/tk/sample/demos-jp/msgbox2.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($msgbox2_demo) && $msgbox2_demo - $msgbox2_demo.destroy + $msgbox2_demo.destroy $msgbox2_demo = nil end @@ -48,9 +48,9 @@ # frame À¸À® $msgbox_leftframe = TkFrame.new(base_frame) $msgbox_rightframe = TkFrame.new(base_frame) -$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', +$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') -$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', +$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') TkLabel.new($msgbox_leftframe, 'text'=>'¥¢¥¤¥³¥ó').pack('side'=>'top') @@ -59,9 +59,9 @@ $msgboxIcon = TkVariable.new('info') ['error', 'info', 'question', 'warning'].each {|icon| - TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, - 'relief'=>'flat', 'value'=>icon, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, + 'relief'=>'flat', 'value'=>icon, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') } @@ -70,21 +70,21 @@ .pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') $msgboxType = TkVariable.new('ok') -['abortretryignore', 'ok', 'okcancel', +['abortretryignore', 'ok', 'okcancel', 'retrycancel', 'yesno', 'yesnocancel'].each {|type| - TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, - 'relief'=>'flat', 'value'=>type, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, + 'relief'=>'flat', 'value'=>type, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') } def showMessageBox2(w) - button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, + button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, 'title'=>'Message', 'parent'=>w, - 'message'=>"\"#{$msgboxType.value}\"¥¿¥¤¥×¤Î¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹", + 'message'=>"\"#{$msgboxType.value}\"¥¿¥¤¥×¤Î¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹", 'detail'=>"¤³¤ì¤Ï\"#{$msgboxType.value}\"¤È¤¤¤¦¼ïÎà¤Î¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹¤Ç¡¢\"#{$msgboxIcon.value}\"¤Î¥¢¥¤¥³¥ó¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£²¼¤Î¥Ü¥¿¥ó¤Î¤¤¤º¤ì¤«¤òÁªÂò¤·¤Æ¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£") - Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, + Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, 'message'=>"¤¢¤Ê¤¿¤Ï \"#{button}\" ¤ò²¡¤·¤Þ¤·¤¿¤Í¡£") end Index: ext/tk/sample/demos-jp/entry2.rb =================================================================== --- ext/tk/sample/demos-jp/entry2.rb (revision 23917) +++ ext/tk/sample/demos-jp/entry2.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($entry2_demo) && $entry2_demo - $entry2_demo.destroy + $entry2_demo.destroy $entry2_demo = nil end Index: ext/tk/sample/demos-jp/goldberg.rb =================================================================== --- ext/tk/sample/demos-jp/goldberg.rb (revision 23917) +++ ext/tk/sample/demos-jp/goldberg.rb (working copy) @@ -44,7 +44,7 @@ #>># lots of canvas create and move calls. if defined?($goldberg_demo) && $goldberg_demo - $goldberg_demo.destroy + $goldberg_demo.destroy $goldberg_demo = nil end @@ -103,7 +103,7 @@ @S['pause'] = TkVariable.new @S['details'] = TkVariable.new(true) - @S['mode'] = TkVariable.new(:MSTART, :symbol) + @S['mode'] = TkVariable.new(:MSTART, :symbol) # :MSTART, :MGO, :MPAUSE, :MSSTEP, :MBSTEP, :MDONE, :MDEBUG # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 @@ -134,19 +134,19 @@ @XY = {} @XY6 = { - '-1'=>[366, 207], '-2'=>[349, 204], '-3'=>[359, 193], '-4'=>[375, 192], + '-1'=>[366, 207], '-2'=>[349, 204], '-3'=>[359, 193], '-4'=>[375, 192], '-5'=>[340, 190], '-6'=>[349, 177], '-7'=>[366, 177], '-8'=>[380, 176], - '-9'=>[332, 172], '-10'=>[342, 161], '-11'=>[357, 164], - '-12'=>[372, 163], '-13'=>[381, 149], '-14'=>[364, 151], - '-15'=>[349, 146], '-16'=>[333, 148], '0'=>[357, 219], - '1'=>[359, 261], '2'=>[359, 291], '3'=>[359, 318], '4'=>[361, 324], - '5'=>[365, 329], '6'=>[367, 334], '7'=>[367, 340], '8'=>[366, 346], - '9'=>[364, 350], '10'=>[361, 355], '11'=>[359, 370], '12'=>[359, 391], - '13,0'=>[360, 456], '13,1'=>[376, 456], '13,2'=>[346, 456], - '13,3'=>[330, 456], '13,4'=>[353, 444], '13,5'=>[368, 443], - '13,6'=>[339, 442], '13,7'=>[359, 431], '13,8'=>[380, 437], - '13,9'=>[345, 428], '13,10'=>[328, 434], '13,11'=>[373, 424], - '13,12'=>[331, 420], '13,13'=>[360, 417], '13,14'=>[345, 412], + '-9'=>[332, 172], '-10'=>[342, 161], '-11'=>[357, 164], + '-12'=>[372, 163], '-13'=>[381, 149], '-14'=>[364, 151], + '-15'=>[349, 146], '-16'=>[333, 148], '0'=>[357, 219], + '1'=>[359, 261], '2'=>[359, 291], '3'=>[359, 318], '4'=>[361, 324], + '5'=>[365, 329], '6'=>[367, 334], '7'=>[367, 340], '8'=>[366, 346], + '9'=>[364, 350], '10'=>[361, 355], '11'=>[359, 370], '12'=>[359, 391], + '13,0'=>[360, 456], '13,1'=>[376, 456], '13,2'=>[346, 456], + '13,3'=>[330, 456], '13,4'=>[353, 444], '13,5'=>[368, 443], + '13,6'=>[339, 442], '13,7'=>[359, 431], '13,8'=>[380, 437], + '13,9'=>[345, 428], '13,10'=>[328, 434], '13,11'=>[373, 424], + '13,12'=>[331, 420], '13,13'=>[360, 417], '13,14'=>[345, 412], '13,15'=>[376, 410], '13,16'=>[360, 403] } @@ -163,11 +163,11 @@ def do_display() @ctrl = TkFrame.new(@parent, :relief=>:ridge, :bd=>2, :padx=>5, :pady=>5) - @screen = TkFrame.new(@parent, :bd=>2, - :relief=>:raised).pack(:side=>:left, :fill=>:both, + @screen = TkFrame.new(@parent, :bd=>2, + :relief=>:raised).pack(:side=>:left, :fill=>:both, :expand=>true) - @canvas = TkCanvas.new(@parent, :width=>850, :height=>700, + @canvas = TkCanvas.new(@parent, :width=>850, :height=>700, :bg=>@C['bg'], :highlightthickness=>0){ scrollregion([0, 0, 1000, 1000]) # Kludge to move everything up yview_moveto(0.05) @@ -206,8 +206,8 @@ command proc{showCode 'goldberg'} }.pack('side'=>'left', 'padx'=>5) - # @show = TkButton.new(frame, :text=>'>>', :command=>proc{show_ctrl}, - @show = Tk::Button.new(frame, :text=>'>>', :command=>proc{show_ctrl}, + # @show = TkButton.new(frame, :text=>'>>', :command=>proc{show_ctrl}, + @show = Tk::Button.new(frame, :text=>'>>', :command=>proc{show_ctrl}, :bg=>@C['bg'], :activebackground=>@C['bg']) @show.pack('side'=>'left') frame.place(:in=>@canvas, :relx=>1, :rely=>0, :anchor=>:ne) @@ -216,34 +216,34 @@ end def do_ctrl_frame - @start = Tk::Button.new(@parent, :text=>'Start', :bd=>6, + @start = Tk::Button.new(@parent, :text=>'Start', :bd=>6, :command=>proc{do_button(0)}) if font = @start['font'] @start.font(font.weight('bold')) end - @pause = TkCheckbutton.new(@parent, :text=>'Pause', :font=>font, - :command=>proc{do_button(1)}, :relief=>:raised, + @pause = TkCheckbutton.new(@parent, :text=>'Pause', :font=>font, + :command=>proc{do_button(1)}, :relief=>:raised, :variable=>@S['pause']) - @step = TkButton.new(@parent, :text=>'Single Step', :font=>font, + @step = TkButton.new(@parent, :text=>'Single Step', :font=>font, :command=>proc{do_button(2)}) - @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font, + @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font, :command=>proc{do_button(4)}) - @reset = TkButton.new(@parent, :text=>'Reset', :font=>font, + @reset = TkButton.new(@parent, :text=>'Reset', :font=>font, :command=>proc{do_button(3)}) @details = TkFrame.new(@parent, :bd=>2, :relief=>:ridge) - @detail = TkCheckbutton.new(@parent, :text=>'Details', :font=>font, + @detail = TkCheckbutton.new(@parent, :text=>'Details', :font=>font, :relief=>:raised, :variable=>@S['details']) - @msg_entry = TkEntry.new(@parent, :textvariable=>@S['message'], + @msg_entry = TkEntry.new(@parent, :textvariable=>@S['message'], :justify=>:center) - @speed_scale = TkScale.new(@parent, :orient=>:horizontal, - :from=>1, :to=>10, :font=>font, - :variable=>@S['speed'], :bd=>2, + @speed_scale = TkScale.new(@parent, :orient=>:horizontal, + :from=>1, :to=>10, :font=>font, + :variable=>@S['speed'], :bd=>2, :relief=>:ridge, :showvalue=>false) - @about = TkButton.new(@parent, :text=>'About', + @about = TkButton.new(@parent, :text=>'About', :command=>proc{about}, :font=>font) Tk.grid(@start, :in=>@ctrl, :row=>0, :sticky=>:ew) @@ -271,17 +271,17 @@ def do_detail_frame @f_details = TkFrame.new(@details) - @label = TkLabel.new(@f_details, :textvariable=>@S['cnt'], + @label = TkLabel.new(@f_details, :textvariable=>@S['cnt'], :bd=>1, :relief=>:solid, :bg=>'white') Tk.grid(@label, '-', '-', '-', :sticky=>:ew, :row=>0) idx = 1 loop { break unless respond_to?("move#{idx}") - l = TkLabel.new(@f_details, :text=>idx, :anchor=>:e, + l = TkLabel.new(@f_details, :text=>idx, :anchor=>:e, :width=>2, :bd=>1, :relief=>:solid, :bg=>'white') @STEP[idx] = 0 - ll = TkLabel.new(@f_details, :textvariable=>@STEP.ref(idx), + ll = TkLabel.new(@f_details, :textvariable=>@STEP.ref(idx), :width=>5, :bd=>1, :relief=>:solid, :bg=>'white') row = (idx + 1)/2 col = ((idx + 1) & 1) * 2 @@ -385,7 +385,7 @@ who = who.to_i n = send("move#{who}") if (n & 1).nonzero? # This guy still alive - alive << who + alive << who end if (n & 2).nonzero? # Next guy is active alive << (who + 1) @@ -418,12 +418,12 @@ # START HERE! banner def draw0 color = @C['0'] - TkcText.new(@canvas, - # [579, 119], :text=>'START HERE!', - [558, 119], :text=>'¤³¤³¤«¤é¥¹¥¿¡¼¥È¡ª', - :fill=>color, :anchor=>:w, + TkcText.new(@canvas, + # [579, 119], :text=>'START HERE!', + [558, 119], :text=>'¤³¤³¤«¤é¥¹¥¿¡¼¥È¡ª', + :fill=>color, :anchor=>:w, :tag=>'I0', :font=>['Times Roman', 12, :italic, :bold]) - TkcLine.new(@canvas, [719, 119, 763, 119], :tag=>'I0', :fill=>color, + TkcLine.new(@canvas, [719, 119, 763, 119], :tag=>'I0', :fill=>color, :width=>5, :arrow=>:last, :arrowshape=>[18, 18, 5]) @canvas.itembind('I0', '1'){ start } end @@ -437,7 +437,7 @@ end pos = [ - [673, 119], [678, 119], [683, 119], [688, 119], + [673, 119], [678, 119], [683, 119], [688, 119], [693, 119], [688, 119], [683, 119], [678, 119] ] step = step % pos.length @@ -449,15 +449,15 @@ def draw1 color = @C['1a'] color2 = @C['1b'] - TkcPolygon.new(@canvas, - [ 844, 133, 800, 133, 800, 346, 820, 346, - 820, 168, 844, 168, 844, 133 ], + TkcPolygon.new(@canvas, + [ 844, 133, 800, 133, 800, 346, 820, 346, + 820, 168, 844, 168, 844, 133 ], :width=>3, :fill=>color, :outline=>'') - TkcPolygon.new(@canvas, - [ 771, 133, 685, 133, 685, 168, 751, 168, - 751, 346, 771, 346, 771, 133 ], + TkcPolygon.new(@canvas, + [ 771, 133, 685, 133, 685, 168, 751, 168, + 751, 346, 771, 346, 771, 133 ], :width=>3, :fill=>color, :outline=>'') - TkcOval.new(@canvas, box(812, 122, 9), + TkcOval.new(@canvas, box(812, 122, 9), :tag=>'I1', :fill=>color2, :outline=>'') @canvas.itembind('I1', '1'){ start } @@ -466,9 +466,9 @@ def move1(step = nil) step = get_step(1, step) pos = [ - [807, 122], [802, 122], [797, 123], [793, 124], [789, 129], [785, 153], - [785, 203], [785, 278, :x], [785, 367], [810, 392], [816, 438], - [821, 503], [824, 585, :y], [838, 587], [848, 593], [857, 601], + [807, 122], [802, 122], [797, 123], [793, 124], [789, 129], [785, 153], + [785, 203], [785, 278, :x], [785, 367], [810, 392], [816, 438], + [821, 503], [824, 585, :y], [838, 587], [848, 593], [857, 601], [-100, -100] ] return 0 if step >= pos.length @@ -484,40 +484,40 @@ color = @C['2'] # Fulcrum - TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392], + TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392], :fill=>@C['fg'], :outline=>@C['fg']) # Strike box - TkcRectangle.new(@canvas, [628, 335, 660, 383], + TkcRectangle.new(@canvas, [628, 335, 660, 383], :fill=>'', :outline=>@C['fg']) (0..2).each{|y| yy = 335 + y*16 - TkcBitmap.new(@canvas, [628, yy], :bitmap=>'gray25', + TkcBitmap.new(@canvas, [628, yy], :bitmap=>'gray25', :anchor=>:nw, :foreground=>@C['fg']) - TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25', + TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25', :anchor=>:nw, :foreground=>@C['fg']) } # Lever - TkcLine.new(@canvas, [702, 366, 798, 366], + TkcLine.new(@canvas, [702, 366, 798, 366], :fill=>@C['fg'], :width=>6, :tag=>'I2_0') # R strap - TkcLine.new(@canvas, [712, 363, 712, 355], + TkcLine.new(@canvas, [712, 363, 712, 355], :fill=>@C['fg'], :width=>3, :tag=>'I2_1') # L strap - TkcLine.new(@canvas, [705, 363, 705, 355], + TkcLine.new(@canvas, [705, 363, 705, 355], :fill=>@C['fg'], :width=>3, :tag=>'I2_2') # Match stick - TkcLine.new(@canvas, [679, 356, 679, 360, 717, 360, 717, 356, 679, 356], + TkcLine.new(@canvas, [679, 356, 679, 360, 717, 360, 717, 356, 679, 356], :fill=>@C['fg'], :width=>3, :tag=>'I2_3') # Match head - TkcPolygon.new(@canvas, - [ 671, 352, 677.4, 353.9, 680, 358.5, 677.4, 363.1, - 671, 365, 664.6, 363.1, 662, 358.5, 664.6, 353.9 ], + TkcPolygon.new(@canvas, + [ 671, 352, 677.4, 353.9, 680, 358.5, 677.4, 363.1, + 671, 365, 664.6, 363.1, 662, 358.5, 664.6, 353.9 ], :fill=>color, :outline=>color, :tag=>'I2_4') end @@ -527,15 +527,15 @@ stages = [0, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1] xy = [] xy[0] = [ - 686, 333, 692, 323, 682, 316, 674, 309, 671, 295, 668, 307, + 686, 333, 692, 323, 682, 316, 674, 309, 671, 295, 668, 307, 662, 318, 662, 328, 671, 336 ] xy[1] = [ - 687, 331, 698, 322, 703, 295, 680, 320, 668, 297, 663, 311, + 687, 331, 698, 322, 703, 295, 680, 320, 668, 297, 663, 311, 661, 327, 671, 335 ] xy[2] = [ - 686, 331, 704, 322, 688, 300, 678, 283, 678, 283, 674, 298, + 686, 331, 704, 322, 688, 300, 678, 283, 678, 283, 674, 298, 666, 309, 660, 324, 672, 336 ] @@ -546,7 +546,7 @@ if step == 0 # Rotate the match beta = 20 - + ox, oy = anchor('I2_0', :s) # Where to pivot i = 0 @@ -571,23 +571,23 @@ xy = [ [602, 296], [577, 174], [518, 174] ] xy.each{|x, y| # 3 Pulleys - TkcOval.new(@canvas, box(x, y, 13), + TkcOval.new(@canvas, box(x, y, 13), :fill=>color, :outline=>@C['fg'], :width=>3) TkcOval.new(@canvas, box(x, y, 2), :fill=>@C['fg'], :outline=>@C['fg']) } # Wall to flame - TkcLine.new(@canvas, [750, 309, 670, 309], :tag=>'I3_s', + TkcLine.new(@canvas, [750, 309, 670, 309], :tag=>'I3_s', :width=>3, :fill=>@C['fg'], :smooth=>true) # Flame to pulley 1 - TkcLine.new(@canvas, [670, 309, 650, 309], :tag=>'I3_0', + TkcLine.new(@canvas, [670, 309, 650, 309], :tag=>'I3_0', :width=>3, :fill=>@C['fg'], :smooth=>true) - TkcLine.new(@canvas, [650, 309, 600, 309], :tag=>'I3_1', + TkcLine.new(@canvas, [650, 309, 600, 309], :tag=>'I3_1', :width=>3, :fill=>@C['fg'], :smooth=>true) # Pulley 1 half way to 2 - TkcLine.new(@canvas, [589, 296, 589, 235], :tag=>'I3_2', + TkcLine.new(@canvas, [589, 296, 589, 235], :tag=>'I3_2', :width=>3, :fill=>@C['fg']) # Pulley 1 other half to 2 @@ -597,26 +597,26 @@ TkcLine.new(@canvas, [577, 161, 518, 161], :width=>3, :fill=>@C['fg']) # Down to weight - TkcLine.new(@canvas, [505, 174, 505, 205], :tag=>'I3_w', + TkcLine.new(@canvas, [505, 174, 505, 205], :tag=>'I3_w', :width=>3, :fill=>@C['fg']) # Draw the weight as 2 circles, two rectangles and 1 rounded rectangle x1, y1, x2, y2 = [515, 207, 495, 207] - TkcOval.new(@canvas, box(x1, y1, 6), + TkcOval.new(@canvas, box(x1, y1, 6), :tag=>'I3_', :fill=>color2, :outline=>color2) - TkcOval.new(@canvas, box(x2, y2, 6), + TkcOval.new(@canvas, box(x2, y2, 6), :tag=>'I3_', :fill=>color2, :outline=>color2) - TkcRectangle.new(@canvas, x1, y1 - 6, x2, y2 + 6, + TkcRectangle.new(@canvas, x1, y1 - 6, x2, y2 + 6, :tag=>'I3_', :fill=>color2, :outline=>color2) - - TkcPolygon.new(@canvas, round_rect([492, 220, 518, 263], 15), + + TkcPolygon.new(@canvas, round_rect([492, 220, 518, 263], 15), :smooth=>true, :tag=>'I3_', :fill=>color2, :outline=>color2) - TkcLine.new(@canvas, [500, 217, 511, 217], + TkcLine.new(@canvas, [500, 217, 511, 217], :tag=>'I3_', :fill=>color2, :width=>10) # Bottom weight target - TkcLine.new(@canvas, [502, 393, 522, 393, 522, 465], + TkcLine.new(@canvas, [502, 393, 522, 393, 522, 465], :tag=>'I3__', :fill=>@C['fg'], :joinstyle=>:miter, :width=>10) end @@ -659,7 +659,7 @@ } # Swing gate - TkcLine.new(@canvas, [518, 464, 518, 428], + TkcLine.new(@canvas, [518, 464, 518, 428], :tag=>'I4', :fill=>color, :width=>1) end @@ -686,7 +686,7 @@ TkcPolygon.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'], :width=>3) xy = [ - 534.5, 445.5, 541, 440, 552, 436, 560, 436, 569, 440, 574, 446, + 534.5, 445.5, 541, 440, 552, 436, 560, 436, 569, 440, 574, 446, 575, 452, 574, 454, 566, 456, 554, 456, 545, 456, 537, 454, 530, 452 ] TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_0'], :fill=>color) @@ -696,7 +696,7 @@ xy = box(540, 446, 2) # Eye xy = [540, 444, 541, 445, 541, 447, 540, 448, 538, 447, 538, 445] - TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_2'], :fill=>@C['bg'], + TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_2'], :fill=>@C['bg'], :outline=>'', :smooth=>true) xy = [538, 454, 535, 461] # Front leg @@ -716,9 +716,9 @@ step = get_step(5, step) pos = [ - [553, 452], [533, 452], [513, 452], [493, 452], [473, 452], - [463, 442, 30], [445.5, 441.5, 30], [425.5, 434.5, 30], [422, 414], - [422, 394], [422, 374], [422, 354], [422, 334], [422, 314], [422, 294], + [553, 452], [533, 452], [513, 452], [493, 452], [473, 452], + [463, 442, 30], [445.5, 441.5, 30], [425.5, 434.5, 30], [422, 414], + [422, 394], [422, 374], [422, 354], [422, 334], [422, 314], [422, 294], [422, 274, -30], [422, 260.5, -30, :x], [422.5, 248.5, -28], [425, 237] ] @@ -739,16 +739,16 @@ color = @C['6'] xy = [324, 130, 391, 204] # Ball holder xy = round_rect(xy, 10) - TkcPolygon.new(@canvas, xy, :smooth=>true, + TkcPolygon.new(@canvas, xy, :smooth=>true, :outline=>@C['fg'], :width=>3, :fill=>color) xy = [339, 204, 376, 253] # Below the ball holder - TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>3, + TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>color, :tag=>'I6c') xy = box(346, 339, 28) TkcOval.new(@canvas, xy, :fill=>color, :outline=>'') # Roter - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc, :start=>80, :extent=>205) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc, :start=>-41, :extent=>85) xy = box(346, 339, 15) # Center of rotor @@ -763,10 +763,10 @@ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'') xy = [ - 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403, + 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403, 352, 403, 352, 366 ] - TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', + TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2) # Below rotor TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2) xy = box(275, 342, 7) # On/off rotor @@ -791,7 +791,7 @@ loc = -i color = colors[i] x, y = @XY6["#{loc}"] - TkcOval.new(@canvas, box(x, y, 5), + TkcOval.new(@canvas, box(x, y, 5), :fill=>color, :outline=>color, :tag=>"I6_b#{i}") } draw6a(12) # The wheel @@ -817,7 +817,7 @@ @canvas.move('I6_', -7, 0) if step == 1 # Poke a hole xy = [348, 226, 365, 240] - TkcRectangle.new(@canvas, xy, :fill=>@canvas.itemcget('I6c', :fill), + TkcRectangle.new(@canvas, xy, :fill=>@canvas.itemcget('I6c', :fill), :outline=>'') end return 1 @@ -857,24 +857,24 @@ def draw7 color = @C['7'] xy = [198, 306, 277, 374] # Box - TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>2, + TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :fill=>color, :tag=>'I7z') @canvas.lower('I7z') xy = [275, 343, 230, 349] - TkcLine.new(@canvas, xy, :tag=>'I7', :fill=>@C['fg'], :arrow=>:last, + TkcLine.new(@canvas, xy, :tag=>'I7', :fill=>@C['fg'], :arrow=>:last, :arrowshape=>[23, 23, 8], :width=>6) xy = [225, 324] # On button x, y = xy TkcOval.new(@canvas, box(x, y, 3), :fill=>@C['fg'], :outline=>@C['fg']) xy = [218, 323] # On text font = ['Times Roman', 8] - TkcText.new(@canvas, xy, :text=>'on', :anchor=>:e, + TkcText.new(@canvas, xy, :text=>'on', :anchor=>:e, :fill=>@C['fg'], :font=>font) xy = [225, 350] # Off button x, y = xy TkcOval.new(@canvas, box(x, y, 3), :fill=>@C['fg'], :outline=>@C['fg']) xy = [218, 349] # Off text - TkcText.new(@canvas, xy, :text=>'off', :anchor=>:e, + TkcText.new(@canvas, xy, :text=>'off', :anchor=>:e, :fill=>@C['fg'], :font=>font) end @@ -919,7 +919,7 @@ xy = [280, 209, 296, 248] TkcOval.new(@canvas, xy, :outline=>color, :fill=>color) xy = [ - 288, 249, 252, 249, 260, 240, 280, 234, + 288, 249, 252, 249, 260, 240, 280, 234, 296, 234, 316, 240, 324, 249, 288, 249 ] TkcPolygon.new(@canvas, xy, :fill=>color, :smooth=>true) @@ -928,16 +928,16 @@ TkcPolygon.new(@canvas, xy, :fill=>color) xy = [255, 206, 265, 234] # Fan blades - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>3, :tag=>'I9_0') xy = [255, 176, 265, 204] - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>3, :tag=>'I9_0') xy = [255, 206, 265, 220] - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>1, :tag=>'I9_1') xy = [255, 190, 265, 204] - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>1, :tag=>'I9_1') end @@ -962,17 +962,17 @@ color = @C['10a'] color2 = @C['10b'] xy = [191, 230, 233, 230, 233, 178, 191, 178] # Sail - TkcPolygon.new(@canvas, xy, :fill=>color, :width=>3, :outline=>@C['fg'], + TkcPolygon.new(@canvas, xy, :fill=>color, :width=>3, :outline=>@C['fg'], :tag=>'I10') xy = box(209, 204, 31) # Front - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :style=>:pie, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :style=>:pie, :start=>120, :extent=>120, :tag=>'I10') - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>120, :extent=>120, :tag=>'I10') xy = box(249, 204, 31) # Back - TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>3, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>3, :style=>:pie, :start=>120, :extent=>120, :tag=>'I10') - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>120, :extent=>120, :tag=>'I10') xy = [200, 171, 200, 249] # Mast @@ -992,10 +992,10 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3) xy = box(239, 262, 17) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>95, :extent=>103) xy = box(76, 266, 21) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :extent=>190) end @@ -1003,9 +1003,9 @@ step = get_step(10, step) pos = [ - [195, 212], [193, 212], [190, 212], [186, 212], [181, 212], [176, 212], - [171, 212], [166, 212], [161, 212], [156, 212], [151, 212], [147, 212], - [142, 212], [137, 212], [132, 212, :x], [127, 212], [121, 212], + [195, 212], [193, 212], [190, 212], [186, 212], [181, 212], [176, 212], + [171, 212], [166, 212], [161, 212], [156, 212], [151, 212], [147, 212], + [142, 212], [137, 212], [132, 212, :x], [127, 212], [121, 212], [116, 212], [111, 212] ] @@ -1032,21 +1032,21 @@ xy = [55, 504, 55, 591] # Bottom right side TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3) xy = box(71, 460, 48) # Outer loop - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>110, :extent=>-290, :tag=>'I11i') xy = box(71, 460, 16) # Inner loop - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>'', + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>'', :width=>3, :tag=>'I11i') TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>@C['bg'], :width=>3) xy = [23, 264, 23, 591] # Left side TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3) xy = box(1, 266, 23) # Top left curve - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :extent=>90) xy = box(75, 235, 9) # The ball - TkcOval.new(@canvas, xy, :fill=>color2, :outline=>'', + TkcOval.new(@canvas, xy, :fill=>color2, :outline=>'', :width=>3, :tag=>'I11') end @@ -1054,8 +1054,8 @@ step = get_step(11, step) pos = [ - [75, 235], [70, 235], [65, 237], [56, 240], [46, 247], [38, 266], - [38, 296], [38, 333], [38, 399], [38, 475], [74, 496], [105, 472], + [75, 235], [70, 235], [65, 237], [56, 240], [46, 247], [38, 266], + [38, 296], [38, 333], [38, 399], [38, 475], [74, 496], [105, 472], [100, 437], [65, 423], [-100, -100], [38, 505], [38, 527, :x], [38, 591] ] @@ -1069,11 +1069,11 @@ # Hand def draw12 xy = [ - 20, 637, 20, 617, 20, 610, 20, 590, 40, 590, 40, 590, + 20, 637, 20, 617, 20, 610, 20, 590, 40, 590, 40, 590, 60, 590, 60, 610, 60, 610 ] xy.concat([60, 610, 65, 620, 60, 631]) # Thumb - xy.concat([60, 631, 60, 637, 60, 662, 60, 669, 52, 669, + xy.concat([60, 631, 60, 637, 60, 662, 60, 669, 52, 669, 56, 669, 50, 669, 50, 662, 50, 637]) y0 = 637 # Bumps for fingers @@ -1083,7 +1083,7 @@ x2 = x - 10 xy << x << y0 << x1 << y1 << x2 << y0 } - TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'], + TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'], :smooth=>true, :tag=>'I12', :width=>3) end @@ -1107,25 +1107,25 @@ ] radii = [2, 9, 9, 8, 5, 5, 2] - round_poly(@canvas, xy, radii, :width=>3, + round_poly(@canvas, xy, radii, :width=>3, :outline=>@C['fg'], :fill=>color) - round_poly(@canvas, xy2, radii, :width=>3, + round_poly(@canvas, xy2, radii, :width=>3, :outline=>@C['fg'], :fill=>color) xy = [56, 677] x, y = xy - TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'], + TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'], :width=>3, :tag=>'I13') xy = [809, 677] x, y = xy - TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'], + TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'], :width=>3, :tag=>'I13R') xy = [112, 687] # Label - TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'], + TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'], :font=>['Times Roman', 12, :bold]) xy = [762, 687] - TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'], + TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'], :font=>['Times Roman', 12, :bold]) xy = [138, 663, 148, 636, 178, 636] # Paper guide @@ -1133,7 +1133,7 @@ xy = [732, 663, 722, 636, 692, 636] TkcLine.new(@canvas, xy, :smooth=>true, :fill=>@C['fg'], :width=>3) - sine([149, 688, 720, 688], 5, 15, + sine([149, 688, 720, 688], 5, 15, :tag=>'I13_s', :fill=>@C['fg'], :width=>3) end @@ -1163,17 +1163,17 @@ def draw14 color = @C['14'] xy = [102, 661, 113, 632, 130, 618] # Left paper edge - TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, + TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, :width=>3, :tag=>'I14L_0') xy = [148, 629, 125, 640, 124, 662] # Right paper edge - TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, + TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, :width=>3, :tag=>'I14L_1') draw14a('L') xy = [ 768.0, 662.5, 767.991316225, 662.433786215, 767.926187912, 662.396880171 ] - TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, + TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, :width=>3, :tag=>'I14R_0') @canvas.lower('I14R_0') # NB. these numbers are VERY sensitive, you must start with final size @@ -1181,7 +1181,7 @@ xy = [ 745.947897349, 662.428358855, 745.997829056, 662.452239237, 746.0, 662.5 ] - TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, + TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, :width=>3, :tag=>'I14R_1') @canvas.lower('I14R_1') end @@ -1194,11 +1194,11 @@ x3, y3, x4, y4, x5, y5 = xy2 zz = [ - x0, y0, x0, y0, xy, x2, y2, x2, y2, + x0, y0, x0, y0, xy, x2, y2, x2, y2, x3, y3, x3, y3, xy2, x5, y5, x5, y5 ].flatten @canvas.delete("I14#{side}") - TkcPolygon.new(@canvas, zz, :tag=>"I14#{side}", :smooth=>true, + TkcPolygon.new(@canvas, zz, :tag=>"I14#{side}", :smooth=>true, :fill=>color, :outline=>color, :width=>3) @canvas.lower("I14#{side}") end @@ -1251,7 +1251,7 @@ xy = [765, 557, 784, 583] TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2) - sine([658, 580, 765, 580], 3, 15, + sine([658, 580, 765, 580], 3, 15, :tag=>'I15_s', :fill=>@C['fg'], :width=>3) end @@ -1290,7 +1290,7 @@ xy = [722, 485, 791, 556] TkcRectangle.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>3) xy = box(752, 515, 25) # Bell - TkcOval.new(@canvas, xy, :fill=>color, :outline=>'black', + TkcOval.new(@canvas, xy, :fill=>color, :outline=>'black', :tag=>'I16b', :width=>2) xy = box(752, 515, 5) # Bell button TkcOval.new(@canvas, xy, :fill=>'black', :outline=>'black', :tag=>'I16b') @@ -1329,24 +1329,24 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3) xy = [664, 523, 717, 549] # Body - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3, :style=>:chord, :start=>128, :extent=>260, :tag=>'I17') xy = [709, 554, 690, 543] # Paw - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3, :tag=>'I17') xy = [657, 544, 676, 555] - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3, :tag=>'I17') xy = box(660, 535, 15) # Lower face - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>150, :extent=>240, :tag=>'I17_') - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, :style=>:chord, :start=>150, :extent=>240, :tag=>'I17_') xy = [674, 529, 670, 513, 662, 521, 658, 521, 650, 513, 647, 529] # Ears TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') - TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', :width=>1, + TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', :width=>1, :tag=>['I17_', 'I17_c']) xy = [652, 542, 628, 539] # Whiskers TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') @@ -1356,23 +1356,23 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') xy = [668, 543, 687, 538] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>['I17_', 'I17_w']) xy = [668, 544, 688, 546] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>['I17_', 'I17_w']) xy = [668, 547, 688, 553] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>['I17_', 'I17_w']) xy = [649, 530, 654, 538, 659, 530] # Left eye - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :smooth=>true, :tag=>'I17') xy = [671, 530, 666, 538, 661, 530] # Right eye - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :smooth=>true, :tag=>'I17') xy = [655, 543, 660, 551, 665, 543] # Mouth - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :smooth=>true, :tag=>'I17') end @@ -1385,10 +1385,10 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :smooth=>true, :tag=>'I17_') xy = box(654, 530, 4) # Left eye - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'', + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'', :tag=>'I17_') xy = box(666, 530, 4) # Right eye - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'', + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'', :tag=>'I17_') @canvas.move('I17_', 0, -20) # Move face up @@ -1398,19 +1398,19 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') xy = [ # Body - 675, 506, 694, 489, 715, 513, 715, 513, 715, 513, 716, 525, - 716, 525, 716, 525, 706, 530, 695, 530, 679, 535, 668, 527, + 675, 506, 694, 489, 715, 513, 715, 513, 715, 513, 716, 525, + 716, 525, 716, 525, 706, 530, 695, 530, 679, 535, 668, 527, 668, 527, 668, 527, 675, 522, 676, 517, 677, 512 ] - TkcPolygon.new(@canvas, xy, :fill=>@canvas.itemcget('I17_c', :fill), - :outline=>@C['fg'], :width=>3, :smooth=>true, + TkcPolygon.new(@canvas, xy, :fill=>@canvas.itemcget('I17_c', :fill), + :outline=>@C['fg'], :width=>3, :smooth=>true, :tag=>'I17_') xy = [716, 514, 716, 554] # Back leg TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') xy = [694, 532, 694, 554] # 2nd back leg TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') xy = [715, 514, 718, 506, 719, 495, 716, 488] # Tail - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :smooth=>true, :tag=>'I17_') @canvas.raise('I17w') # Make whiskers visible @@ -1439,14 +1439,14 @@ step = get_step(18, step) pos = [ - [587, 506], [537, 506], [466, 506], [376, 506], [266, 506, :x], + [587, 506], [537, 506], [466, 506], [376, 506], [266, 506, :x], [136, 506], [16, 506], [-100, -100] ] b = [] b[0] = [490, 502, 719, 507, 524, 512] # Band collapsing b[1] = [ - 491, 503, 524, 557, 563, 505, 559, 496, 546, 506, 551, 525, + 491, 503, 524, 557, 563, 505, 559, 496, 546, 506, 551, 525, 553, 536, 538, 534, 532, 519, 529, 499 ] b[2] = [ @@ -1477,54 +1477,54 @@ color = @C['19'] xx = [[249, 181], [155, 118], [86, 55], [22, 0]] xx.each{|x1, x2| - TkcRectangle.new(@canvas, x1, 453, x2, 467, + TkcRectangle.new(@canvas, x1, 453, x2, 467, :fill=>color, :outline=>'', :tag=>'I19') - TkcLine.new(@canvas, x1, 453, x2, 453, + TkcLine.new(@canvas, x1, 453, x2, 453, :fill=>@C['fg'], :width=>1) # Pipe top - TkcLine.new(@canvas, x1, 467, x2, 467, + TkcLine.new(@canvas, x1, 467, x2, 467, :fill=>@C['fg'], :width=>1) # Pipe bottom } @canvas.raise('I11i') xy = box(168, 460, 16) # Bulge by the joint TkcOval.new(@canvas, xy, :fill=>color, :outline=>'') - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>21, :extent=>136) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>-21, :extent=>-130) xy = [249, 447, 255, 473] # First joint 26x6 TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1) xy = box(257, 433, 34) # Bend up - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, :style=>:pie, :start=>0, :extent=>-91) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>0, :extent=>-90) xy = box(257, 433, 20) - TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, :style=>:pie, :start=>0, :extent=>-92) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>0, :extent=>-90) xy = box(257, 421, 34) # Bend left - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, :style=>:pie, :start=>0, :extent=>91) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>0, :extent=>90) xy = box(257, 421, 20) - TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, :style=>:pie, :start=>0, :extent=>90) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>0, :extent=>90) xy = box(243, 421, 34) # Bend down - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, :style=>:pie, :start=>90, :extent=>90) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>90, :extent=>90) xy = box(243, 421, 20) - TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, :style=>:pie, :start=>90, :extent=>90) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>90, :extent=>90) xy = [270, 427, 296, 433] # 2nd joint bottom @@ -1566,7 +1566,7 @@ pos = [451, 462, 473, 484, 496, 504, 513, 523, 532] freq = [20, 40, 40, 40, 40, 40, 40, 40, 40] pos = [ - [451, 20], [462, 40], [473, 40], [484, 40], [496, 40], + [451, 20], [462, 40], [473, 40], [484, 40], [496, 40], [504, 40], [513, 40], [523, 40], [532, 40, :x] ] return 0 if step >= pos.length @@ -1583,11 +1583,11 @@ color = @C['20'] @canvas.delete('I20') - sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'], + sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'], :width=>3, :fill=>color, :smooth=>true) - TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3, + TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3, :fill=>color, :smooth=>1, :tag=>['I20', 'I20a']) - TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3, + TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3, :fill=>color, :smooth=>1, :tag=>['I20', 'I20b']) @canvas.move('I20a', 8, 0) @canvas.move('I20b', 16, 0) @@ -1603,18 +1603,18 @@ xy = [245, 490, 237, 535] # Right side xy2 = [189, 535, 181, 490] # Left side - TkcPolygon.new(@canvas, xy + xy2, :fill=>color, :outline=>'', + TkcPolygon.new(@canvas, xy + xy2, :fill=>color, :outline=>'', :tag=>['I21', 'I21f']) TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :tag=>'I21') TkcLine.new(@canvas, xy2, :fill=>@C['fg'], :width=>2, :tag=>'I21') xy = [182, 486, 244, 498] # Top - TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2, + TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2, :tag=>['I21', 'I21f']) - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>2, + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>2, :tag=>['I21', 'I21t']) xy = [189, 532, 237, 540] # Bottom - TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2, + TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2, :tag=>['I21', 'I21b']) end @@ -1637,7 +1637,7 @@ @canvas.itemconfigure('I21b', :fill=>@C['20']) @canvas.delete('I21w') - TkcPolygon.new(@canvas, x2, y2, x1, y1, xx1, yy1, xx2, yy1, + TkcPolygon.new(@canvas, x2, y2, x1, y1, xx1, yy1, xx2, yy1, :tag=>['I21', 'I21w'], :outline=>'', :fill=>@C['20']) @canvas.lower('I21w', 'I21') @canvas.raise('I21b') @@ -1673,21 +1673,21 @@ color3 = @C['23c'] xy = [185, 623, 253, 650] # Block - TkcRectangle.new(@canvas, xy, :fill=>'black', :outline=>@C['fg'], + TkcRectangle.new(@canvas, xy, :fill=>'black', :outline=>@C['fg'], :width=>2, :tag=>'I23a') xy = [187, 592, 241, 623] # Balloon TkcOval.new(@canvas, xy, :outline=>'', :fill=>color, :tag=>'I23b') - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :tag=>'I23b', + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :tag=>'I23b', :style=>:arc, :start=>12, :extent=>336) xy = [239, 604, 258, 589, 258, 625, 239, 610] # Balloon nozzle TkcPolygon.new(@canvas, xy, :outline=>'', :fill=>color, :tag=>'I23b') TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23b') xy = [285, 611, 250, 603] # Dart body - TkcOval.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'], :width=>3, :tag=>'I23d') xy = [249, 596, 249, 618, 264, 607, 249, 596] # Dart tail - TkcPolygon.new(@canvas, xy, :fill=>color3, :outline=>@C['fg'], + TkcPolygon.new(@canvas, xy, :fill=>color3, :outline=>@C['fg'], :width=>3, :tag=>'I23d') xy = [249, 607, 268, 607] # Dart detail TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23d') @@ -1699,7 +1699,7 @@ step = get_step(23, step) pos = [ - [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607], + [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607], [487, 607], [587, 607], [687, 607], [787, 607], [-100, -100] ] @@ -1719,7 +1719,7 @@ def draw24 color = @C['24a'] xy = [366, 518, 462, 665] # Balloon - TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3, :tag=>'I24') xy = [414, 666, 414, 729] # String TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I24') @@ -1728,16 +1728,16 @@ :width=>3, :tag=>'I24') xy = [387, 567, 390, 549, 404, 542] # Reflections - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, :width=>2, :tag=>'I24') xy = [395, 568, 399, 554, 413, 547] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, :width=>2, :tag=>'I24') xy = [403, 570, 396, 555, 381, 553] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, :width=>2, :tag=>'I24') xy = [408, 564, 402, 547, 386, 545] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, :width=>2, :tag=>'I24') end @@ -1750,16 +1750,16 @@ if step == 0 @canvas.delete('I24') # Exploding balloon xy = [ - 347, 465, 361, 557, 271, 503, 272, 503, 342, 574, 259, 594, - 259, 593, 362, 626, 320, 737, 320, 740, 398, 691, 436, 738, - 436, 739, 476, 679, 528, 701, 527, 702, 494, 627, 548, 613, - 548, 613, 480, 574, 577, 473, 577, 473, 474, 538, 445, 508, + 347, 465, 361, 557, 271, 503, 272, 503, 342, 574, 259, 594, + 259, 593, 362, 626, 320, 737, 320, 740, 398, 691, 436, 738, + 436, 739, 476, 679, 528, 701, 527, 702, 494, 627, 548, 613, + 548, 613, 480, 574, 577, 473, 577, 473, 474, 538, 445, 508, 431, 441, 431, 440, 400, 502, 347, 465, 347, 465 ] - TkcPolygon.new(@canvas, xy, :tag=>'I24', :fill=>@C['24b'], + TkcPolygon.new(@canvas, xy, :tag=>'I24', :fill=>@C['24b'], :outline=>@C['24a'], :width=>10, :smooth=>true) msg = Tk.subst(@S['message'].value) - TkcText.new(@canvas, centroid('I24'), :text=>msg, :tag=>['I24', 'I24t'], + TkcText.new(@canvas, centroid('I24'), :text=>msg, :tag=>['I24', 'I24t'], :justify=>:center, :font=>['Times Roman', 18, :bold]) return 1 end @@ -1790,9 +1790,9 @@ if step >= 3 @canvas.delete('I24', 'I26') - TkcText.new(@canvas, 430, 735, :anchor=>:s, :tag=>'I26', - #:text=>'click to continue', - :text=>'¥¯¥ê¥Ã¥¯¤Ç¥ê¥»¥Ã¥È¤·¤Þ¤¹', + TkcText.new(@canvas, 430, 735, :anchor=>:s, :tag=>'I26', + #:text=>'click to continue', + :text=>'¥¯¥ê¥Ã¥¯¤Ç¥ê¥»¥Ã¥È¤·¤Þ¤¹', :font=>['Times Roman', 20, :bold]) @canvas.bind('1', proc{reset}) return 4 @@ -1972,11 +1972,11 @@ def sparkle(oxy, tag) xy = [ - [299, 283], [298, 302], [295, 314], [271, 331], + [299, 283], [298, 302], [295, 314], [271, 331], [239, 310], [242, 292], [256, 274], [281, 273] ] xy.each{|x, y| - TkcLine.new(@canvas, 271, 304, x, y, + TkcLine.new(@canvas, 271, 304, x, y, :fill=>'white', :width=>3, :tag=>tag) } move_abs(tag, oxy) Index: ext/tk/sample/demos-jp/filebox.rb =================================================================== --- ext/tk/sample/demos-jp/filebox.rb (revision 23917) +++ ext/tk/sample/demos-jp/filebox.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($filebox_demo) && $entry2_demo - $filebox_demo.destroy + $filebox_demo.destroy $filebox_demo = nil end @@ -49,7 +49,7 @@ TkEntry.new(f, 'width'=>20) {|e| pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x') - TkButton.new(f, 'text'=>'Browse ...', + TkButton.new(f, 'text'=>'Browse ...', 'command'=>proc{fileDialog base_frame,e,type})\ .pack('side'=>'left') } @@ -60,9 +60,9 @@ $tk_strictMotif = TkVarAccess.new('tk_strictMotif') if ($tk_platform['platform'] == 'unix') - TkCheckButton.new(base_frame, - 'text'=>'Motif¥¹¥¿¥¤¥ë¤Î¥À¥¤¥¢¥í¥°¤òÍѤ¤¤ë', - 'variable'=>$tk_strictMotif, + TkCheckButton.new(base_frame, + 'text'=>'Motif¥¹¥¿¥¤¥ë¤Î¥À¥¤¥¢¥í¥°¤òÍѤ¤¤ë', + 'variable'=>$tk_strictMotif, 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c') end @@ -71,23 +71,23 @@ # #-------------------------------------------------------- types = [ - ['Text files', ['.txt','.doc'] ], - ['Text files', [], 'TEXT' ], - ['Ruby Scripts', ['.rb'], 'TEXT' ], - ['Tcl Scripts', ['.tcl'], 'TEXT' ], - ['C Source Files', ['.c','.h'] ], - ['All Source Files', ['.rb','.tcl','.c','.h'] ], - ['Image Files', ['.gif'] ], - ['Image Files', ['.jpeg','.jpg'] ], - ['Image Files', [], ['GIFF','JPEG']], + ['Text files', ['.txt','.doc'] ], + ['Text files', [], 'TEXT' ], + ['Ruby Scripts', ['.rb'], 'TEXT' ], + ['Tcl Scripts', ['.tcl'], 'TEXT' ], + ['C Source Files', ['.c','.h'] ], + ['All Source Files', ['.rb','.tcl','.c','.h'] ], + ['Image Files', ['.gif'] ], + ['Image Files', ['.jpeg','.jpg'] ], + ['Image Files', [], ['GIFF','JPEG']], ['All files', '*' ] ] if operation == '³«¤¯' file = Tk.getOpenFile('filetypes'=>types, 'parent'=>w) else - file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w, - 'initialfile'=>'Untitled', + file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w, + 'initialfile'=>'Untitled', 'defaultextension'=>'.txt') end if file != "" Index: ext/tk/sample/demos-jp/pendulum.rb =================================================================== --- ext/tk/sample/demos-jp/pendulum.rb (revision 23917) +++ ext/tk/sample/demos-jp/pendulum.rb (working copy) @@ -8,7 +8,7 @@ # destroy toplevel widget for this demo script if defined?($pendulum_demo) && $pendulum_demo - $pendulum_demo.destroy + $pendulum_demo.destroy $pendulum_demo = nil end @@ -61,14 +61,14 @@ # Create the canvas containing the graphical representation of the # simulated system. - @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white', + @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white', :borderwidth=>2, :relief=>:sunken) - TkcText.new(@c, 5, 5, :anchor=>:nw, + TkcText.new(@c, 5, 5, :anchor=>:nw, :text=>'Click to Adjust Bob Start Position') # Coordinates of these items don't matter; they will be set properly below @plate = TkcLine.new(@c, 0, 25, 320, 25, :width=>2, :fill=>'grey50') @rod = TkcLine.new(@c, 1, 1, 1, 1, :width=>3, :fill=>'black') - @bob = TkcOval.new(@c, 1, 1, 2, 2, + @bob = TkcOval.new(@c, 1, 1, 2, 2, :width=>3, :fill=>'yellow', :outline=>'black') TkcOval.new(@c, 155, 20, 165, 30, :fill=>'grey50', :outline=>'') @@ -78,22 +78,22 @@ # Create the canvas containing the phase space graph; this consists of # a line that gets gradually paler as it ages, which is an extremely # effective visual trick. - @k = TkCanvas.new(@lf2, :width=>320, :height=>200, :background=>'white', + @k = TkCanvas.new(@lf2, :width=>320, :height=>200, :background=>'white', :borderwidth=>2, :relief=>:sunken) @y_axis = TkcLine.new(@k, 160, 200, 160, 0, :fill=>'grey75', :arrow=>:last) @x_axis = TkcLine.new(@k, 0, 100, 320, 100, :fill=>'grey75', :arrow=>:last) @graph = {} 90.step(0, -10){|i| - # Coordinates of these items don't matter; + # Coordinates of these items don't matter; # they will be set properly below @graph[i] = TkcLine.new(@k, 0, 0, 1, 1, :smooth=>true, :fill=>"grey#{i}") } # labels - @label_theta = TkcText.new(@k, 0, 0, :anchor=>:ne, + @label_theta = TkcText.new(@k, 0, 0, :anchor=>:ne, :text=>'q', :font=>'Symbol 8') - @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne, + @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne, :text=>'dq', :font=>'Symbol 8') # pack @@ -111,19 +111,19 @@ # binding @c.bindtags_unshift(btag = TkBindTag.new) btag.bind('Destroy'){ @timer.stop } - btag.bind('1', proc{|x, y| @timer.stop; showPendulum(x.to_i, y.to_i)}, + btag.bind('1', proc{|x, y| @timer.stop; showPendulum(x.to_i, y.to_i)}, '%x %y') btag.bind('B1-Motion', proc{|x, y| showPendulum(x.to_i, y.to_i)}, '%x %y') - btag.bind('ButtonRelease-1', - proc{|x, y| showPendulum(x.to_i, y.to_i); @timer.start }, + btag.bind('ButtonRelease-1', + proc{|x, y| showPendulum(x.to_i, y.to_i); @timer.start }, '%x %y') btag.bind('Configure', proc{|w| @plate.coords(0, 25, w.to_i, 25)}, '%w') - @k.bind('Configure', proc{|h, w| + @k.bind('Configure', proc{|h, w| h = h.to_i w = w.to_i - @psh = h/2; + @psh = h/2; @psw = w/2 @x_axis.coords(2, @psh, w-2, @psh) @y_axis.coords(@psw, h-2, @psw, 2) @@ -144,9 +144,9 @@ end # This procedure makes the pendulum appear at the correct place on the - # canvas. If the additional arguments x, y are passed instead of computing - # the position of the pendulum from the length of the pendulum rod and its - # angle, the length and angle are computed in reverse from the given + # canvas. If the additional arguments x, y are passed instead of computing + # the position of the pendulum from the length of the pendulum rod and its + # angle, the length and angle are computed in reverse from the given # location (which is taken to be the centre of the pendulum bob.) def showPendulum(x=nil, y=nil) if x && y && (x != 160 || y != 25) Index: ext/tk/sample/demos-jp/puzzle.rb =================================================================== --- ext/tk/sample/demos-jp/puzzle.rb (revision 23917) +++ ext/tk/sample/demos-jp/puzzle.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($puzzle_demo) && $puzzle_demo - $puzzle_demo.destroy + $puzzle_demo.destroy $puzzle_demo = nil end @@ -49,7 +49,7 @@ # frame À¸À® # # Special trick: scrollbar widget ¤òÀ¸À®¤·¤Æ¤½¤Î trough color ¤òÍѤ¤¤ë¤³¤È¤Ç -# ¶õÇòÉôʬ¤Î¤¿¤á¤Î°Å¿§¤òÁªÂò¤·¡¤ÀßÄꤹ¤ë +# ¶õÇòÉôʬ¤Î¤¿¤á¤Î°Å¿§¤òÁªÂò¤·¡¤ÀßÄꤹ¤ë # begin if Tk.windowingsystem() == 'aqua' @@ -69,7 +69,7 @@ # depend_on_button_width = true depend_on_button_width = false - + s = TkScrollbar.new(base_frame) base = TkFrame.new(base_frame) { width frameWidth @@ -103,7 +103,7 @@ if depend_on_button_width && (w.winfo_reqwidth * 4 > base.width) base.width = w.winfo_reqwidth * 4 end - }.place('relx'=>$xpos[num], 'rely'=>$ypos[num], + }.place('relx'=>$xpos[num], 'rely'=>$ypos[num], 'relwidth'=>0.25, 'relheight'=>0.25) } $xpos['space'] = 0.75 Index: ext/tk/sample/demos-jp/aniwave.rb =================================================================== --- ext/tk/sample/demos-jp/aniwave.rb (revision 23917) +++ ext/tk/sample/demos-jp/aniwave.rb (working copy) @@ -6,7 +6,7 @@ # destroy toplevel widget for this demo script if defined?($aniwave_demo) && $aniwave_demo - $aniwave_demo.destroy + $aniwave_demo.destroy $aniwave_demo = nil end @@ -53,11 +53,11 @@ @direction = dir # create canvas widget - @c = TkCanvas.new(frame, :width=>300, :height=>200, + @c = TkCanvas.new(frame, :width=>300, :height=>200, :background=>'black') @c.pack(:padx=>10, :pady=>10, :expand=>true) - # Creates a coordinates list of a wave. + # Creates a coordinates list of a wave. @waveCoords = [] @backupCoords = [] n = 0 @@ -69,10 +69,10 @@ # Create a smoothed line and arrange for its coordinates to be the # contents of the variable waveCoords. - @line = TkcLine.new(@c, @waveCoords, + @line = TkcLine.new(@c, @waveCoords, :width=>1, :fill=>'green', :smooth=>true) - # Main animation "loop". + # Main animation "loop". # Theoretically 100 frames-per-second (==10ms between frames) @timer = TkTimer.new(10){ basicMotion; reverser } Index: ext/tk/sample/demos-jp/radio.rb =================================================================== --- ext/tk/sample/demos-jp/radio.rb (revision 23917) +++ ext/tk/sample/demos-jp/radio.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($radio_demo) && $radio_demo - $radio_demo.destroy + $radio_demo.destroy $radio_demo = nil end Index: ext/tk/sample/demos-jp/msgbox.rb =================================================================== --- ext/tk/sample/demos-jp/msgbox.rb (revision 23917) +++ ext/tk/sample/demos-jp/msgbox.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($msgbox_demo) && $msgbox_demo - $msgbox_demo.destroy + $msgbox_demo.destroy $msgbox_demo = nil end @@ -48,9 +48,9 @@ # frame À¸À® $msgbox_leftframe = TkFrame.new(base_frame) $msgbox_rightframe = TkFrame.new(base_frame) -$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', +$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') -$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', +$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') TkLabel.new($msgbox_leftframe, 'text'=>'¥¢¥¤¥³¥ó').pack('side'=>'top') @@ -59,9 +59,9 @@ $msgboxIcon = TkVariable.new('info') ['error', 'info', 'question', 'warning'].each {|icon| - TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, - 'relief'=>'flat', 'value'=>icon, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, + 'relief'=>'flat', 'value'=>icon, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') } @@ -70,20 +70,20 @@ .pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') $msgboxType = TkVariable.new('ok') -['abortretryignore', 'ok', 'okcancel', +['abortretryignore', 'ok', 'okcancel', 'retrycancel', 'yesno', 'yesnocancel'].each {|type| - TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, - 'relief'=>'flat', 'value'=>type, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, + 'relief'=>'flat', 'value'=>type, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') } def showMessageBox(w) - button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, + button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, 'title'=>'Message', 'parent'=>w, 'message'=>"¤³¤ì¤Ï\"#{$msgboxType.value}\"¤È¤¤¤¦¼ïÎà¤Î¥á¥Ã¥»¡¼¥¸¥Ü¥Ã¥¯¥¹¤Ç¡¢\"#{$msgboxIcon.value}\"¤Î¥¢¥¤¥³¥ó¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£") - Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, + Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, 'message'=>"¤¢¤Ê¤¿¤Ï \"#{button}\" ¤ò²¡¤·¤Þ¤·¤¿¤Í¡£") end Index: ext/tk/sample/demos-jp/combo.rb =================================================================== --- ext/tk/sample/demos-jp/combo.rb (revision 23917) +++ ext/tk/sample/demos-jp/combo.rb (working copy) @@ -7,7 +7,7 @@ # based on "Id: combo.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($combo_demo) && $combo_demo - $combo_demo.destroy + $combo_demo.destroy $combo_demo = nil end @@ -19,7 +19,7 @@ base_frame = TkFrame.new($combo_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left, :text=><:top, :fill=>:x) °Ê²¼¤Ç¤Ï3¼ïÎà¤Î¥³¥ó¥Ü¥Ü¥Ã¥¯¥¹¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥\ ºÇ½é¤Î¤â¤Î¤Ï¡¤¥¨¥ó¥È¥ê¥¦¥£¥¸¥§¥Ã¥È¤ÈƱ¤¸Íͤˡ¤\ @@ -42,24 +42,24 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'ÊÑ¿ô»²¾È', - :image=>$image['view'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'ÊÑ¿ô»²¾È', + :image=>$image['view'], :compound=>:left, :command=>proc{ - showVars(base_frame, - ['firstVariable', firstValue], - ['secondVariable', secondValue], + showVars(base_frame, + ['firstVariable', firstValue], + ['secondVariable', secondValue], ['ozCity', ozCity]) - }), - Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'combo'}), - Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + }), + Ttk::Button.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'combo'}), + Ttk::Button.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $combo_demo.destroy $combo_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -68,7 +68,7 @@ frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true) australianCities = [ - '¥­¥ã¥ó¥Ù¥é', '¥·¥É¥Ë¡¼', '¥á¥ë¥Ü¥ë¥ó', '¥Ñ¡¼¥¹', '¥¢¥Ç¥ì¡¼¥É', + '¥­¥ã¥ó¥Ù¥é', '¥·¥É¥Ë¡¼', '¥á¥ë¥Ü¥ë¥ó', '¥Ñ¡¼¥¹', '¥¢¥Ç¥ì¡¼¥É', '¥Ö¥ê¥¹¥Ù¡¼¥ó', '¥Û¥Ð¡¼¥È', '¥À¡¼¥¦¥£¥ó', '¥¢¥ê¥¹ ¥¹¥×¥ê¥ó¥°¥¹' ] @@ -82,17 +82,17 @@ w.values <<= w.value unless w.values.include?(w.value) } }.pack(:pady=>5, :padx=>10) - }, + }, Ttk::LabelFrame.new(frame, :text=>'Disabled'){|f| Ttk::Combobox.new(f, :textvariable=>secondValue, :state=>:disabled) . pack(:pady=>5, :padx=>10) - }, + }, Ttk::LabelFrame.new(frame, :text=>'Defined List Only'){|f| - Ttk::Combobox.new(f, :textvariable=>ozCity, :state=>:readonly, + Ttk::Combobox.new(f, :textvariable=>ozCity, :state=>:readonly, :values=>australianCities) . pack(:pady=>5, :padx=>10) - }, + }, :side=>:top, :pady=>5, :padx=>10) Index: ext/tk/sample/demos-jp/colors.rb =================================================================== --- ext/tk/sample/demos-jp/colors.rb (revision 23917) +++ ext/tk/sample/demos-jp/colors.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($colors_demo) && $colors_demo - $colors_demo.destroy + $colors_demo.destroy $colors_demo = nil end Index: ext/tk/sample/demos-jp/floor2.rb =================================================================== --- ext/tk/sample/demos-jp/floor2.rb (revision 23917) +++ ext/tk/sample/demos-jp/floor2.rb (working copy) @@ -18,7 +18,7 @@ w.delete('all') $activeFloor2 = active - # First go through the three floors, displaying the backgrounds for + # First go through the three floors, displaying the backgrounds for # each floor. floor2_bg1(w,$floor2_colors['bg1'],$floor2_colors['outline1']) @@ -29,12 +29,12 @@ w.raise("floor#{active}") - # Create a dummy item just to mark this point in the display list, + # Create a dummy item just to mark this point in the display list, # so we can insert highlights here. w.create(TkcRectangle,0,100,1,101,'fill'=>'','outline'=>'','tags'=>'marker') - # Add the walls and labels for the active floor, along with + # Add the walls and labels for the active floor, along with # transparent polygons that define the rooms on the floor. # Make sure that the room polygons are on top. @@ -299,7 +299,7 @@ w.create(TkcLine,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg']) w.create(TkcLine,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) w.create(TkcLine,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - w.create(TkcLine,107,300,159,300,159,248,107,248,107,300, + w.create(TkcLine,107,300,159,300,159,248,107,248,107,300, 'fill'=>outline, 'tags'=>['floor3','bg']) end @@ -313,316 +313,316 @@ # color - Color to use for drawing foreground information. def floor2_fg1(w,color) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '101' $floorItems2['101'] = i - w.create(TkcText,358,209, 'text'=>'101', 'fill'=>color, + w.create(TkcText,358,209, 'text'=>'101', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Pub Lift1' $floorItems2['Pub Lift1'] = i - w.create(TkcText,323,223, 'text'=>'Pub Lift1', 'fill'=>color, + w.create(TkcText,323,223, 'text'=>'Pub Lift1', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Priv Lift1' $floorItems2['Priv Lift1'] = i - w.create(TkcText,323,188, 'text'=>'Priv Lift1', 'fill'=>color, + w.create(TkcText,323,188, 'text'=>'Priv Lift1', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, + i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '110' $floorItems2['110'] = i - w.create(TkcText,21.5,363, 'text'=>'110', 'fill'=>color, + w.create(TkcText,21.5,363, 'text'=>'110', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, + i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '109' $floorItems2['109'] = i - w.create(TkcText,67,363, 'text'=>'109', 'fill'=>color, + w.create(TkcText,67,363, 'text'=>'109', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, + i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '111' $floorItems2['111'] = i - w.create(TkcText,28.5,276.5, 'text'=>'111', 'fill'=>color, + w.create(TkcText,28.5,276.5, 'text'=>'111', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, + i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '117B' $floorItems2['117B'] = i - w.create(TkcText,88.5,278.5, 'text'=>'117B', 'fill'=>color, + w.create(TkcText,88.5,278.5, 'text'=>'117B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, + i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '112' $floorItems2['112'] = i - w.create(TkcText,28.5,227.5, 'text'=>'112', 'fill'=>color, + w.create(TkcText,28.5,227.5, 'text'=>'112', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, + i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '113' $floorItems2['113'] = i - w.create(TkcText,28.5,179.5, 'text'=>'113', 'fill'=>color, + w.create(TkcText,28.5,179.5, 'text'=>'113', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, + i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '117A' $floorItems2['117A'] = i - w.create(TkcText,82,180.5, 'text'=>'117A', 'fill'=>color, + w.create(TkcText,82,180.5, 'text'=>'117A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, + i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '117' $floorItems2['117'] = i - w.create(TkcText,65,235, 'text'=>'117', 'fill'=>color, + w.create(TkcText,65,235, 'text'=>'117', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, + i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '114' $floorItems2['114'] = i - w.create(TkcText,28.5,135, 'text'=>'114', 'fill'=>color, + w.create(TkcText,28.5,135, 'text'=>'114', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, + i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '115' $floorItems2['115'] = i - w.create(TkcText,74,141.5, 'text'=>'115', 'fill'=>color, + w.create(TkcText,74,141.5, 'text'=>'115', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, + i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '116' $floorItems2['116'] = i - w.create(TkcText,48.5,70, 'text'=>'116', 'fill'=>color, + w.create(TkcText,48.5,70, 'text'=>'116', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, + i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '118' $floorItems2['118'] = i - w.create(TkcText,108.5,102, 'text'=>'118', 'fill'=>color, + w.create(TkcText,108.5,102, 'text'=>'118', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,178,128,178,132,216,132,216,91, - 163,91,163,112,149,112,149,128, + 163,91,163,112,149,112,149,128, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '120' $floorItems2['120'] = i - w.create(TkcText,189.5,111.5, 'text'=>'120', 'fill'=>color, + w.create(TkcText,189.5,111.5, 'text'=>'120', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192, - 156,192,156,169,175,169,175,246,79,246, + 156,192,156,169,175,169,175,246,79,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '122' $floorItems2['122'] = i - w.create(TkcText,131,207.5, 'text'=>'122', 'fill'=>color, + w.create(TkcText,131,207.5, 'text'=>'122', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, + i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '121' $floorItems2['121'] = i - w.create(TkcText,146,180, 'text'=>'121', 'fill'=>color, + w.create(TkcText,146,180, 'text'=>'121', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, + i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '106A' $floorItems2['106A'] = i - w.create(TkcText,112.5,304.5, 'text'=>'106A', 'fill'=>color, + w.create(TkcText,112.5,304.5, 'text'=>'106A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, + i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '105' $floorItems2['105'] = i - w.create(TkcText,124.5,278.5, 'text'=>'105', 'fill'=>color, + w.create(TkcText,124.5,278.5, 'text'=>'105', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, + i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '106B' $floorItems2['106B'] = i - w.create(TkcText,163,304.5, 'text'=>'106B', 'fill'=>color, + w.create(TkcText,163,304.5, 'text'=>'106B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, + i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '104' $floorItems2['104'] = i - w.create(TkcText,184,278.5, 'text'=>'104', 'fill'=>color, + w.create(TkcText,184,278.5, 'text'=>'104', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, + i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '108' $floorItems2['108'] = i - w.create(TkcText,114.5,361, 'text'=>'108', 'fill'=>color, + w.create(TkcText,114.5,361, 'text'=>'108', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, + i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '107' $floorItems2['107'] = i - w.create(TkcText,198,361, 'text'=>'107', 'fill'=>color, + w.create(TkcText,198,361, 'text'=>'107', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, + i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Smoking' $floorItems2['Smoking'] = i - w.create(TkcText,280,341, 'text'=>'Smoking', 'fill'=>color, + w.create(TkcText,280,341, 'text'=>'Smoking', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, + i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '123' $floorItems2['123'] = i - w.create(TkcText,245.5,190.5, 'text'=>'123', 'fill'=>color, + w.create(TkcText,245.5,190.5, 'text'=>'123', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, + i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '103' $floorItems2['103'] = i - w.create(TkcText,259,287, 'text'=>'103', 'fill'=>color, + w.create(TkcText,259,287, 'text'=>'103', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, + i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '124' $floorItems2['124'] = i - w.create(TkcText,356,150, 'text'=>'124', 'fill'=>color, + w.create(TkcText,356,150, 'text'=>'124', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, + i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '125' $floorItems2['125'] = i - w.create(TkcText,392,217.5, 'text'=>'125', 'fill'=>color, + w.create(TkcText,392,217.5, 'text'=>'125', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, + i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '126' $floorItems2['126'] = i - w.create(TkcText,436.5,185.5, 'text'=>'126', 'fill'=>color, + w.create(TkcText,436.5,185.5, 'text'=>'126', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,409,209,409,229,399,229,399,253, - 486,253,486,239,474,239,474,209, + 486,253,486,239,474,239,474,209, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '127' $floorItems2['127'] = i - w.create(TkcText,436.5,'231', 'text'=>'127', 'fill'=>color, + w.create(TkcText,436.5,'231', 'text'=>'127', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,501,164,501,174,495,174,495,188, - 490,188,490,204,476,204,476,164, + 490,188,490,204,476,204,476,164, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'MShower' $floorItems2['MShower'] = i - w.create(TkcText,488.5,'184', 'text'=>'MShower', 'fill'=>color, + w.create(TkcText,488.5,'184', 'text'=>'MShower', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, + i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Closet' $floorItems2['Closet'] = i - w.create(TkcText,502.5,190, 'text'=>'Closet', 'fill'=>color, + w.create(TkcText,502.5,190, 'text'=>'Closet', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, + i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'WShower' $floorItems2['WShower'] = i - w.create(TkcText,494.5,230, 'text'=>'WShower', 'fill'=>color, + w.create(TkcText,494.5,230, 'text'=>'WShower', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166, 697,166,697,275,553,275,531,254,515,254, - 515,174,503,174,503,161,486,161, + 515,174,503,174,503,161,486,161, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '130' $floorItems2['130'] = i - w.create(TkcText,638.5,205, 'text'=>'130', 'fill'=>color, + w.create(TkcText,638.5,205, 'text'=>'130', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,308,242,339,242,339,248,342,248, 342,246,397,246,397,276,393,276, - 393,309,300,309,300,248,308,248, + 393,309,300,309,300,248,308,248, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '102' $floorItems2['102'] = i - w.create(TkcText,367.5,278.5, 'text'=>'102', 'fill'=>color, + w.create(TkcText,367.5,278.5, 'text'=>'102', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, + i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '128' $floorItems2['128'] = i - w.create(TkcText,441.5,265.5, 'text'=>'128', 'fill'=>color, + w.create(TkcText,441.5,265.5, 'text'=>'128', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,510,309,486,309,486,255,530,255, 552,277,561,277,561,325,510,325, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '129' $floorItems2['129'] = i - w.create(TkcText,535.5,293, 'text'=>'129', 'fill'=>color, + w.create(TkcText,535.5,293, 'text'=>'129', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,696,281,740,281,740,387,642,387, - 642,389,561,389,561,277,696,277, + 642,389,561,389,561,277,696,277, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '133' $floorItems2['133'] = i - w.create(TkcText,628.5,335, 'text'=>'133', 'fill'=>color, + w.create(TkcText,628.5,335, 'text'=>'133', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, + i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '132' $floorItems2['132'] = i - w.create(TkcText,771,334, 'text'=>'132', 'fill'=>color, + w.create(TkcText,771,334, 'text'=>'132', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, + i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '134' $floorItems2['134'] = i - w.create(TkcText,749.5,224, 'text'=>'134', 'fill'=>color, + w.create(TkcText,749.5,224, 'text'=>'134', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, + i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '135' $floorItems2['135'] = i - w.create(TkcText,763,148.5, 'text'=>'135', 'fill'=>color, + w.create(TkcText,763,148.5, 'text'=>'135', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366, 304,312,396,312,396,288,400,288,404,288, 409,290,413,292,418,297,421,302,422,309, 421,318,417,325,411,330,405,332,397,333, 344,333,340,334,336,336,335,338,332,342, - 331,347,332,351,334,354,336,357,341,359, + 331,347,332,351,334,354,336,357,341,359, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Ramona Stair' $floorItems2['Ramona Stair'] = i - w.create(TkcText,368,323, 'text'=>'Ramona Stair', 'fill'=>color, + w.create(TkcText,368,323, 'text'=>'Ramona Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20, - 122,28,123,32,123,68,220,68,220,87,90,87,90,23, + 122,28,123,32,123,68,220,68,220,87,90,87,90,23, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'University Stair' $floorItems2['University Stair'] = i - w.create(TkcText,155,77.5, 'text'=>'University Stair', 'fill'=>color, + w.create(TkcText,155,77.5, 'text'=>'University Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56, 358,48,363,39,365,29,348,25,335,22,321,14, 300,5,283,1,260,0,246,0,242,2,236,4,231,8, - 227,13,223,17,221,22,220,34,260,34, + 227,13,223,17,221,22,220,34,260,34, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Plaza Stair' $floorItems2['Plaza Stair'] = i - w.create(TkcText,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, + w.create(TkcText,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49, 323,56,337,70,350,83,365,94,377,100, - 386,104,386,128,220,128, + 386,104,386,128,220,128, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Plaza Deck' $floorItems2['Plaza Deck'] = i - w.create(TkcText,303,81, 'text'=>'Plaza Deck', 'fill'=>color, + w.create(TkcText,303,81, 'text'=>'Plaza Deck', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '106' $floorItems2['106'] = i - w.create(TkcText,131.5,318.5, 'text'=>'106', 'fill'=>color, + w.create(TkcText,131.5,318.5, 'text'=>'106', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115, 95,128,114,128,114,151,157,151,157,153,112,153, - 112,130,97,130,97,168,175,168,175,131,146,131, + 112,130,97,130,97,168,175,168,175,131,146,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '119' $floorItems2['119'] = i - w.create(TkcText,143.5,133, 'text'=>'119', 'fill'=>color, + w.create(TkcText,143.5,133, 'text'=>'119', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) w.create(TkcLine,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall']) w.create(TkcLine,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall']) @@ -795,321 +795,321 @@ def floor2_fg2(w,color) i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222, - 800,222,800,168,748,168, + 800,222,800,168,748,168, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '238' $floorItems2['238'] = i - w.create(TkcText,774,195, 'text'=>'238', 'fill'=>color, + w.create(TkcText,774,195, 'text'=>'238', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '237' $floorItems2['237'] = i - w.create(TkcText,763,148.5, 'text'=>'237', 'fill'=>color, + w.create(TkcText,763,148.5, 'text'=>'237', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324, 643,324,643,291,641,291,641,205,696,205, 696,291,694,291,694,314,715,314,715,291, - 715,205,755,205,755,190,724,190,724,187, + 715,205,755,205,755,190,724,190,724,187, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '246' $floorItems2['246'] = i - w.create(TkcText,600,264, 'text'=>'246', 'fill'=>color, + w.create(TkcText,600,264, 'text'=>'246', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, + i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '247' $floorItems2['247'] = i - w.create(TkcText,668.5,296.5, 'text'=>'247', 'fill'=>color, + w.create(TkcText,668.5,296.5, 'text'=>'247', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246, 397,246,397,255,476,255,476,250,482,250,559,250, - 559,274,482,274,482,278,396,278,396,274,232,274, + 559,274,482,274,482,278,396,278,396,274,232,274, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '202' $floorItems2['202'] = i - w.create(TkcText,285.5,260, 'text'=>'202', 'fill'=>color, + w.create(TkcText,285.5,260, 'text'=>'202', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196, 306,196,306,180,175,180,175,169,156,169, - 156,196,176,196,176,228, + 156,196,176,196,176,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '206' $floorItems2['206'] = i - w.create(TkcText,143,267, 'text'=>'206', 'fill'=>color, + w.create(TkcText,143,267, 'text'=>'206', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, + i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '212' $floorItems2['212'] = i - w.create(TkcText,28.5,307.5, 'text'=>'212', 'fill'=>color, + w.create(TkcText,28.5,307.5, 'text'=>'212', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, + i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '245' $floorItems2['245'] = i - w.create(TkcText,521.5,300.5, 'text'=>'245', 'fill'=>color, + w.create(TkcText,521.5,300.5, 'text'=>'245', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, + i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '244' $floorItems2['244'] = i - w.create(TkcText,579.5,357.5, 'text'=>'244', 'fill'=>color, + w.create(TkcText,579.5,357.5, 'text'=>'244', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, + i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '243' $floorItems2['243'] = i - w.create(TkcText,622,357.5, 'text'=>'243', 'fill'=>color, + w.create(TkcText,622,357.5, 'text'=>'243', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, + i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '242' $floorItems2['242'] = i - w.create(TkcText,666.5,340.5, 'text'=>'242', 'fill'=>color, + w.create(TkcText,666.5,340.5, 'text'=>'242', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, + i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = 'Barbecue Deck' $floorItems2['Barbecue Deck'] = i - w.create(TkcText,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, + w.create(TkcText,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, + i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '240' $floorItems2['240'] = i - w.create(TkcText,736,288, 'text'=>'240', 'fill'=>color, + w.create(TkcText,736,288, 'text'=>'240', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, + i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '241' $floorItems2['241'] = i - w.create(TkcText,722,340.5, 'text'=>'241', 'fill'=>color, + w.create(TkcText,722,340.5, 'text'=>'241', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, + i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '239' $floorItems2['239'] = i - w.create(TkcText,736,233.5, 'text'=>'239', 'fill'=>color, + w.create(TkcText,736,233.5, 'text'=>'239', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, + i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '248' $floorItems2['248'] = i - w.create(TkcText,669,241.5, 'text'=>'248', 'fill'=>color, + w.create(TkcText,669,241.5, 'text'=>'248', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, + i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '236' $floorItems2['236'] = i - w.create(TkcText,700,160, 'text'=>'236', 'fill'=>color, + w.create(TkcText,700,160, 'text'=>'236', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, + i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '235' $floorItems2['235'] = i - w.create(TkcText,651.5,160, 'text'=>'235', 'fill'=>color, + w.create(TkcText,651.5,160, 'text'=>'235', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,626,143,633,143,633,135,572,135, - 572,143,579,143,579,185,626,185, + 572,143,579,143,579,185,626,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '234' $floorItems2['234'] = i - w.create(TkcText,606,160, 'text'=>'234', 'fill'=>color, + w.create(TkcText,606,160, 'text'=>'234', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,557,135,571,135,571,145,578,145, - 578,185,527,185,527,131,557,131, + 578,185,527,185,527,131,557,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '233' $floorItems2['233'] = i - w.create(TkcText,552.5,158, 'text'=>'233', 'fill'=>color, + w.create(TkcText,552.5,158, 'text'=>'233', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,249,557,249,557,205,476,205, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '230' $floorItems2['230'] = i - w.create(TkcText,516.5,227, 'text'=>'230', 'fill'=>color, + w.create(TkcText,516.5,227, 'text'=>'230', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, + i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '232' $floorItems2['232'] = i - w.create(TkcText,500.5,158, 'text'=>'232', 'fill'=>color, + w.create(TkcText,500.5,158, 'text'=>'232', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, + i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '229' $floorItems2['229'] = i - w.create(TkcText,485.5,195, 'text'=>'229', 'fill'=>color, + w.create(TkcText,485.5,195, 'text'=>'229', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, + i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '227' $floorItems2['227'] = i - w.create(TkcText,436.5,185.5, 'text'=>'227', 'fill'=>color, + w.create(TkcText,436.5,185.5, 'text'=>'227', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, + i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '228' $floorItems2['228'] = i - w.create(TkcText,436.5,231, 'text'=>'228', 'fill'=>color, + w.create(TkcText,436.5,231, 'text'=>'228', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, + i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '226' $floorItems2['226'] = i - w.create(TkcText,392,217.5, 'text'=>'226', 'fill'=>color, + w.create(TkcText,392,217.5, 'text'=>'226', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, + i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '225' $floorItems2['225'] = i - w.create(TkcText,356.5,150, 'text'=>'225', 'fill'=>color, + w.create(TkcText,356.5,150, 'text'=>'225', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, + i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '224' $floorItems2['224'] = i - w.create(TkcText,270,223.5, 'text'=>'224', 'fill'=>color, + w.create(TkcText,270,223.5, 'text'=>'224', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, + i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '223' $floorItems2['223'] = i - w.create(TkcText,292,157, 'text'=>'223', 'fill'=>color, + w.create(TkcText,292,157, 'text'=>'223', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, + i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '222' $floorItems2['222'] = i - w.create(TkcText,244.5,157, 'text'=>'222', 'fill'=>color, + w.create(TkcText,244.5,157, 'text'=>'222', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, + i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '221' $floorItems2['221'] = i - w.create(TkcText,198,157, 'text'=>'221', 'fill'=>color, + w.create(TkcText,198,157, 'text'=>'221', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, + i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '204' $floorItems2['204'] = i - w.create(TkcText,324,301.5, 'text'=>'204', 'fill'=>color, + w.create(TkcText,324,301.5, 'text'=>'204', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, + i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '205' $floorItems2['205'] = i - w.create(TkcText,265.5,307, 'text'=>'205', 'fill'=>color, + w.create(TkcText,265.5,307, 'text'=>'205', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,256,385,256,340,212,340,212,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '207' $floorItems2['207'] = i - w.create(TkcText,234,362.5, 'text'=>'207', 'fill'=>color, + w.create(TkcText,234,362.5, 'text'=>'207', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, + i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '208' $floorItems2['208'] = i - w.create(TkcText,187,362.5, 'text'=>'208', 'fill'=>color, + w.create(TkcText,187,362.5, 'text'=>'208', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, + i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '209' $floorItems2['209'] = i - w.create(TkcText,138.5,362.5, 'text'=>'209', 'fill'=>color, + w.create(TkcText,138.5,362.5, 'text'=>'209', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, + i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '217' $floorItems2['217'] = i - w.create(TkcText,71,192, 'text'=>'217', 'fill'=>color, + w.create(TkcText,71,192, 'text'=>'217', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, + i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '217A' $floorItems2['217A'] = i - w.create(TkcText,93,179.5, 'text'=>'217A', 'fill'=>color, + w.create(TkcText,93,179.5, 'text'=>'217A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, + i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '216' $floorItems2['216'] = i - w.create(TkcText,71,145.5, 'text'=>'216', 'fill'=>color, + w.create(TkcText,71,145.5, 'text'=>'216', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, + i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '215' $floorItems2['215'] = i - w.create(TkcText,28.5,157, 'text'=>'215', 'fill'=>color, + w.create(TkcText,28.5,157, 'text'=>'215', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, + i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '214' $floorItems2['214'] = i - w.create(TkcText,28.5,203.5, 'text'=>'214', 'fill'=>color, + w.create(TkcText,28.5,203.5, 'text'=>'214', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, + i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '213' $floorItems2['213'] = i - w.create(TkcText,28.5,252, 'text'=>'213', 'fill'=>color, + w.create(TkcText,28.5,252, 'text'=>'213', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, + i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '210' $floorItems2['210'] = i - w.create(TkcText,90.5,362.5, 'text'=>'210', 'fill'=>color, + w.create(TkcText,90.5,362.5, 'text'=>'210', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, + i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '211' $floorItems2['211'] = i - w.create(TkcText,33,364.5, 'text'=>'211', 'fill'=>color, + w.create(TkcText,33,364.5, 'text'=>'211', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, + i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '203' $floorItems2['203'] = i - w.create(TkcText,367.5,292.5, 'text'=>'203', 'fill'=>color, + w.create(TkcText,367.5,292.5, 'text'=>'203', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198, - 154,198,154,192,109,192,109,169,99,169, + 154,198,154,192,109,192,109,169,99,169, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '220' $floorItems2['220'] = i - w.create(TkcText,132.5,208.5, 'text'=>'220', 'fill'=>color, + w.create(TkcText,132.5,208.5, 'text'=>'220', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = 'Priv Lift2' $floorItems2['Priv Lift2'] = i - w.create(TkcText,323,188, 'text'=>'Priv Lift2', 'fill'=>color, + w.create(TkcText,323,188, 'text'=>'Priv Lift2', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = 'Pub Lift 2' $floorItems2['Pub Lift 2'] = i - w.create(TkcText,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, + w.create(TkcText,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, + i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '218' $floorItems2['218'] = i - w.create(TkcText,136,149.5, 'text'=>'218', 'fill'=>color, + w.create(TkcText,136,149.5, 'text'=>'218', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, + i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '219' $floorItems2['219'] = i - w.create(TkcText,132.5,180, 'text'=>'219', 'fill'=>color, + w.create(TkcText,132.5,180, 'text'=>'219', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '201' $floorItems2['201'] = i - w.create(TkcText,358,209, 'text'=>'201', 'fill'=>color, + w.create(TkcText,358,209, 'text'=>'201', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) w.create(TkcLine,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall']) w.create(TkcLine,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall']) @@ -1280,206 +1280,206 @@ 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '316' $floorItems2['316'] = i - w.create(TkcText,79.5,204, 'text'=>'316', 'fill'=>color, + w.create(TkcText,79.5,204, 'text'=>'316', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, + i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '309' $floorItems2['309'] = i - w.create(TkcText,138.5,345.5, 'text'=>'309', 'fill'=>color, + w.create(TkcText,138.5,345.5, 'text'=>'309', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, + i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '308' $floorItems2['308'] = i - w.create(TkcText,187.5,345.5, 'text'=>'308', 'fill'=>color, + w.create(TkcText,187.5,345.5, 'text'=>'308', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, + i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '307' $floorItems2['307'] = i - w.create(TkcText,234,345.5, 'text'=>'307', 'fill'=>color, + w.create(TkcText,234,345.5, 'text'=>'307', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, + i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '305' $floorItems2['305'] = i - w.create(TkcText,270.5,301.5, 'text'=>'305', 'fill'=>color, + w.create(TkcText,270.5,301.5, 'text'=>'305', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,251,219,251,203,244,203,244,219, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '324B' $floorItems2['324B'] = i - w.create(TkcText,247.5,211, 'text'=>'324B', 'fill'=>color, + w.create(TkcText,247.5,211, 'text'=>'324B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, + i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '324A' $floorItems2['324A'] = i - w.create(TkcText,247.5,240.5, 'text'=>'324A', 'fill'=>color, + w.create(TkcText,247.5,240.5, 'text'=>'324A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, + i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '320' $floorItems2['320'] = i - w.create(TkcText,200,157, 'text'=>'320', 'fill'=>color, + w.create(TkcText,200,157, 'text'=>'320', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, + i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '310' $floorItems2['310'] = i - w.create(TkcText,90.5,345.5, 'text'=>'310', 'fill'=>color, + w.create(TkcText,90.5,345.5, 'text'=>'310', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, + i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '312' $floorItems2['312'] = i - w.create(TkcText,45.5,299, 'text'=>'312', 'fill'=>color, + w.create(TkcText,45.5,299, 'text'=>'312', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, + i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '313' $floorItems2['313'] = i - w.create(TkcText,45.5,252, 'text'=>'313', 'fill'=>color, + w.create(TkcText,45.5,252, 'text'=>'313', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, + i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '314' $floorItems2['314'] = i - w.create(TkcText,40.5,203.5, 'text'=>'314', 'fill'=>color, + w.create(TkcText,40.5,203.5, 'text'=>'314', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, + i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '315' $floorItems2['315'] = i - w.create(TkcText,59,157, 'text'=>'315', 'fill'=>color, + w.create(TkcText,59,157, 'text'=>'315', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, + i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '316B' $floorItems2['316B'] = i - w.create(TkcText,95,215, 'text'=>'316B', 'fill'=>color, + w.create(TkcText,95,215, 'text'=>'316B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, + i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '316A' $floorItems2['316A'] = i - w.create(TkcText,95,191, 'text'=>'316A', 'fill'=>color, + w.create(TkcText,95,191, 'text'=>'316A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198, - 174,198,174,226,101,226,101,179,97,179, + 174,198,174,226,101,226,101,179,97,179, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '319' $floorItems2['319'] = i - w.create(TkcText,141.5,209, 'text'=>'319', 'fill'=>color, + w.create(TkcText,141.5,209, 'text'=>'319', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, + i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '311' $floorItems2['311'] = i - w.create(TkcText,29.5,361, 'text'=>'311', 'fill'=>color, + w.create(TkcText,29.5,361, 'text'=>'311', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, + i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '318' $floorItems2['318'] = i - w.create(TkcText,132.5,180, 'text'=>'318', 'fill'=>color, + w.create(TkcText,132.5,180, 'text'=>'318', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, + i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '317' $floorItems2['317'] = i - w.create(TkcText,136,149.5, 'text'=>'317', 'fill'=>color, + w.create(TkcText,136,149.5, 'text'=>'317', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, + i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '323' $floorItems2['323'] = i - w.create(TkcText,290,207.5, 'text'=>'323', 'fill'=>color, + w.create(TkcText,290,207.5, 'text'=>'323', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, + i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '325' $floorItems2['325'] = i - w.create(TkcText,290,235.5, 'text'=>'325', 'fill'=>color, + w.create(TkcText,290,235.5, 'text'=>'325', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, + i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '321' $floorItems2['321'] = i - w.create(TkcText,243.5,157, 'text'=>'321', 'fill'=>color, + w.create(TkcText,243.5,157, 'text'=>'321', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,314,169,306,169,306,192,273,192, - 264,181,264,135,314,135, + 264,181,264,135,314,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '322' $floorItems2['322'] = i - w.create(TkcText,293.5,163.5, 'text'=>'322', 'fill'=>color, + w.create(TkcText,293.5,163.5, 'text'=>'322', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = 'Pub Lift3' $floorItems2['Pub Lift3'] = i - w.create(TkcText,323,223, 'text'=>'Pub Lift3', 'fill'=>color, + w.create(TkcText,323,223, 'text'=>'Pub Lift3', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = 'Priv Lift3' $floorItems2['Priv Lift3'] = i - w.create(TkcText,323,188, 'text'=>'Priv Lift3', 'fill'=>color, + w.create(TkcText,323,188, 'text'=>'Priv Lift3', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, + i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '303' $floorItems2['303'] = i - w.create(TkcText,373.5,292.5, 'text'=>'303', 'fill'=>color, + w.create(TkcText,373.5,292.5, 'text'=>'303', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,272,203,272,249,252,249,252,230, - 244,230,244,221,252,221,252,203, + 244,230,244,221,252,221,252,203, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '324' $floorItems2['324'] = i - w.create(TkcText,262,226, 'text'=>'324', 'fill'=>color, + w.create(TkcText,262,226, 'text'=>'324', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, + i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '304' $floorItems2['304'] = i - w.create(TkcText,324,301.5, 'text'=>'304', 'fill'=>color, + w.create(TkcText,324,301.5, 'text'=>'304', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '301' $floorItems2['301'] = i - w.create(TkcText,358,209, 'text'=>'301', 'fill'=>color, + w.create(TkcText,358,209, 'text'=>'301', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, + i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '327' $floorItems2['327'] = i - w.create(TkcText,387,215.5, 'text'=>'327', 'fill'=>color, + w.create(TkcText,387,215.5, 'text'=>'327', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, + i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '326' $floorItems2['326'] = i - w.create(TkcText,365.5,150, 'text'=>'326', 'fill'=>color, + w.create(TkcText,365.5,150, 'text'=>'326', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282, - 375,274,397,274,397,248,339,248,339,242,308,242, + 375,274,397,274,397,248,339,248,339,242,308,242, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '302' $floorItems2['302'] = i - w.create(TkcText,319.5,261, 'text'=>'302', 'fill'=>color, + w.create(TkcText,319.5,261, 'text'=>'302', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203, 272,193,263,180,242,180,175,180,175,169,156,169, 156,196,177,196,177,228,107,228,70,228,70,275,107,275, - 107,248,160,248,160,301,107,301,107,275,70,275, + 107,248,160,248,160,301,107,301,107,275,70,275, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '306' $floorItems2['306'] = i - w.create(TkcText,200.5,284.5, 'text'=>'306', 'fill'=>color, + w.create(TkcText,200.5,284.5, 'text'=>'306', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) w.create(TkcLine,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall']) w.create(TkcLine,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall']) @@ -1574,7 +1574,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($floor2_demo) && $floor2_demo - $floor2_demo.destroy + $floor2_demo.destroy $floor2_demo = nil end @@ -1590,7 +1590,7 @@ base_frame = TkFrame.new($floor2_demo).pack(:fill=>:both, :expand=>true) # label À¸À® -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', 'text'=>"¤³¤Î¥¦¥£¥ó¥É¥¦¤Ë¤Ï¥Ç¥£¥¸¥¿¥ë¥¨¥¯¥¤¥Ã¥×¥á¥ó¥È¼Ò¤Î¥¦¥§¥¹¥¿¥ó¥ê¥µ¡¼¥Á¥é¥Ü¥é¥È¥ê (DECWRL) ¤Î´Ö¼è¤ê¤¬½ñ¤«¤ì¤¿¥­¥ã¥ó¥Ð¥¹ widget ¤¬Æþ¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤Ï 3³¬·ú¤Æ¤Ç¡¢¾ï¤Ë¤½¤Î¤¦¤Á¤Î1³¬Ê¬¤¬ÁªÂò¡¢¤Ä¤Þ¤ê¤½¤Î´Ö¼è¤ê¤¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤¢¤ë³¬¤òÁªÂò¤¹¤ë¤Ë¤Ï¡¢¤½¤Î¾å¤Ç¥Þ¥¦¥¹¤Îº¸¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£¥Þ¥¦¥¹¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë³¬¤Î¾å¤òư¤¯¤È¡¢¤½¤Î²¼¤Ë¤¢¤ëÉô²°¤Î¿§¤¬ÊѤï¤ê¡¢Éô²°Èֹ椬¡ÖÉô²°ÈÖ¹æ:¡×¥¨¥ó¥È¥ê¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£¤Þ¤¿¡¢¥¨¥ó¥È¥ê¤ËÉô²°ÈÖ¹æ¤ò½ñ¤¯¤È¤½¤ÎÉô²°¤Î¿§¤¬ÊѤï¤ê¤Þ¤¹¡£"){ pack('side'=>'top') } @@ -1622,10 +1622,10 @@ if $tk_version =~ /^4\.[01]/ $floor2_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken', 'highlightthickness'=>2) - $floor2_canvas = TkCanvas.new($floor2_canvas_frame, - 'width'=>900, 'height'=>500, 'borderwidth'=>0, + $floor2_canvas = TkCanvas.new($floor2_canvas_frame, + 'width'=>900, 'height'=>500, 'borderwidth'=>0, 'highlightthickness'=>0) {|c| - TkScrollbar.new(base_frame, 'orient'=>'horiz', + TkScrollbar.new(base_frame, 'orient'=>'horiz', 'command'=>proc{|*args| c.xview(*args)}){|hs| c.xscrollcommand(proc{|first,last| hs.set first,last}) pack('side'=>'bottom', 'fill'=>'x') @@ -1646,20 +1646,20 @@ v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical') TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1| - $floor2_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, - 'borderwidth'=>0, + $floor2_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, + 'borderwidth'=>0, 'highlightthickness'=>0) { xscrollcommand(proc{|first,last| h.set first,last}) yscrollcommand(proc{|first,last| v.set first,last}) pack('expand'=>'yes', 'fill'=>'both') } - grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, + grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') } - v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, + v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, + h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) @@ -1675,7 +1675,7 @@ # Create an entry for displaying and typing in current room. $currentRoom2 = TkVariable.new -$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken', +$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken', 'bd'=>2, 'textvariable'=>$currentRoom2) # Choose colors, then fill in the floorplan. @@ -1712,7 +1712,7 @@ $floor2_canvas.itembind('room', 'Enter', proc{newRoom2 $floor2_canvas}) $floor2_canvas.itembind('room', 'Leave', proc{$currentRoom2.value = ''}) $floor2_canvas.bind('2', proc{|x,y| $floor2_canvas.scan_mark x,y}, '%x %y') -$floor2_canvas.bind('B2-Motion', +$floor2_canvas.bind('B2-Motion', proc{|x,y| $floor2_canvas.scan_dragto x,y}, '%x %y') $floor2_canvas.bind('Destroy', proc{$currentRoom2.unset}) $currentRoom2.value = '' Index: ext/tk/sample/demos-jp/anilabel.rb =================================================================== --- ext/tk/sample/demos-jp/anilabel.rb (revision 23917) +++ ext/tk/sample/demos-jp/anilabel.rb (working copy) @@ -6,7 +6,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($anilabel_demo) && $anilabel_demo - $anilabel_demo.destroy + $anilabel_demo.destroy $anilabel_demo = nil end @@ -50,7 +50,7 @@ # label demo Íѥե졼¥àÀ¸À® f_left = TkLabelFrame.new(base_frame, :text=>'Scrolling Texts') f_right = TkLabelFrame.new(base_frame, :text=>'GIF Image') -Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both', +Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both', 'padx'=>10, 'pady'=>10) # animated label @@ -88,7 +88,7 @@ @btag.bind_append('Destroy'){ if @destroy_image begin - self.image.delete + self.image.delete rescue end end @@ -124,13 +124,13 @@ end # label À¸À® -l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge, +l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge, :font=>{:family=>'Courier', :size=>10}) -l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove, +l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove, :font=>{:family=>'Courier', :size=>10}) -l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat, +l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat, :font=>{:family=>'Courier', :size=>10}, :width=>18) -Tk.pack(l1, l2, l3, +Tk.pack(l1, l2, l3, :side=>:top, :expand=>true, :anchor=>:w, :padx=>10, :pady=>10) limg = AnimatedImageLabel.new(f_right, :borderwidth=>0) Index: ext/tk/sample/demos-jp/twind2.rb =================================================================== --- ext/tk/sample/demos-jp/twind2.rb (revision 23917) +++ ext/tk/sample/demos-jp/twind2.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($twind2_demo) && $twind2_demo - $twind2_demo.destroy + $twind2_demo.destroy $twind2_demo = nil end @@ -20,20 +20,20 @@ # frame À¸À® $twind2_buttons = TkFrame.new(base_frame) {|frame| - TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), + TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - TkButton.new(frame, :text=>'¥³¡¼¥É»²¾È', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'twind2'}), - TkButton.new(frame, :text=>'ÊĤ¸¤ë', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + TkButton.new(frame, :text=>'¥³¡¼¥É»²¾È', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'twind2'}), + TkButton.new(frame, :text=>'ÊĤ¸¤ë', + :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $twind2_demo $twind2_demo = nil $showVarsWin[tmppath.path] = nil tmppath.destroy - }), + }), :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) } @@ -41,11 +41,11 @@ # frame À¸À® $twind2_text = nil -TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, +TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, 'relief'=>'sunken') {|f| $twind2_text = TkText.new(f, 'setgrid'=>true, 'font'=>$font, - # 'width'=>'70', 'height'=>35, 'wrap'=>'word', - 'width'=>'70', 'height'=>35, 'wrap'=>'char', + # 'width'=>'70', 'height'=>35, 'wrap'=>'word', + 'width'=>'70', 'height'=>35, 'wrap'=>'char', 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| TkScrollbar.new(f) {|s| command proc{|*args| t.yview(*args)} @@ -55,11 +55,11 @@ }.pack('expand'=>'yes', 'fill'=>'both') # ¥¿¥°À¸À® -$tag2_center = TkTextTag.new($twind2_text, +$tag2_center = TkTextTag.new($twind2_text, 'justify' =>'center', 'spacing1'=>'5m', 'spacing3'=>'5m' ) -$tag2_buttons = TkTextTag.new($twind2_text, +$tag2_buttons = TkTextTag.new($twind2_text, 'lmargin1'=>'1c', 'lmargin2'=>'1c', 'rmargin' =>'1c', @@ -86,7 +86,7 @@ $twind2_text.insert('end', '¥Ü¥¿¥ó¥¦¥£¥¸¥§¥Ã¥È¤¬Ëä¤á¹þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£') $twind2_text.insert('end', 'ºÇ½é¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢') $twind2_text.insert('end', '¿åÊ¿Êý¸þ¤Î¥¹¥¯¥í¡¼¥ë¤ò ') -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { #text 'ON' text '¥ª¥ó' @@ -95,7 +95,7 @@ }) $twind2_text.insert('end', "¤Ë¤·¤Þ¤¹¡£¤Þ¤¿¡¢£²¤Ä¤á¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È\n") $twind2_text.insert('end', '¿åÊ¿Êý¸þ¤Î¥¹¥¯¥í¡¼¥ë¤ò') -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { #text 'OFF' text '¥ª¥Õ' @@ -105,7 +105,7 @@ $twind2_text.insert('end', "¤Ë¤·¤Þ¤¹¡£\n\n") $twind2_text.insert('end', '¼¡¤Ï¤â¤¦¤Ò¤È¤Ä¤ÎÎã¤Ç¤¹¡£') -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { text '¤³¤³¤ò¥¯¥ê¥Ã¥¯' command proc{textWindPlot2 $twind2_text} @@ -116,7 +116,7 @@ $mark2_plot.gravity='left' $twind2_text.insert('end', '¥Þ¥¦¥¹¤Ç¥É¥é¥Ã¥°¤¹¤ë¤³¤È¤Ç¡¢') $twind2_text.insert('end', '¥×¥í¥Ã¥È¾å¤Î¥Ç¡¼¥¿ÅÀ¤ò°Üư¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£') -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { text '¾Ãµî' command proc{textWindDel2 $twind2_text} @@ -148,7 +148,7 @@ } TkTextWindow.new($twind2_text, 'end', 'window'=>btn_default, 'padx'=>3) embToggle = TkVariable.new('Short') -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkCheckButton.new($twind2_text) { textvariable embToggle indicatoron 0 @@ -159,21 +159,21 @@ pady 5 padx 2 }, - 'padx'=>3, + 'padx'=>3, 'pady'=>2 ) -[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', - 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', - 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', - 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' +[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', + 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', + 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', + 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' ].each{|twind_color| - TkTextWindow.new($twind2_text, 'end', + TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { text twind_color cursor 'top_left_arrow' command proc{$twind2_text.bg twind_color} }, - 'padx'=>3, + 'padx'=>3, 'pady'=>2 ) } @@ -187,44 +187,44 @@ $twind2_text.insert('end', "\nborder width ¤ä highlightthickness, ") $twind2_text.insert('end', "padding ¤òÄ̾ï¤ÎÃͤ«¤éÊѹ¹¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£\n") -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Big borders", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Big borders", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinBigB2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Small borders", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Small borders", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinSmallB2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Big highlight", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Big highlight", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinBigH2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text, :text=>"Small highlight", - :cursor=>'top_left_arrow', + :cursor=>'top_left_arrow', 'command'=>proc{ textWinSmallH2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Big pad", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Big pad", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinBigP2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Small pad", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Small pad", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinSmallP2 $twind2_text })) @@ -232,9 +232,9 @@ $twind2_text.insert('end', "\n\n¹¹¤Ë¥¤¥á¡¼¥¸¤â¥Æ¥­¥¹¥È¥¦¥£¥¸¥§¥Ã¥È¤Ë") $twind2_text.insert('end', "¤¦¤Þ¤¯ÇÛÃ֤Ǥ­¤Þ¤¹¡§") -TkTextImage.new($twind2_text, 'end', +TkTextImage.new($twind2_text, 'end', 'image'=>TkBitmapImage.new(:file=>[ - $demo_dir, '..', + $demo_dir, '..', 'images', 'face.xbm' ].join(File::Separator))) @@ -309,39 +309,39 @@ TkcLine.new($twind2_plot, 100, 250, 400, 250, 'width'=>2) TkcLine.new($twind2_plot, 100, 250, 100, 50, 'width'=>2) - TkcText.new($twind2_plot, 225, 20, + TkcText.new($twind2_plot, 225, 20, 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) TkcLine.new($twind2_plot, x, 250, x, 245, 'width'=>2) - TkcText.new($twind2_plot, x, 254, + TkcText.new($twind2_plot, x, 254, 'text'=>10*i, 'font'=>font, 'anchor'=>'n') } (0..5).each {|i| y = 250 - (i * 40) TkcLine.new($twind2_plot, 100, y, 105, y, 'width'=>2) - TkcText.new($twind2_plot, 96, y, + TkcText.new($twind2_plot, 96, y, 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') } for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] x = 100 + (3*xx) y = 250 - (4*yy)/5 - item = TkcOval.new($twind2_plot, x-6, y-6, x+6, y+6, + item = TkcOval.new($twind2_plot, x-6, y-6, x+6, y+6, 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') item.addtag 'point' end - $twind2_plot.itembind('point', 'Any-Enter', + $twind2_plot.itembind('point', 'Any-Enter', proc{$twind2_plot.itemconfigure 'current', 'fill', 'red'}) - $twind2_plot.itembind('point', 'Any-Leave', + $twind2_plot.itembind('point', 'Any-Leave', proc{$twind2_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) - $twind2_plot.itembind('point', '1', + $twind2_plot.itembind('point', '1', proc{|x,y| embPlotDown2 $twind2_plot,x,y}, "%x %y") - $twind2_plot.itembind('point', 'ButtonRelease-1', + $twind2_plot.itembind('point', 'ButtonRelease-1', proc{$twind2_plot.dtag 'selected'}) - $twind2_plot.bind('B1-Motion', + $twind2_plot.bind('B1-Motion', proc{|x,y| embPlotMove2 $twind2_plot,x,y}, "%x %y") while ($twind2_text.get($mark2_plot) =~ /[ \t\n]/) $twind2_text.delete $mark2_plot Index: ext/tk/sample/demos-jp/spin.rb =================================================================== --- ext/tk/sample/demos-jp/spin.rb (revision 23917) +++ ext/tk/sample/demos-jp/spin.rb (working copy) @@ -7,7 +7,7 @@ # based on Tcl/Tk8.4.4 widget demos if defined?($spin_demo) && $spin_demo - $spin_demo.destroy + $spin_demo.destroy $spin_demo = nil end @@ -19,8 +19,8 @@ base_frame = TkFrame.new($spin_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'5i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'5i', :justify=>:left, :text=><:top) ²¼¤Ë¤Ï£³¼ïÎà¤Î¥¹¥Ô¥ó¥Ü¥Ã¥¯¥¹¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ ¤½¤ì¤¾¤ì¡¢¥Þ¥¦¥¹¤ÇÁªÂò¤·¤ÆÊ¸»ú¤òÆþÎϤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @@ -38,7 +38,7 @@ ¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë Ruby ¤Ë¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë Tk ¥é¥¤ ¥Ö¥é¥ê¤¬ spinbox ¥¦¥£¥¸¥§¥Ã¥È¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¤³¤Î ¥Ç¥â¤Ï¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤Ï¤º¤Ç¤¹¡£¤½¤Î¾ì¹ç¤Ë¤Ï spinbox ¥¦¥£ -¥¸¥§¥Ã¥È¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Tk +¥¸¥§¥Ã¥È¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Tk ¤òÁȤ߹ç¤ï¤»¤Æ»î¤¹¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ EOL @@ -56,16 +56,16 @@ } australianCities = [ - 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', + 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', 'Brisbane', 'Hobart', 'Darwin', 'Alice Springs' ] [ - TkSpinbox.new(base_frame, :from=>1, :to=>10, :width=>10, :validate=>:key, + TkSpinbox.new(base_frame, :from=>1, :to=>10, :width=>10, :validate=>:key, :validatecommand=>[ proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' - ]), - TkSpinbox.new(base_frame, :from=>0, :to=>3, :increment=>0.5, - :format=>'%05.2f', :width=>10), + ]), + TkSpinbox.new(base_frame, :from=>0, :to=>3, :increment=>0.5, + :format=>'%05.2f', :width=>10), TkSpinbox.new(base_frame, :values=>australianCities, :width=>10) ].each{|sbox| sbox.pack(:side=>:top, :pady=>5, :padx=>10)} Index: ext/tk/sample/demos-jp/button.rb =================================================================== --- ext/tk/sample/demos-jp/button.rb (revision 23917) +++ ext/tk/sample/demos-jp/button.rb (working copy) @@ -6,7 +6,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($button_demo) && $button_demo - $button_demo.destroy + $button_demo.destroy $button_demo = nil end Index: ext/tk/sample/demos-jp/bind.rb =================================================================== --- ext/tk/sample/demos-jp/bind.rb (revision 23917) +++ ext/tk/sample/demos-jp/bind.rb (working copy) @@ -5,7 +5,7 @@ # toplevel widget ¤¬Â¸ºß¤¹¤ì¤Ðºï½ü¤¹¤ë if defined?($bind_demo) && $bind_demo - $bind_demo.destroy + $bind_demo.destroy $bind_demo = nil end @@ -59,7 +59,7 @@ # ¥¹¥¿¥¤¥ëÀßÄê if TkWinfo.depth($root).to_i > 1 - tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised', + tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised', 'borderwidth'=>1} tagstyle_normal = {'background'=>'', 'relief'=>'flat'} else @@ -75,44 +75,44 @@ insert('end', "\n\n") insert('end', '2. ´Êñ¤Ê 2¼¡¸µ¤Î¥×¥í¥Ã¥È¡£¥Ç¡¼¥¿¤òɽ¤¹ÅÀ¤òư¤«¤¹¤³¤È¤¬¤Ç¤­¤ë¡£', (d2 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '3. ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤Î¥¢¥ó¥«¡¼¤È¹Ô·¤¨¡£', + insert('end', '3. ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤Î¥¢¥ó¥«¡¼¤È¹Ô·¤¨¡£', (d3 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '4. ¥é¥¤¥ó¥¢¥¤¥Æ¥à¤Î¤¿¤á¤ÎÌð°õ¤ÎƬ¤Î·Á¤Î¥¨¥Ç¥£¥¿¡£', + insert('end', '4. ¥é¥¤¥ó¥¢¥¤¥Æ¥à¤Î¤¿¤á¤ÎÌð°õ¤ÎƬ¤Î·Á¤Î¥¨¥Ç¥£¥¿¡£', (d4 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '5. ¥¿¥Ö¥¹¥È¥Ã¥×¤òÊѹ¹¤¹¤ë¤¿¤á¤Îµ¡Ç½¤Ä¤­¤Î¥ë¡¼¥é¡¼¡£', + insert('end', '5. ¥¿¥Ö¥¹¥È¥Ã¥×¤òÊѹ¹¤¹¤ë¤¿¤á¤Îµ¡Ç½¤Ä¤­¤Î¥ë¡¼¥é¡¼¡£', (d5 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', - '6. ¥­¥ã¥ó¥Ð¥¹¤¬¤É¤¦¤ä¤Ã¤Æ¥¹¥¯¥í¡¼¥ë¤¹¤ë¤Î¤«¤ò¼¨¤¹¥°¥ê¥Ã¥É¡£', + insert('end', + '6. ¥­¥ã¥ó¥Ð¥¹¤¬¤É¤¦¤ä¤Ã¤Æ¥¹¥¯¥í¡¼¥ë¤¹¤ë¤Î¤«¤ò¼¨¤¹¥°¥ê¥Ã¥É¡£', (d6 = TkTextTag.new(t)) ) # binding [d1, d2, d3, d4, d5, d6].each{|tag| tag_binding_for_bind_demo(tag, tagstyle_bold, tagstyle_normal) } - d1.bind('1', + d1.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'items.rb'].join(File::Separator)}`, 'items.rb') }) - d2.bind('1', + d2.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`, 'plot.rb') }) - d3.bind('1', + d3.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`, 'ctext.rb') }) - d4.bind('1', + d4.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`, 'arrow.rb') }) - d5.bind('1', + d5.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`, 'ruler.rb') }) - d6.bind('1', + d6.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`, 'cscroll.rb') }) Index: ext/tk/sample/editable_listbox.rb =================================================================== --- ext/tk/sample/editable_listbox.rb (revision 23917) +++ ext/tk/sample/editable_listbox.rb (working copy) @@ -1,29 +1,78 @@ # -# Editable_TkListbox class +# Tk::Editable_Listbox class # # When "DoubleClick-1" on a listbox item, the entry box is opend on the # item. And when hit "Return" key on the entry box after modifying the -# text, the entry box is closed and the item is changed. Or when hit +# text, the entry box is closed and the item is changed. Or when hit # "Escape" key, the entry box is closed without modification. # # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # require 'tk' -class Editable_TkListbox < TkListbox - def _ebox_placer(coord_y) - idx = self.nearest(coord_y) - x, y, w, h = self.bbox(idx) - @ebox.place(:x => 0, :relwidth => 1.0, - :y => y - self.selectborderwidth, - :height => h + 2 * self.selectborderwidth) +class Tk::Editable_Listbox < TkListbox + def _ebox_move(idx) + x, y, w, h = bbox(idx) + return unless y && h + @ebox.place(:x => 0, :relwidth => 1.0, + :y => y - selectborderwidth, + :height => h + 2 * selectborderwidth) @ebox.pos = idx - @ebox.value = self.listvariable.list[idx] @ebox.focus end - private :_ebox_placer + def _ebox_placer(idx) + _ebox_move(idx) + @ebox.value = listvariable.list[idx] + @ebox.xview_moveto(self.xview[0]) + end + def _ebox_erase + @ebox.place_forget + @ebox.pos = -1 + end + private :_ebox_move, :_ebox_placer, :_ebox_erase + + def _setup_ebox_bindings + # bindings for entry + @ebox.bind('Return'){ + list = listvariable.list + list[@ebox.pos] = @ebox.value + listvariable.value = list + _ebox_erase + focus + } + + @ebox.bind('Escape'){ _ebox_erase } + end + def _setup_listbox_bindings + # bindings for listbox + bind('FocusIn'){ + if (idx = @ebox.pos) >= 0 + see(idx) if bbox(idx).empty? + @ebox.focus(true) + end + } + + bind('Double-1', '%y'){|y| _ebox_placer(nearest(y)) } + + bind('Return'){ + if idx = index(:active) + _ebox_placer(idx) + end + } + end + private :_setup_ebox_bindings, :_setup_listbox_bindings + + def yview(*args) + if bbox(@ebox.pos).empty? + @ebox.place_forget + else + _ebox_move(@ebox.pos) + end + super + end + def create_self(keys) super(keys) @@ -37,33 +86,25 @@ def self.pos=(idx); @pos = idx; end } - @ebox.bind('Return'){ - list = self.listvariable.list - list[@ebox.pos] = @ebox.value - self.listvariable.value = list - @ebox.place_forget - @ebox.pos = -1 - } - - @ebox.bind('Escape'){ - @ebox.place_forget - @ebox.pos = -1 - } - - self.bind('Double-1', '%y'){|y| _ebox_placer(y) } + _setup_ebox_bindings + _setup_listbox_bindings end end if $0 == __FILE__ + #lbox0 = TkListbox.new.pack(:side=>:left) + #lbox0.insert(:end, 0,1,2,3,4,5,6,7,8,9,0,1,2,3) + scr = TkScrollbar.new.pack(:side=>:right, :fill=>:y) - lbox1 = Editable_TkListbox.new.pack(:side=>:left) - lbox2 = Editable_TkListbox.new.pack(:side=>:left) + lbox1 = Tk::Editable_Listbox.new.pack(:side=>:left) + lbox2 = Tk::Editable_Listbox.new.pack(:side=>:left) scr.assign(lbox1, lbox2) lbox1.insert(:end, *%w(a b c d e f g h i j k l m n)) lbox2.insert(:end, 0,1,2,3,4,5,6,7,8,9,0,1,2,3) + Tk.mainloop end Index: ext/tk/sample/tkoptdb-safeTk.rb =================================================================== --- ext/tk/sample/tkoptdb-safeTk.rb (revision 23917) +++ ext/tk/sample/tkoptdb-safeTk.rb (working copy) @@ -18,19 +18,19 @@ if ENV['LANG'] =~ /^ja/ # read Japanese resource - ent = TkOptionDB.read_entries(File.expand_path('resource.ja', + ent = TkOptionDB.read_entries(File.expand_path('resource.ja', File.dirname(__FILE__)), 'euc-jp') else # read English resource - ent = TkOptionDB.read_entries(File.expand_path('resource.en', + ent = TkOptionDB.read_entries(File.expand_path('resource.en', File.dirname(__FILE__))) end file = File.expand_path('tkoptdb.rb', File.dirname(__FILE__)) ip = MultiTkIp.new_safeTk{ - # When a block is given to 'new_safeTk' method, + # When a block is given to 'new_safeTk' method, # the block is evaluated on $SAFE==4. ent.each{|pat, val| Tk.tk_call('option', 'add', pat, val)} } @@ -38,22 +38,22 @@ print "ip.eval_proc{$SAFE} ==> ", ip.eval_proc{$SAFE}, "\n" print "\ncall 'ip.wait_on_mainloop = false'\n" -print "If 'ip.wait_on_mainloop? == true', ", - "when 'mainloop' is called on 'ip.eval_proc', ", - "'ip.eval_proc' does't return while the root window exists.\n", - "If you want to avoid that, set wait_on_mainloop to false. ", - "Then the mainloop in the eval_proc returns soon ", - "and the following steps are evaluated. \n", - "If you hate the both of them, use 'ip.bg_eval_proc' or ", +print "If 'ip.wait_on_mainloop? == true', ", + "when 'mainloop' is called on 'ip.eval_proc', ", + "'ip.eval_proc' does't return while the root window exists.\n", + "If you want to avoid that, set wait_on_mainloop to false. ", + "Then the mainloop in the eval_proc returns soon ", + "and the following steps are evaluated. \n", + "If you hate the both of them, use 'ip.bg_eval_proc' or ", "wrap 'ip.eval_proc' by a thread.\n" ip.wait_on_mainloop = false ret = ip.eval_proc{ - # When a block is given to 'eval_proc' method, + # When a block is given to 'eval_proc' method, # the block is evaluated on the IP's current safe level. - # So, the followings raises an exception. - # An Exception object of the exception is returned as a + # So, the followings raises an exception. + # An Exception object of the exception is returned as a # return value of this method. load file @@ -64,7 +64,7 @@ safe0_cmd = Proc.new{ print 'safe0_cmd safe-level == ', $SAFE, "\n" - # This proc object keeps current safe-level ($SAFE==0). + # This proc object keeps current safe-level ($SAFE==0). load file } ip.eval_proc{safe0_cmd.call} Index: ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb (working copy) @@ -10,16 +10,16 @@ } end -Tk::Iwidgets::Hierarchy.new(:querycommand=>proc{|arg| get_files(arg.node)}, - :visibleitems=>'30x15', - :labeltext=>ENV['HOME']).pack(:side=>:left, - :expand=>true, +Tk::Iwidgets::Hierarchy.new(:querycommand=>proc{|arg| get_files(arg.node)}, + :visibleitems=>'30x15', + :labeltext=>ENV['HOME']).pack(:side=>:left, + :expand=>true, :fill=>:both) -# Tk::Iwidgets::Hierarchy.new(:querycommand=>[proc{|n| get_files(n)}, '%n'], -# :visibleitems=>'30x15', -# :labeltext=>ENV['HOME']).pack(:side=>:left, -# :expand=>true, +# Tk::Iwidgets::Hierarchy.new(:querycommand=>[proc{|n| get_files(n)}, '%n'], +# :visibleitems=>'30x15', +# :labeltext=>ENV['HOME']).pack(:side=>:left, +# :expand=>true, # :fill=>:both) Tk.mainloop Index: ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb (working copy) @@ -18,10 +18,10 @@ end def initialize(parent=nil) - @spinner = Tk::Iwidgets::Spinner.new(parent, :labeltext=>'Month : ', - :width=>10, :fixed=>10, - :validate=>proc{|c| block_input}, - :decrement=>proc{spin_month -1}, + @spinner = Tk::Iwidgets::Spinner.new(parent, :labeltext=>'Month : ', + :width=>10, :fixed=>10, + :validate=>proc{|c| block_input}, + :decrement=>proc{spin_month -1}, :increment=>proc{spin_month 1}) @path = @spinner @spinner.insert(0, Months[0]) Index: ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb (working copy) @@ -2,9 +2,9 @@ require 'tk' require 'tkextlib/iwidgets' -mb = Tk::Iwidgets::Messagebox.new(:hscrollmode=>:dynamic, - :labeltext=>'Messages', :labelpos=>:n, - :height=>120, :width=>550, +mb = Tk::Iwidgets::Messagebox.new(:hscrollmode=>:dynamic, + :labeltext=>'Messages', :labelpos=>:n, + :height=>120, :width=>550, :savedir=>'/tmp', :textbackground=>'#d9d9d9') mb.pack(:padx=>5, :pady=>5, :fill=>:both, :expand=>true) Index: ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/iwidgets' -Tk::Iwidgets::Extfileselectionbox.new.pack(:padx=>10, :pady=>10, +Tk::Iwidgets::Extfileselectionbox.new.pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true) Tk.mainloop Index: ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb (working copy) @@ -8,7 +8,7 @@ ds.add('Cancel', :text=>'Cancel', :command=>proc{puts 'Cancel'; ds.deactivate}) ds.default('OK') -TkButton.new(:text=>'ACTIVATE', :padx=>7, :pady=>7, +TkButton.new(:text=>'ACTIVATE', :padx=>7, :pady=>7, :command=>proc{puts ds.activate}).pack(:padx=>10, :pady=>10) Tk.mainloop Index: ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/iwidgets' -djl = Tk::Iwidgets::Disjointlistbox.new.pack(:fill=>:both, :expand=>true, +djl = Tk::Iwidgets::Disjointlistbox.new.pack(:fill=>:both, :expand=>true, :padx=>10, :pady=>10) djl.set_lhs(*[0,2,4,5]) djl.set_rhs(3,6) Index: ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb (working copy) @@ -8,96 +8,96 @@ menu_spec = [ [:menubutton, 'file', { :text=>'File', :menu=>[ - [:options, {:tearoff=>false}], + [:options, {:tearoff=>false}], [:command, 'new', { - :label=>'New', :helpstr=>'Open new document', + :label=>'New', :helpstr=>'Open new document', :command=>proc{puts 'NEW'} } - ], + ], [:command, 'close', { - :label=>'Close', :helpstr=>'Close current document', + :label=>'Close', :helpstr=>'Close current document', :command=>proc{puts 'CLOSE'} } - ], + ], - [:separator, 'sep1'], + [:separator, 'sep1'], [:command, 'exit', { - :label=>'Exit', :helpstr=>'Exit application', + :label=>'Exit', :helpstr=>'Exit application', :command=>proc{exit} } ] ] } - ], + ], [:menubutton, 'edit', { :text=>'Edit', :menu=>[ - [:options, {:tearoff=>false}], + [:options, {:tearoff=>false}], [:command, 'undo', { - :label=>'Undo', :underline=>0, - :helpstr=>'Undo last command', + :label=>'Undo', :underline=>0, + :helpstr=>'Undo last command', :command=>proc{puts 'UNDO'} } - ], + ], - [:separator, 'sep2'], + [:separator, 'sep2'], [:command, 'cut', { - :label=>'Cut', :underline=>1, - :helpstr=>'Cut selection to clipboard', + :label=>'Cut', :underline=>1, + :helpstr=>'Cut selection to clipboard', :command=>proc{puts 'CUT'} } - ], + ], [:command, 'copy', { - :label=>'Copy', :underline=>1, - :helpstr=>'Copy selection to clipboard', + :label=>'Copy', :underline=>1, + :helpstr=>'Copy selection to clipboard', :command=>proc{puts 'COPY'} } - ], + ], [:command, 'paste', { - :label=>'Paste', :underline=>0, - :helpstr=>'Paste clipboard contents', + :label=>'Paste', :underline=>0, + :helpstr=>'Paste clipboard contents', :command=>proc{puts 'PASTE'} } ] ] } - ], + ], [:menubutton, 'options', { :text=>'Options', :menu=>[ - [:options, {:tearoff=>false, :selectcolor=>'blue'}], + [:options, {:tearoff=>false, :selectcolor=>'blue'}], [:radiobutton, 'byName', { - :variable=>viewmode, :value=>'NAME', - :label=>'by Name', :helpstr=>'View files by name order', + :variable=>viewmode, :value=>'NAME', + :label=>'by Name', :helpstr=>'View files by name order', :command=>proc{puts 'NAME'} } - ], + ], [:radiobutton, 'byDate', { - :variable=>viewmode, :value=>'DATE', - :label=>'by Date', :helpstr=>'View files by date order', + :variable=>viewmode, :value=>'DATE', + :label=>'by Date', :helpstr=>'View files by date order', :command=>proc{puts 'DATE'} } - ], + ], [:cascade, 'prefs', { :label=>'Preferences', :menu=>[ [:command, 'colors', { - :label=>'Colors...', :helpstr=>'Change text colors', + :label=>'Colors...', :helpstr=>'Change text colors', :command=>proc{puts 'COLORS'} } - ], + ], [:command, 'fonts', { - :label=>'Fonts...', :helpstr=>'Change text font', + :label=>'Fonts...', :helpstr=>'Change text font', :command=>proc{puts 'COLORS'} } ] @@ -109,7 +109,7 @@ ] ] -#mb = Tk::Iwidgets::Menubar.new(:helpvariable=>helpvar, +#mb = Tk::Iwidgets::Menubar.new(:helpvariable=>helpvar, # :menubuttons=>menu_spec) mb = Tk::Iwidgets::Menubar.new(:helpvariable=>helpvar) mb.configure(:menubuttons=>menu_spec) Index: ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb (working copy) @@ -4,7 +4,7 @@ # Create the tabnotebook widget and pack it. tn = Tk::Iwidgets::Tabnotebook.new(:width=>300, :height=>100) -tn.pack(:anchor=>:nw, :fill=>:both, :expand=>true, +tn.pack(:anchor=>:nw, :fill=>:both, :expand=>true, :side=>:top, :padx=>10, :pady=>0) # Add two pages to the tabnotebook, Index: ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb (working copy) @@ -2,11 +2,11 @@ require 'tk' require 'tkextlib/iwidgets' -lw = Tk::Iwidgets::Labeledwidget.new(:labeltext=>'Canvas Widget', +lw = Tk::Iwidgets::Labeledwidget.new(:labeltext=>'Canvas Widget', :labelpos=>:s) lw.pack(:fill=>:both, :expand=>true, :padx=>10, :pady=>10) -cw = TkCanvas.new(lw.child_site, :relief=>:raised, :width=>200, :height=>200, +cw = TkCanvas.new(lw.child_site, :relief=>:raised, :width=>200, :height=>200, :borderwidth=>3, :background=>:white) cw.pack(:padx=>10, :pady=>10) Index: ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb (working copy) @@ -4,7 +4,7 @@ TkOption.add('*textBackground', 'white') -sh = Tk::Iwidgets::Scrolledhtml.new(:fontname=>'helvetica', +sh = Tk::Iwidgets::Scrolledhtml.new(:fontname=>'helvetica', :linkcommand=>proc{|href| sh.import_link(href) }) Index: ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/iwidgets' -Tk::Iwidgets::Fileselectionbox.new.pack(:padx=>10, :pady=>10, +Tk::Iwidgets::Fileselectionbox.new.pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true) Tk.mainloop Index: ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb (working copy) @@ -11,7 +11,7 @@ pw.pack(:fill=>:both, :expand=>true) pw.child_site_list.each{|pane| - TkButton.new(pane, :text=>pane.path, :relief=>:raised, + TkButton.new(pane, :text=>pane.path, :relief=>:raised, :borderwidth=>2).pack(:fill=>:both, :expand=>true) } Index: ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb (working copy) @@ -88,7 +88,7 @@ ########################################## -bmp_dir = File.join(File.dirname(File.expand_path(__FILE__)), +bmp_dir = File.join(File.dirname(File.expand_path(__FILE__)), '../catalog_demo/images') ########################################## @@ -102,16 +102,16 @@ ########################################## -tb.add(:button, :helpstr=>'Copy It', :image=>editcopy22, +tb.add(:button, :helpstr=>'Copy It', :image=>editcopy22, :balloonstr=>'Copy', :command=>proc{puts 'Copy It'}) -tb.add(:button, :helpstr=>'Cut It', :image=>editcut22, +tb.add(:button, :helpstr=>'Cut It', :image=>editcut22, :balloonstr=>'Cut', :command=>proc{puts 'Cut It'}) -tb.add(:button, :helpstr=>'Paste It', :image=>editpaste22, +tb.add(:button, :helpstr=>'Paste It', :image=>editpaste22, :balloonstr=>'Paste', :command=>proc{puts 'Paste It'}) -tb.add(:button, :helpstr=>'Delete It', :image=>editdelete22, +tb.add(:button, :helpstr=>'Delete It', :image=>editdelete22, :balloonstr=>'Delete', :command=>proc{puts 'Delete It'}) #-------------------------------- @@ -120,19 +120,19 @@ #-------------------------------- -tb.add(:radiobutton, :variable=>radio_var, :value=>'Box', - :bitmap=>"@#{bmp_dir}/box.xbm", - :helpstr=>'Radio Button #1', :balloonstr=>'Radio', +tb.add(:radiobutton, :variable=>radio_var, :value=>'Box', + :bitmap=>"@#{bmp_dir}/box.xbm", + :helpstr=>'Radio Button #1', :balloonstr=>'Radio', :command=>proc{puts 'Radio Button "Box"'}) -tb.add(:radiobutton, :variable=>radio_var, :value=>'Line', - :bitmap=>"@#{bmp_dir}/line.xbm", - :helpstr=>'Radio Button #2', :balloonstr=>'Radio', +tb.add(:radiobutton, :variable=>radio_var, :value=>'Line', + :bitmap=>"@#{bmp_dir}/line.xbm", + :helpstr=>'Radio Button #2', :balloonstr=>'Radio', :command=>proc{puts 'Radio Button "Line"'}) -tb.add(:radiobutton, :variable=>radio_var, :value=>'Oval', - :bitmap=>"@#{bmp_dir}/oval.xbm", - :helpstr=>'Radio Button #3', :balloonstr=>'Radio', +tb.add(:radiobutton, :variable=>radio_var, :value=>'Oval', + :bitmap=>"@#{bmp_dir}/oval.xbm", + :helpstr=>'Radio Button #3', :balloonstr=>'Radio', :command=>proc{puts 'Radio Button "Oval"'}) #-------------------------------- @@ -141,10 +141,10 @@ #-------------------------------- -tb.add(:checkbutton, :variable=>check_var1, :onvalue=>'yes', :offvalue=>'no', +tb.add(:checkbutton, :variable=>check_var1, :onvalue=>'yes', :offvalue=>'no', :image=>text22, :command=>proc{puts 'Checkbutton 1'}) -tb.add(:checkbutton, :variable=>check_var2, :onvalue=>'yes', :offvalue=>'no', +tb.add(:checkbutton, :variable=>check_var2, :onvalue=>'yes', :offvalue=>'no', :bitmap=>"@#{bmp_dir}/points.xbm", :command=>proc{puts 'Checkbutton 2'}) tb.pack(:side=>:top, :anchor=>:nw) Index: ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb (working copy) @@ -11,20 +11,20 @@ ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"}) -fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:', +fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:', :fixed=>10, :width=>12) -nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:', +nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:', :validate=>:numeric, :width=>12) -aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:', - :validate=>:alphabetic, :width=>12, +aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:', + :validate=>:alphabetic, :width=>12, :invalid=>proc{ puts "Alphabetic contents invalid" }) -pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12, - :show=>Tk::UTF8_String("\267"), +pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12, + :show=>Tk::UTF8_String("\267"), ## <=== utf8 character :command=>proc{puts "Return Pressed"}) Index: ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb (working copy) @@ -7,8 +7,8 @@ # # Standard question message dialog used for confirmation. # -md = Tk::Iwidgets::Messagedialog.new(:title=>'Message Dialog', - :text=>'Are you sure ? ', +md = Tk::Iwidgets::Messagedialog.new(:title=>'Message Dialog', + :text=>'Are you sure ? ', :bitmap=>'questhead', :modality=>:global) md.buttonconfigure('OK', :text=>'Yes') @@ -32,8 +32,8 @@ # bmp = '@' + File.join(File.dirname(File.expand_path(__FILE__)), '../catalog_demo/images/text.xbm') -cr = Tk::Iwidgets::Messagedialog.new(:title=>'Copyright', - :bitmap=>bmp, :imagepos=>:n, +cr = Tk::Iwidgets::Messagedialog.new(:title=>'Copyright', + :bitmap=>bmp, :imagepos=>:n, :text=>"Copyright 200x XXX Corporation\nAll rights reserved") cr.hide('Cancel') Index: ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb (working copy) @@ -13,19 +13,19 @@ ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"}) -fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:', +fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:', :fixed=>10, :width=>12) -nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:', +nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:', :validate=>:numeric, :width=>12) -aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:', - :validate=>:alphabetic, :width=>12, +aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:', + :validate=>:alphabetic, :width=>12, :invalid=>proc{ puts "Alphabetic contents invalid" }) -pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12, +pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12, :show=>"\267", ## <=== utf8 character :command=>proc{puts "Return Pressed"}) Index: ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb (working copy) @@ -4,7 +4,7 @@ mainloop = Thread.new{Tk.mainloop} -TkButton.new(:text=>'QUIT', +TkButton.new(:text=>'QUIT', :command=>proc{Tk.root.destroy}).pack(:padx=>10, :pady=>10) Tk::Iwidgets::Selectiondialog.new.activate Index: ext/tk/sample/tkextlib/iwidgets/sample/shell.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/shell.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/shell.rb (working copy) @@ -2,16 +2,16 @@ require 'tk' require 'tkextlib/iwidgets' -sh = Tk::Iwidgets::Shell.new(:modality=>:application, +sh = Tk::Iwidgets::Shell.new(:modality=>:application, :padx=>20, :pady=>20, :title=>'Shell') -TkButton.new(:text=>'ACTIVATE', :padx=>7, :pady=>7, +TkButton.new(:text=>'ACTIVATE', :padx=>7, :pady=>7, :command=>proc{puts sh.activate}).pack(:padx=>10, :pady=>10) TkLabel.new(sh.child_site, :text=>'SHELL').pack -TkButton.new(sh.child_site, :text=>'YES', +TkButton.new(sh.child_site, :text=>'YES', :command=>proc{sh.deactivate 'press YES'}).pack(:fill=>:x) -TkButton.new(sh.child_site, :text=>'NO', +TkButton.new(sh.child_site, :text=>'NO', :command=>proc{sh.deactivate 'press NO'}).pack(:fill=>:x) Tk.mainloop Index: ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb (working copy) @@ -4,7 +4,7 @@ # Create the tabnotebook widget and pack it. tn = Tk::Iwidgets::Tabnotebook.new(:width=>300, :height=>100) -tn.pack(:anchor=>:nw, :fill=>:both, :expand=>true, +tn.pack(:anchor=>:nw, :fill=>:both, :expand=>true, :side=>:left, :padx=>10, :pady=>10) # Add two pages to the tabnotebook, Index: ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb (working copy) @@ -2,8 +2,8 @@ require 'tk' require 'tkextlib/iwidgets' -Tk::Iwidgets::Pushbutton.new(:text=>'Hello', - :command=>proc{puts 'Hello World'}, +Tk::Iwidgets::Pushbutton.new(:text=>'Hello', + :command=>proc{puts 'Hello World'}, :defaultring=>true).pack(:padx=>10, :pady=>10) Tk.mainloop Index: ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb (working copy) @@ -4,55 +4,55 @@ mw = Tk::Iwidgets::Mainwindow.new -mw.menubar.add(:menubutton, 'file', :text=>'File', :underline=>0, +mw.menubar.add(:menubutton, 'file', :text=>'File', :underline=>0, :padx=>8, :pady=>2, :menu=>[ - [:options, {:tearoff=>false}], + [:options, {:tearoff=>false}], [:command, 'new', { - :label=>'New', :underline=>0, + :label=>'New', :underline=>0, :helpstr=>'Create a new file' } - ], + ], [:command, 'open', { - :label=>'Open ...', :underline=>0, + :label=>'Open ...', :underline=>0, :helpstr=>'Open an existing file' } - ], + ], [:command, 'save', { - :label=>'Save', :underline=>0, + :label=>'Save', :underline=>0, :helpstr=>'Save the current file' } - ], + ], [:command, 'saveas', { - :label=>'Save As', :underline=>5, + :label=>'Save As', :underline=>5, :helpstr=>'Save the file as a different name' } - ], + ], [:command, 'print', { - :label=>'Print', :underline=>0, + :label=>'Print', :underline=>0, :helpstr=>'Print the file' } - ], + ], - [:separator, 'sep1'], + [:separator, 'sep1'], [:command, 'close', { - :label=>'Close', :underline=>0, + :label=>'Close', :underline=>0, :helpstr=>'Close the file' } - ], + ], - [:separator, 'sep2'], + [:separator, 'sep2'], [:command, 'exit', { - :label=>'Exit', :underline=>1, + :label=>'Exit', :underline=>1, :helpstr=>'Exit this application' } - ], + ], nil ]) Index: ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb (working copy) @@ -2,9 +2,9 @@ require 'tk' require 'tkextlib/iwidgets' -mb = Tk::Iwidgets::Messagebox.new(:hscrollmode=>:dynamic, - :labeltext=>'Messages', :labelpos=>:n, - :height=>120, :width=>550, +mb = Tk::Iwidgets::Messagebox.new(:hscrollmode=>:dynamic, + :labeltext=>'Messages', :labelpos=>:n, + :height=>120, :width=>550, :savedir=>'/tmp', :textbackground=>'#d9d9d9') mb.pack(:padx=>5, :pady=>5, :fill=>:both, :expand=>true) Index: ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb (working copy) @@ -11,7 +11,7 @@ pw.pack(:fill=>:both, :expand=>true) pw.child_site_list.each{|pane| - TkButton.new(pane, :text=>pane.path, :relief=>:raised, + TkButton.new(pane, :text=>pane.path, :relief=>:raised, :borderwidth=>2).pack(:fill=>:both, :expand=>true) } Index: ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb (working copy) @@ -4,7 +4,7 @@ # Create the tabnotebook widget and pack it. nb = Tk::Iwidgets::Notebook.new(:width=>100, :height=>100) -nb.pack(:anchor=>:nw, :fill=>:both, :expand=>true, +nb.pack(:anchor=>:nw, :fill=>:both, :expand=>true, :side=>:left, :padx=>10, :pady=>10) # Add two pages to the tabnotebook, Index: ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/iwidgets' -sf = Tk::Iwidgets::Scrolledframe.new(:width=>150, :height=>180, +sf = Tk::Iwidgets::Scrolledframe.new(:width=>150, :height=>180, :labeltext=>'scrolledframe') cs = sf.child_site Index: ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb (working copy) @@ -4,7 +4,7 @@ TkOption.add('*textBackground', 'white') -Tk::Iwidgets::Spinint.new(:labeltext=>'Temperature', :labelpos=>:w, :width=>5, +Tk::Iwidgets::Spinint.new(:labeltext=>'Temperature', :labelpos=>:w, :width=>5, :fixed=>true, :range=>[32, 212]).pack(:pady=>10) Tk.mainloop Index: ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb (working copy) @@ -2,9 +2,9 @@ require 'tk' require 'tkextlib/iwidgets' -Tk::Iwidgets::Extbutton.new(:text=>'Bitmap example', :bitmap=>'info', - :background=>'bisque', :activeforeground=>'red', - :bitmapforeground=>'blue', :defaultring=>true, +Tk::Iwidgets::Extbutton.new(:text=>'Bitmap example', :bitmap=>'info', + :background=>'bisque', :activeforeground=>'red', + :bitmapforeground=>'blue', :defaultring=>true, :command=>proc{ puts "Bisque is beautiful" }).pack(:expand=>true) @@ -12,9 +12,9 @@ #img = TkPhotoImage.new(:file=>File.join(File.dirname(File.expand_path(__FILE__)), '../../../images/earthris.gif')) img = TkPhotoImage.new(:file=>File.join(File.dirname(File.expand_path(__FILE__)), '../catalog_demo/images/clear.gif')) -Tk::Iwidgets::Extbutton.new(:text=>'Image example', :relief=>:ridge, - :image=>img, :imagepos=>:e, :font=>'9x15bold', - :activebackground=>'lightyellow', +Tk::Iwidgets::Extbutton.new(:text=>'Image example', :relief=>:ridge, + :image=>img, :imagepos=>:e, :font=>'9x15bold', + :activebackground=>'lightyellow', :background=>'lightgreen').pack(:expand=>true) Tk.mainloop Index: ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/iwidgets' -om = Tk::Iwidgets::Optionmenu.new(:labelmargin=>5, :labelpos=>:w, +om = Tk::Iwidgets::Optionmenu.new(:labelmargin=>5, :labelpos=>:w, :labeltext=>"Operating System :") om.insert('end', 'Unix', 'VMS', 'Linux', 'OS/2', 'Windows NT', 'DOS') Index: ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb (working copy) @@ -4,12 +4,12 @@ TkOption.add('*textBackground', 'white') -sb = Tk::Iwidgets::Selectionbox.new.pack(:padx=>10, :pady=>10, +sb = Tk::Iwidgets::Selectionbox.new.pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true) sb.insert_items('end', *['Hello', 'Out There', 'World']) -TkLabel.new(sb.child_site, +TkLabel.new(sb.child_site, :text=>'Child Site is Here').pack(:fill=>:x, :padx=>10, :pady=>10) sb.insert_items(2, 'Cruel Cruel') Index: ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb (working copy) @@ -6,7 +6,7 @@ TkOption.add('*textBackground', 'white') -pd = Tk::Iwidgets::Promptdialog.new(:modality=>:global, :title=>'Password', +pd = Tk::Iwidgets::Promptdialog.new(:modality=>:global, :title=>'Password', :labeltext=>'Password:', :show=>'*') pd.hide('Apply') Index: ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb (working copy) @@ -4,7 +4,7 @@ # Create the tabnotebook widget and pack it. nb = Tk::Iwidgets::Notebook.new(:width=>100, :height=>100) -nb.pack(:anchor=>:nw, :fill=>:both, :expand=>true, +nb.pack(:anchor=>:nw, :fill=>:both, :expand=>true, :side=>:top, :padx=>10, :pady=>0) # Add two pages to the tabnotebook, Index: ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb (working copy) @@ -4,7 +4,11 @@ # set $KCODE to 'utf' for a utf8 charecter # ######################################################### -$KCODE='utf' +unless defined?(::Encoding.default_external) + $KCODE='utf' +else + DEFAULT_TK_ENCODING = 'UTF-8' +end require 'tk' require 'tkextlib/iwidgets' @@ -13,19 +17,19 @@ ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"}) -fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:', +fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:', :fixed=>10, :width=>12) -nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:', +nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:', :validate=>:numeric, :width=>12) -aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:', - :validate=>:alphabetic, :width=>12, +aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:', + :validate=>:alphabetic, :width=>12, :invalid=>proc{ puts "Alphabetic contents invalid" }) -pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12, +pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12, :show=>"\267", ## <=== utf8 character :command=>proc{puts "Return Pressed"}) Index: ext/tk/sample/tkextlib/iwidgets/sample/watch.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/watch.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/watch.rb (working copy) @@ -8,7 +8,7 @@ trap('INT', 'DEFAULT') } -Tk::Iwidgets::Watch.new(:state=>:disabled, :showampm=>:no, +Tk::Iwidgets::Watch.new(:state=>:disabled, :showampm=>:no, :width=>155, :height=>155){|w| w.pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true) # TkTimer.new(1000, -1, proc{w.show; Tk.update}).start Index: ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb (working copy) @@ -5,11 +5,11 @@ # # Non-editable Dropdown Combobox # -cb1 = Tk::Iwidgets::Combobox.new(:labeltext=>'Month:', +cb1 = Tk::Iwidgets::Combobox.new(:labeltext=>'Month:', :selectioncommand=>proc{ puts(cb1.get_curselection) - }, - :editable=>false, :listheight=>185, + }, + :editable=>false, :listheight=>185, :popupcursor=>'hand1') cb1.insert_list('end', *%w(Jan Feb Mar Apr May June Jul Aug Sept Oct Nov Dec)) @@ -18,7 +18,7 @@ # # Editable Dropdown Combobox # -cb2 = Tk::Iwidgets::Combobox.new(:labeltext=>'Operating System:', +cb2 = Tk::Iwidgets::Combobox.new(:labeltext=>'Operating System:', :selectioncommand=>proc{ puts(cb2.get_curselection) }) Index: ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb (working copy) @@ -2,9 +2,9 @@ require 'tk' require 'tkextlib/iwidgets' -Tk::Iwidgets::Calendar.new(:command=>proc{|arg| puts(arg.date)}, - :weekendbackground=>'mistyrose', - :weekdaybackground=>'ghostwhite', - :outline=>'black', :startday=>'wednesday', +Tk::Iwidgets::Calendar.new(:command=>proc{|arg| puts(arg.date)}, + :weekendbackground=>'mistyrose', + :weekdaybackground=>'ghostwhite', + :outline=>'black', :startday=>'wednesday', :days=>%w(We Th Fr Sa Su Mo Tu)).pack Tk.mainloop Index: ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb (working copy) @@ -9,13 +9,13 @@ mb.menubuttons = [ [:menubutton, 'file', { :text=>'File', :menu=>[ - [:command, 'new', {:label=>'New'}], - [:command, 'close', {:label=>'Close'}], - [:separator, 'sep1'], + [:command, 'new', {:label=>'New'}], + [:command, 'close', {:label=>'Close'}], + [:separator, 'sep1'], [:command, 'quit', {:label=>'Quit'}] ] } - ], + ], [:menubutton, 'edit', {:text=>'Edit'}] ] @@ -28,14 +28,14 @@ mb.add(:menubutton, '.options', :text=>'Options', :menu=>[ [:radiobutton, 'byName', { :variable=>viewmode, :value=>'NAME', :label=>'by Name'} - ], + ], [:radiobutton, 'byDate', { :variable=>viewmode, :value=>'DATE', :label=>'by Date'} ] ]) mb.add(:cascade, '.options.prefs', :label=>'Preferences', :menu=>[ - [:command, 'colors', {:label=>'Colors...'}], + [:command, 'colors', {:label=>'Colors...'}], [:command, 'fonts', {:label=>'Fonts...'}] ]) Index: ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb (working copy) @@ -4,13 +4,13 @@ TkOption.add('*textBackground', 'white') -slb = Tk::Iwidgets::Scrolledlistbox.new(:selectmode=>:single, +slb = Tk::Iwidgets::Scrolledlistbox.new(:selectmode=>:single, :vscrollmode=>:static, :hscrollmode=>:dynamic, - :labeltext=>'List', + :labeltext=>'List', :selectioncommand=>proc{ puts(slb.get_curselection) - }, + }, :dblclickcommand=>proc{ puts('Double Click') puts(slb.get_curselection) Index: ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb =================================================================== --- ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb (revision 23917) +++ ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/iwidgets' -st = Tk::Iwidgets::Scrolledtext.new(:hscrollmode=>:dynamic, :wrap=>:none, +st = Tk::Iwidgets::Scrolledtext.new(:hscrollmode=>:dynamic, :wrap=>:none, :labeltext=>'Password File') st.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10) Index: ext/tk/sample/tkextlib/blt/winop1.rb =================================================================== --- ext/tk/sample/tkextlib/blt/winop1.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/winop1.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/blt' -file = File.join(File.dirname(File.expand_path(__FILE__)), +file = File.join(File.dirname(File.expand_path(__FILE__)), 'images', 'sample.gif') if File.exist?(file) src = TkPhotoImage.new(:file=>file) @@ -30,9 +30,9 @@ l_hdr = TkLabel.new(:text=>"#{iw} x #{ih}") l_ftr = TkLabel.new(:text=>"#{r}%") l_img = TkLabel.new(:image=>dst) - Tk::BLT::Table.add(Tk.root, - [0,i], l_hdr, - [1,i], l_img, + Tk::BLT::Table.add(Tk.root, + [0,i], l_hdr, + [1,i], l_img, [2,i], l_ftr) Tk.update } Index: ext/tk/sample/tkextlib/blt/winop2.rb =================================================================== --- ext/tk/sample/tkextlib/blt/winop2.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/winop2.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/blt' -file = File.join(File.dirname(File.expand_path(__FILE__)), +file = File.join(File.dirname(File.expand_path(__FILE__)), 'images', 'qv100.t.gif') if File.exist?(file) src = TkPhotoImage.new(:file=>file) Index: ext/tk/sample/tkextlib/blt/graph6.rb =================================================================== --- ext/tk/sample/tkextlib/blt/graph6.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/graph6.rb (working copy) @@ -6,55 +6,55 @@ Tk::TCL_PRECISION.value = 15 [ - ['*Graph.Width', '10i'], - ['*Graph.leftMargin', '.75i'], - ['*Graph.Height', '6i'], - ['*Graph.plotBackground', 'black'], - ['*LineMarker.color', 'white'], - ['*LineMarker.Dashes', 5], - ['*TextMarker.foreground', 'white'], - ['*TextMarker.Background', ''], + ['*Graph.Width', '10i'], + ['*Graph.leftMargin', '.75i'], + ['*Graph.Height', '6i'], + ['*Graph.plotBackground', 'black'], + ['*LineMarker.color', 'white'], + ['*LineMarker.Dashes', 5], + ['*TextMarker.foreground', 'white'], + ['*TextMarker.Background', ''], - ['*Graph.x.hide', true], - ['*Graph.x.title', ''], - ['*Graph.y.rotate', 90], - # ['*Graph.y.stepSize', 2.0], - ['*Graph.title', ''], - ['*graph.Title', 'Example s27'], - ['*graph.x.hide', false], - ['*graph.topMargin', 0], - ['*graph.bottomMargin', 0], - ['*x.Title', 'Time'], - ['*y.Title', 'Signals'], - ['*Pixels', 1], + ['*Graph.x.hide', true], + ['*Graph.x.title', ''], + ['*Graph.y.rotate', 90], + # ['*Graph.y.stepSize', 2.0], + ['*Graph.title', ''], + ['*graph.Title', 'Example s27'], + ['*graph.x.hide', false], + ['*graph.topMargin', 0], + ['*graph.bottomMargin', 0], + ['*x.Title', 'Time'], + ['*y.Title', 'Signals'], + ['*Pixels', 1], - ['*Reduce', 0.5], - ['*bufferElements', false], + ['*Reduce', 0.5], + ['*bufferElements', false], - ['*Element.color', 'green4'], - ['*Element.ScaleSymbols', true], - ['*Element.Color', 'grey70'], - ['*Element.Symbol', :none], - ['*Element.LineWidth', 1], - # ['*Element.Smooth', :natural], - ['*Element.Smooth', :catrom], + ['*Element.color', 'green4'], + ['*Element.ScaleSymbols', true], + ['*Element.Color', 'grey70'], + ['*Element.Symbol', :none], + ['*Element.LineWidth', 1], + # ['*Element.Smooth', :natural], + ['*Element.Smooth', :catrom], - ['*activeLine.LineWidth', 2], - ['*activeLine.Color', 'white'], - ['*activeLine.Color', 'green1'], + ['*activeLine.LineWidth', 2], + ['*activeLine.Color', 'white'], + ['*activeLine.Color', 'green1'], - # ['*Legend.Hide', true], - ['*Legend.Position', :right], - ['*Legend.Relief', :flat], - ['*Legend.activeRelief', :sunken], - ['*Legend.borderWidth', 2], - #['*Legend.Font', '-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*'], - ['*Legend.Font', 'Helvetica -10'], - ['*Grid.hide', false], - ['*Grid.dashes', [1, 5]], + # ['*Legend.Hide', true], + ['*Legend.Position', :right], + ['*Legend.Relief', :flat], + ['*Legend.activeRelief', :sunken], + ['*Legend.borderWidth', 2], + #['*Legend.Font', '-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*'], + ['*Legend.Font', 'Helvetica -10'], + ['*Grid.hide', false], + ['*Grid.dashes', [1, 5]], - # ['*foreground', 'white'], - ['*zoomOutline.outline', 'yellow'], + # ['*foreground', 'white'], + ['*zoomOutline.outline', 'yellow'], ].each{|k, v| TkOption.add(k, v)} ############################## @@ -71,7 +71,7 @@ @top = Tk::BLT::Tile::Toplevel.new =begin - legend = Tk::BLT::Graph.new(@top, :widgetname=>'legend', + legend = Tk::BLT::Graph.new(@top, :widgetname=>'legend', :without_creating=>true) @graph.legend_configure(:position=>legend) =end @@ -81,7 +81,7 @@ Tk::BLT::Table.add(@root, @graph, [0,0], :fill=>:both) - @quit_btn = Tk::BLT::Tile::Button.new(:text=>' quit ', :background=>'red', + @quit_btn = Tk::BLT::Tile::Button.new(:text=>' quit ', :background=>'red', :command=>proc{exit}) Tk::BLT::Table.add(@root, @quit_btn, [1,0], :anchor=>:e, :padx=>10) @@ -90,9 +90,9 @@ @graph.closest_point @graph.print_key - @graph.legend_bind(:all, 'ButtonRelease-1', + @graph.legend_bind(:all, 'ButtonRelease-1', proc{|w| highlightTrace(w)}, '%W') - @graph.legend_bind(:all, 'ButtonRelease-3', + @graph.legend_bind(:all, 'ButtonRelease-3', proc{|w| w.legend_deactivate('*') active = w.element_activate @@ -108,2098 +108,2098 @@ (1..39).each{|i| @v[i] = Tk::BLT::Vector.new(:variable=>'')} @x.set(<<-'EOD') - 0 1e-10 2e-10 3e-10 4e-10 5e-10 6e-10 7e-10 8e-10 9e-10 - 1e-09 1.1e-09 1.2e-09 1.3e-09 1.4e-09 1.5e-09 1.6e-09 1.7e-09 - 1.8e-09 1.9e-09 2e-09 2.1e-09 2.2e-09 2.3e-09 2.4e-09 2.5e-09 - 2.6e-09 2.7e-09 2.8e-09 2.9e-09 3e-09 3.1e-09 3.2e-09 3.3e-09 - 3.4e-09 3.5e-09 3.6e-09 3.7e-09 3.8e-09 3.9e-09 4e-09 4.1e-09 - 4.2e-09 4.3e-09 4.4e-09 4.5e-09 4.6e-09 4.7e-09 4.8e-09 - 4.9e-09 5e-09 5.1e-09 5.2e-09 5.3e-09 5.4e-09 5.5e-09 5.6e-09 - 5.7e-09 5.8e-09 5.9e-09 6e-09 6.1e-09 6.2e-09 6.3e-09 6.4e-09 - 6.5e-09 6.6e-09 6.7e-09 6.8e-09 6.9e-09 7e-09 7.1e-09 7.2e-09 - 7.3e-09 7.4e-09 7.5e-09 7.6e-09 7.7e-09 7.8e-09 7.9e-09 - 8e-09 8.1e-09 8.2e-09 8.3e-09 8.4e-09 8.5e-09 8.6e-09 8.7e-09 - 8.8e-09 8.9e-09 9e-09 9.1e-09 9.2e-09 9.3e-09 9.4e-09 9.5e-09 - 9.6e-09 9.7e-09 9.8e-09 9.9e-09 1e-08 1.01e-08 1.02e-08 - 1.03e-08 1.04e-08 1.05e-08 1.06e-08 1.07e-08 1.08e-08 1.09e-08 - 1.1e-08 1.11e-08 1.12e-08 1.13e-08 1.14e-08 1.15e-08 1.16e-08 - 1.17e-08 1.18e-08 1.19e-08 1.2e-08 1.21e-08 1.22e-08 1.23e-08 - 1.24e-08 1.25e-08 1.26e-08 1.27e-08 1.28e-08 1.29e-08 1.3e-08 - 1.31e-08 1.32e-08 1.33e-08 1.34e-08 1.35e-08 1.36e-08 1.37e-08 - 1.38e-08 1.39e-08 1.4e-08 1.41e-08 1.42e-08 1.43e-08 1.44e-08 - 1.45e-08 1.46e-08 1.47e-08 1.48e-08 1.49e-08 1.5e-08 1.51e-08 - 1.52e-08 1.53e-08 1.54e-08 1.55e-08 1.56e-08 1.57e-08 1.58e-08 - 1.59e-08 1.6e-08 1.61e-08 1.62e-08 1.63e-08 1.64e-08 1.65e-08 - 1.66e-08 1.67e-08 1.68e-08 1.69e-08 1.7e-08 1.71e-08 1.72e-08 - 1.73e-08 1.74e-08 1.75e-08 1.76e-08 1.77e-08 1.78e-08 1.79e-08 - 1.8e-08 1.81e-08 1.82e-08 1.83e-08 1.84e-08 1.85e-08 1.86e-08 - 1.87e-08 1.88e-08 1.89e-08 1.9e-08 1.91e-08 1.92e-08 1.93e-08 - 1.94e-08 1.95e-08 1.96e-08 1.97e-08 1.98e-08 1.99e-08 2e-08 - 2.01e-08 2.02e-08 2.03e-08 2.04e-08 2.05e-08 2.06e-08 2.07e-08 - 2.08e-08 2.09e-08 2.1e-08 2.11e-08 2.12e-08 2.13e-08 2.14e-08 - 2.15e-08 2.16e-08 2.17e-08 2.18e-08 2.19e-08 2.2e-08 2.21e-08 - 2.22e-08 2.23e-08 2.24e-08 2.25e-08 2.26e-08 2.27e-08 2.28e-08 - 2.29e-08 2.3e-08 2.31e-08 2.32e-08 2.33e-08 2.34e-08 2.35e-08 - 2.36e-08 2.37e-08 2.38e-08 2.39e-08 2.4e-08 2.41e-08 2.42e-08 - 2.43e-08 2.44e-08 2.45e-08 2.46e-08 2.47e-08 2.48e-08 2.49e-08 - 2.5e-08 2.51e-08 2.52e-08 2.53e-08 2.54e-08 2.55e-08 2.56e-08 - 2.57e-08 2.58e-08 2.59e-08 2.6e-08 2.61e-08 2.62e-08 2.63e-08 - 2.64e-08 2.65e-08 2.66e-08 2.67e-08 2.68e-08 2.69e-08 2.7e-08 - 2.71e-08 2.72e-08 2.73e-08 2.74e-08 2.75e-08 2.76e-08 2.77e-08 - 2.78e-08 2.79e-08 2.8e-08 2.81e-08 2.82e-08 2.83e-08 2.84e-08 - 2.85e-08 2.86e-08 2.87e-08 2.88e-08 2.89e-08 2.9e-08 2.91e-08 - 2.92e-08 2.93e-08 2.94e-08 2.95e-08 2.96e-08 2.97e-08 2.98e-08 - 2.99e-08 3e-08 3.01e-08 3.02e-08 3.03e-08 3.04e-08 3.05e-08 - 3.06e-08 3.07e-08 3.08e-08 3.09e-08 3.1e-08 3.11e-08 3.12e-08 - 3.13e-08 3.14e-08 3.15e-08 3.16e-08 3.17e-08 3.18e-08 3.19e-08 - 3.2e-08 3.21e-08 3.22e-08 3.23e-08 3.24e-08 3.25e-08 3.26e-08 - 3.27e-08 3.28e-08 3.29e-08 3.3e-08 3.31e-08 3.32e-08 3.33e-08 - 3.34e-08 3.35e-08 3.36e-08 3.37e-08 3.38e-08 3.39e-08 3.4e-08 - 3.41e-08 3.42e-08 3.43e-08 3.44e-08 3.45e-08 3.46e-08 3.47e-08 - 3.48e-08 3.49e-08 3.5e-08 3.51e-08 3.52e-08 3.53e-08 3.54e-08 - 3.55e-08 3.56e-08 3.57e-08 3.58e-08 3.59e-08 3.6e-08 + 0 1e-10 2e-10 3e-10 4e-10 5e-10 6e-10 7e-10 8e-10 9e-10 + 1e-09 1.1e-09 1.2e-09 1.3e-09 1.4e-09 1.5e-09 1.6e-09 1.7e-09 + 1.8e-09 1.9e-09 2e-09 2.1e-09 2.2e-09 2.3e-09 2.4e-09 2.5e-09 + 2.6e-09 2.7e-09 2.8e-09 2.9e-09 3e-09 3.1e-09 3.2e-09 3.3e-09 + 3.4e-09 3.5e-09 3.6e-09 3.7e-09 3.8e-09 3.9e-09 4e-09 4.1e-09 + 4.2e-09 4.3e-09 4.4e-09 4.5e-09 4.6e-09 4.7e-09 4.8e-09 + 4.9e-09 5e-09 5.1e-09 5.2e-09 5.3e-09 5.4e-09 5.5e-09 5.6e-09 + 5.7e-09 5.8e-09 5.9e-09 6e-09 6.1e-09 6.2e-09 6.3e-09 6.4e-09 + 6.5e-09 6.6e-09 6.7e-09 6.8e-09 6.9e-09 7e-09 7.1e-09 7.2e-09 + 7.3e-09 7.4e-09 7.5e-09 7.6e-09 7.7e-09 7.8e-09 7.9e-09 + 8e-09 8.1e-09 8.2e-09 8.3e-09 8.4e-09 8.5e-09 8.6e-09 8.7e-09 + 8.8e-09 8.9e-09 9e-09 9.1e-09 9.2e-09 9.3e-09 9.4e-09 9.5e-09 + 9.6e-09 9.7e-09 9.8e-09 9.9e-09 1e-08 1.01e-08 1.02e-08 + 1.03e-08 1.04e-08 1.05e-08 1.06e-08 1.07e-08 1.08e-08 1.09e-08 + 1.1e-08 1.11e-08 1.12e-08 1.13e-08 1.14e-08 1.15e-08 1.16e-08 + 1.17e-08 1.18e-08 1.19e-08 1.2e-08 1.21e-08 1.22e-08 1.23e-08 + 1.24e-08 1.25e-08 1.26e-08 1.27e-08 1.28e-08 1.29e-08 1.3e-08 + 1.31e-08 1.32e-08 1.33e-08 1.34e-08 1.35e-08 1.36e-08 1.37e-08 + 1.38e-08 1.39e-08 1.4e-08 1.41e-08 1.42e-08 1.43e-08 1.44e-08 + 1.45e-08 1.46e-08 1.47e-08 1.48e-08 1.49e-08 1.5e-08 1.51e-08 + 1.52e-08 1.53e-08 1.54e-08 1.55e-08 1.56e-08 1.57e-08 1.58e-08 + 1.59e-08 1.6e-08 1.61e-08 1.62e-08 1.63e-08 1.64e-08 1.65e-08 + 1.66e-08 1.67e-08 1.68e-08 1.69e-08 1.7e-08 1.71e-08 1.72e-08 + 1.73e-08 1.74e-08 1.75e-08 1.76e-08 1.77e-08 1.78e-08 1.79e-08 + 1.8e-08 1.81e-08 1.82e-08 1.83e-08 1.84e-08 1.85e-08 1.86e-08 + 1.87e-08 1.88e-08 1.89e-08 1.9e-08 1.91e-08 1.92e-08 1.93e-08 + 1.94e-08 1.95e-08 1.96e-08 1.97e-08 1.98e-08 1.99e-08 2e-08 + 2.01e-08 2.02e-08 2.03e-08 2.04e-08 2.05e-08 2.06e-08 2.07e-08 + 2.08e-08 2.09e-08 2.1e-08 2.11e-08 2.12e-08 2.13e-08 2.14e-08 + 2.15e-08 2.16e-08 2.17e-08 2.18e-08 2.19e-08 2.2e-08 2.21e-08 + 2.22e-08 2.23e-08 2.24e-08 2.25e-08 2.26e-08 2.27e-08 2.28e-08 + 2.29e-08 2.3e-08 2.31e-08 2.32e-08 2.33e-08 2.34e-08 2.35e-08 + 2.36e-08 2.37e-08 2.38e-08 2.39e-08 2.4e-08 2.41e-08 2.42e-08 + 2.43e-08 2.44e-08 2.45e-08 2.46e-08 2.47e-08 2.48e-08 2.49e-08 + 2.5e-08 2.51e-08 2.52e-08 2.53e-08 2.54e-08 2.55e-08 2.56e-08 + 2.57e-08 2.58e-08 2.59e-08 2.6e-08 2.61e-08 2.62e-08 2.63e-08 + 2.64e-08 2.65e-08 2.66e-08 2.67e-08 2.68e-08 2.69e-08 2.7e-08 + 2.71e-08 2.72e-08 2.73e-08 2.74e-08 2.75e-08 2.76e-08 2.77e-08 + 2.78e-08 2.79e-08 2.8e-08 2.81e-08 2.82e-08 2.83e-08 2.84e-08 + 2.85e-08 2.86e-08 2.87e-08 2.88e-08 2.89e-08 2.9e-08 2.91e-08 + 2.92e-08 2.93e-08 2.94e-08 2.95e-08 2.96e-08 2.97e-08 2.98e-08 + 2.99e-08 3e-08 3.01e-08 3.02e-08 3.03e-08 3.04e-08 3.05e-08 + 3.06e-08 3.07e-08 3.08e-08 3.09e-08 3.1e-08 3.11e-08 3.12e-08 + 3.13e-08 3.14e-08 3.15e-08 3.16e-08 3.17e-08 3.18e-08 3.19e-08 + 3.2e-08 3.21e-08 3.22e-08 3.23e-08 3.24e-08 3.25e-08 3.26e-08 + 3.27e-08 3.28e-08 3.29e-08 3.3e-08 3.31e-08 3.32e-08 3.33e-08 + 3.34e-08 3.35e-08 3.36e-08 3.37e-08 3.38e-08 3.39e-08 3.4e-08 + 3.41e-08 3.42e-08 3.43e-08 3.44e-08 3.45e-08 3.46e-08 3.47e-08 + 3.48e-08 3.49e-08 3.5e-08 3.51e-08 3.52e-08 3.53e-08 3.54e-08 + 3.55e-08 3.56e-08 3.57e-08 3.58e-08 3.59e-08 3.6e-08 EOD @v[1].set(<<-'EOD') - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 EOD @v[2].set(<<-'EOD') - 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 - 5.32907e-15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 - 5 5 5 5 5 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 + 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 + 5.32907e-15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 + 5 5 5 5 5 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 EOD @v[3].set(<<-'EOD') - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 8.88178e-16 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 2.13718e-14 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 8.88178e-16 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 2.13718e-14 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 EOD @v[4].set(<<-'EOD') - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 EOD @v[5].set(<<-'EOD') - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 EOD @v[6].set(<<-'EOD') - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 8.88178e-16 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 2.13718e-14 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 8.88178e-16 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 2.13718e-14 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 EOD @v[7].set(<<-'EOD') - 5 5.16904 4.84159 3.34542 0.317102 0.103304 0.0275721 0.0221534 - 0.017689 0.0142639 0.0113974 0.00918238 0.00742541 0.00616602 - 0.00481195 0.00397049 -0.0659889 -0.025671 0.165495 0.986891 - 3.05229 4.55511 4.91611 4.98192 4.99428 4.99833 4.99095 - 4.97295 4.95493 4.93428 4.90723 4.94799 4.98584 4.99566 - 4.99813 4.99907 4.99947 4.99965 4.99976 4.99984 4.99989 - 4.99992 4.99994 4.99996 4.99998 5.00002 5.00006 5.00002 - 4.99996 4.99994 4.99999 5.00003 5.00002 5 4.99997 4.99997 - 4.99997 4.99997 4.99997 4.99996 4.99997 4.99997 4.99998 - 4.99998 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99998 4.99998 4.99998 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.16575 - 4.69986 2.43862 0.0230224 0.035229 -0.0210607 -0.0292766 - -0.0172693 -0.00271479 -0.000912251 -0.000349106 -0.000116866 - -4.24733e-05 -1.39536e-05 -3.01179e-05 -0.0657192 -0.0204835 - 0.183378 1.07181 3.118 4.46472 4.84158 4.94795 4.98173 4.99236 - 4.99762 5.01939 5.0433 5.05332 5.04959 5.03955 5.02851 5.02052 - 5.01422 5.00965 5.00631 5.00405 5.00248 5.00083 5.00012 - 5.00209 5.00387 5.00347 4.99917 4.99213 4.98411 4.97521 - 4.96332 4.94601 4.9304 4.94633 4.97936 4.99264 4.99685 4.99857 - 4.99925 4.99954 4.9997 4.99973 4.9997 4.99973 4.99979 4.99983 - 4.99986 4.99988 4.9999 4.9999 4.99992 4.99993 4.99994 4.99995 - 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 - 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 5 5 5.14242 4.76101 3.16003 0.299374 - 0.0645506 -0.000498424 -2.45108e-05 -2.27986e-05 -5.24401e-05 - -4.9884e-05 -4.92491e-05 -2.93354e-05 -3.21402e-05 -2.11851e-05 - -3.37925e-05 -0.0657892 -0.020563 0.182582 1.06058 3.12484 - 4.46552 4.84146 4.95102 4.98556 4.99472 4.99806 4.99909 - 4.99955 4.99976 4.99994 4.99992 5.00029 4.99967 4.99849 - 4.99736 4.99884 5.00099 5.00377 5.00215 4.99994 4.99893 - 4.99788 4.99862 5.00055 5.00134 5.00127 5.00073 5.00039 - 5.00018 5.00006 5.00001 4.99985 5.00026 5.00018 5.00003 - 4.99981 4.99985 4.99987 4.99985 4.99982 4.99982 4.99982 - 4.99983 4.99985 4.99987 4.99989 4.99991 4.99992 4.99994 - 4.99995 4.99995 4.99994 4.99994 4.99996 4.99999 5.00002 - 5.00008 5.00009 5.00006 5.00001 5 4.99999 4.99998 4.99997 - 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999 - 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998 4.99998 - 4.99998 + 5 5.16904 4.84159 3.34542 0.317102 0.103304 0.0275721 0.0221534 + 0.017689 0.0142639 0.0113974 0.00918238 0.00742541 0.00616602 + 0.00481195 0.00397049 -0.0659889 -0.025671 0.165495 0.986891 + 3.05229 4.55511 4.91611 4.98192 4.99428 4.99833 4.99095 + 4.97295 4.95493 4.93428 4.90723 4.94799 4.98584 4.99566 + 4.99813 4.99907 4.99947 4.99965 4.99976 4.99984 4.99989 + 4.99992 4.99994 4.99996 4.99998 5.00002 5.00006 5.00002 + 4.99996 4.99994 4.99999 5.00003 5.00002 5 4.99997 4.99997 + 4.99997 4.99997 4.99997 4.99996 4.99997 4.99997 4.99998 + 4.99998 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99998 4.99998 4.99998 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.16575 + 4.69986 2.43862 0.0230224 0.035229 -0.0210607 -0.0292766 + -0.0172693 -0.00271479 -0.000912251 -0.000349106 -0.000116866 + -4.24733e-05 -1.39536e-05 -3.01179e-05 -0.0657192 -0.0204835 + 0.183378 1.07181 3.118 4.46472 4.84158 4.94795 4.98173 4.99236 + 4.99762 5.01939 5.0433 5.05332 5.04959 5.03955 5.02851 5.02052 + 5.01422 5.00965 5.00631 5.00405 5.00248 5.00083 5.00012 + 5.00209 5.00387 5.00347 4.99917 4.99213 4.98411 4.97521 + 4.96332 4.94601 4.9304 4.94633 4.97936 4.99264 4.99685 4.99857 + 4.99925 4.99954 4.9997 4.99973 4.9997 4.99973 4.99979 4.99983 + 4.99986 4.99988 4.9999 4.9999 4.99992 4.99993 4.99994 4.99995 + 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 + 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 5 5 5.14242 4.76101 3.16003 0.299374 + 0.0645506 -0.000498424 -2.45108e-05 -2.27986e-05 -5.24401e-05 + -4.9884e-05 -4.92491e-05 -2.93354e-05 -3.21402e-05 -2.11851e-05 + -3.37925e-05 -0.0657892 -0.020563 0.182582 1.06058 3.12484 + 4.46552 4.84146 4.95102 4.98556 4.99472 4.99806 4.99909 + 4.99955 4.99976 4.99994 4.99992 5.00029 4.99967 4.99849 + 4.99736 4.99884 5.00099 5.00377 5.00215 4.99994 4.99893 + 4.99788 4.99862 5.00055 5.00134 5.00127 5.00073 5.00039 + 5.00018 5.00006 5.00001 4.99985 5.00026 5.00018 5.00003 + 4.99981 4.99985 4.99987 4.99985 4.99982 4.99982 4.99982 + 4.99983 4.99985 4.99987 4.99989 4.99991 4.99992 4.99994 + 4.99995 4.99995 4.99994 4.99994 4.99996 4.99999 5.00002 + 5.00008 5.00009 5.00006 5.00001 5 4.99999 4.99998 4.99997 + 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999 + 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998 4.99998 + 4.99998 EOD @v[8].set(<<-'EOD') - 5 5.03758 5.04711 4.96911 4.20882 3.96295 4.01117 4.15521 - 4.2967 4.42274 4.5295 4.6176 4.69014 4.74831 4.7966 4.83537 - 4.80526 4.787 4.79295 4.88588 5.08978 5.15615 5.10778 5.07718 - 5.06652 5.08225 4.9744 4.52977 3.77452 2.69426 1.15294 0.245509 - 0.0981544 0.0567527 0.0367487 0.0252578 0.0180599 0.0133837 - 0.0101497 0.0078616 0.00620186 0.00499056 0.0041027 0.00344223 - 0.00295808 0.00260089 0.00229887 0.00200817 0.00176397 0.00160116 - 0.00147381 0.00134645 0.00125029 0.00116043 0.00107371 0.00101981 - 0.000965921 0.000912028 0.000858135 0.000804242 0.000761669 - 0.00072672 0.000691771 0.000656823 0.000621874 0.000588722 - 0.00057041 0.000552098 0.000533785 0.000515473 0.000497162 - 0.00047885 0.000460537 0.000442226 0.000423914 0.000405601 - 0.000388399 0.000378694 0.000368989 0.000359284 0.00034958 - 0.000339875 0.00033017 0.000320465 0.00031076 0.000301055 - 0.00029135 0.000282207 0.000276247 0.000270287 0.000264327 - 0.000258367 0.000252407 0.000246447 0.000240487 0.000234527 - 0.000228567 0.000222607 0.000217086 0.000213696 0.000210307 - 0.000206918 0.000203528 0.000200139 0.00019675 0.00019336 - 0.000189971 0.000186582 0.000183192 0.000179803 0.000176414 - 0.000173025 0.000169635 0.000166246 0.000162857 0.000159467 - 0.000156078 0.000152689 0.000149299 0.00014591 0.00014255 - 0.0316021 0.163272 0.348732 0.603651 0.35745 0.135965 0.0707354 - 0.0314595 0.0201047 0.00994945 0.00389601 0.00138839 0.00060778 - 0.000329648 0.000492396 -0.0732035 -0.0844077 -0.0789062 - -0.0390837 0.0197559 0.0183094 -0.00180099 -0.0189565 -0.0424144 - -0.0735904 -0.0892423 0.285039 1.13702 2.10809 2.95826 3.60164 - 4.0435 4.35771 4.57254 4.71769 4.81329 4.87534 4.91487 4.94264 - 4.97375 5.01526 5.06517 5.10154 5.06259 4.89005 4.5787 4.12226 - 3.46151 2.49023 1.2586 0.32725 0.116753 0.0701865 0.0455509 - 0.0286914 0.0178176 0.0117599 0.00902715 0.00760583 0.00637745 - 0.00543811 0.00439377 0.00352448 0.0030151 0.00285771 0.002465 - 0.00203114 0.00173004 0.0014839 0.00125177 0.00105327 0.000894905 - 0.000766372 0.000658894 0.000569105 0.000492114 0.000427938 - 0.000370217 0.000314758 0.000266569 0.000233726 0.000209048 - 0.000191957 0.000177169 0.000166604 0.000161 0.000157314 - 0.000143828 0.000130342 0.000116857 0.000103371 8.98855e-05 - 7.63998e-05 6.29141e-05 5.76583e-05 5.30027e-05 4.8347e-05 - 4.36913e-05 3.90357e-05 3.438e-05 2.97243e-05 2.72507e-05 - 2.59083e-05 2.45659e-05 2.32235e-05 2.18811e-05 2.05387e-05 - 1.91963e-05 1.78539e-05 1.65115e-05 1.51691e-05 1.38267e-05 - 1.24843e-05 1.11419e-05 9.79954e-06 8.51574e-06 7.69807e-06 - 6.8804e-06 6.06273e-06 5.24506e-06 0.0287318 0.0317111 -0.0320087 - -0.103609 0.0369639 0.0121128 0.00961197 0.00934971 0.00820853 - 0.00699769 0.00607002 0.00535541 0.00476552 0.00427601 0.00376357 - -0.073012 -0.0866964 -0.0809538 -0.038005 0.0277001 0.0188906 - 0.00614597 0.00373629 0.00489787 0.0146573 0.0191052 0.0151708 - 0.0124224 0.0105859 0.00879272 0.00729464 0.0070047 0.00449575 - -0.00626652 -0.0252417 -0.0147287 0.022538 0.0822905 0.0947372 - 0.0657516 0.0445506 0.0316753 0.0220971 0.0158101 0.0140971 - 0.0161498 0.0139876 0.0122447 0.0106994 0.009397 0.00822236 - 0.00686509 0.00797431 0.00751269 0.00671173 0.00595243 0.00524633 - 0.00459528 0.00401688 0.00350109 0.00303954 0.00260569 0.00222792 - 0.00191033 0.00163917 0.00140949 0.00121464 0.0010471 0.000900638 - 0.000768847 0.000645236 0.000524807 0.000460275 0.000442237 - 0.000446775 0.000397026 0.000301585 0.000228994 0.000190894 - 0.000166569 0.000152261 0.000137953 0.000123644 0.000109336 - 9.50281e-05 8.56557e-05 7.78437e-05 7.00318e-05 6.22198e-05 - 5.44079e-05 4.87539e-05 4.57761e-05 4.27982e-05 3.98203e-05 - 3.68425e-05 3.38646e-05 3.08868e-05 2.79089e-05 2.4931e-05 - 2.19532e-05 1.89753e-05 1.75244e-05 1.64095e-05 1.52946e-05 - 1.41797e-05 1.30648e-05 1.19499e-05 1.0835e-05 9.72011e-06 - 8.60521e-06 7.4903e-06 6.5117e-06 6.10334e-06 5.69497e-06 - 5.2866e-06 4.87824e-06 4.46987e-06 4.06151e-06 3.65314e-06 - 3.24477e-06 + 5 5.03758 5.04711 4.96911 4.20882 3.96295 4.01117 4.15521 + 4.2967 4.42274 4.5295 4.6176 4.69014 4.74831 4.7966 4.83537 + 4.80526 4.787 4.79295 4.88588 5.08978 5.15615 5.10778 5.07718 + 5.06652 5.08225 4.9744 4.52977 3.77452 2.69426 1.15294 0.245509 + 0.0981544 0.0567527 0.0367487 0.0252578 0.0180599 0.0133837 + 0.0101497 0.0078616 0.00620186 0.00499056 0.0041027 0.00344223 + 0.00295808 0.00260089 0.00229887 0.00200817 0.00176397 0.00160116 + 0.00147381 0.00134645 0.00125029 0.00116043 0.00107371 0.00101981 + 0.000965921 0.000912028 0.000858135 0.000804242 0.000761669 + 0.00072672 0.000691771 0.000656823 0.000621874 0.000588722 + 0.00057041 0.000552098 0.000533785 0.000515473 0.000497162 + 0.00047885 0.000460537 0.000442226 0.000423914 0.000405601 + 0.000388399 0.000378694 0.000368989 0.000359284 0.00034958 + 0.000339875 0.00033017 0.000320465 0.00031076 0.000301055 + 0.00029135 0.000282207 0.000276247 0.000270287 0.000264327 + 0.000258367 0.000252407 0.000246447 0.000240487 0.000234527 + 0.000228567 0.000222607 0.000217086 0.000213696 0.000210307 + 0.000206918 0.000203528 0.000200139 0.00019675 0.00019336 + 0.000189971 0.000186582 0.000183192 0.000179803 0.000176414 + 0.000173025 0.000169635 0.000166246 0.000162857 0.000159467 + 0.000156078 0.000152689 0.000149299 0.00014591 0.00014255 + 0.0316021 0.163272 0.348732 0.603651 0.35745 0.135965 0.0707354 + 0.0314595 0.0201047 0.00994945 0.00389601 0.00138839 0.00060778 + 0.000329648 0.000492396 -0.0732035 -0.0844077 -0.0789062 + -0.0390837 0.0197559 0.0183094 -0.00180099 -0.0189565 -0.0424144 + -0.0735904 -0.0892423 0.285039 1.13702 2.10809 2.95826 3.60164 + 4.0435 4.35771 4.57254 4.71769 4.81329 4.87534 4.91487 4.94264 + 4.97375 5.01526 5.06517 5.10154 5.06259 4.89005 4.5787 4.12226 + 3.46151 2.49023 1.2586 0.32725 0.116753 0.0701865 0.0455509 + 0.0286914 0.0178176 0.0117599 0.00902715 0.00760583 0.00637745 + 0.00543811 0.00439377 0.00352448 0.0030151 0.00285771 0.002465 + 0.00203114 0.00173004 0.0014839 0.00125177 0.00105327 0.000894905 + 0.000766372 0.000658894 0.000569105 0.000492114 0.000427938 + 0.000370217 0.000314758 0.000266569 0.000233726 0.000209048 + 0.000191957 0.000177169 0.000166604 0.000161 0.000157314 + 0.000143828 0.000130342 0.000116857 0.000103371 8.98855e-05 + 7.63998e-05 6.29141e-05 5.76583e-05 5.30027e-05 4.8347e-05 + 4.36913e-05 3.90357e-05 3.438e-05 2.97243e-05 2.72507e-05 + 2.59083e-05 2.45659e-05 2.32235e-05 2.18811e-05 2.05387e-05 + 1.91963e-05 1.78539e-05 1.65115e-05 1.51691e-05 1.38267e-05 + 1.24843e-05 1.11419e-05 9.79954e-06 8.51574e-06 7.69807e-06 + 6.8804e-06 6.06273e-06 5.24506e-06 0.0287318 0.0317111 -0.0320087 + -0.103609 0.0369639 0.0121128 0.00961197 0.00934971 0.00820853 + 0.00699769 0.00607002 0.00535541 0.00476552 0.00427601 0.00376357 + -0.073012 -0.0866964 -0.0809538 -0.038005 0.0277001 0.0188906 + 0.00614597 0.00373629 0.00489787 0.0146573 0.0191052 0.0151708 + 0.0124224 0.0105859 0.00879272 0.00729464 0.0070047 0.00449575 + -0.00626652 -0.0252417 -0.0147287 0.022538 0.0822905 0.0947372 + 0.0657516 0.0445506 0.0316753 0.0220971 0.0158101 0.0140971 + 0.0161498 0.0139876 0.0122447 0.0106994 0.009397 0.00822236 + 0.00686509 0.00797431 0.00751269 0.00671173 0.00595243 0.00524633 + 0.00459528 0.00401688 0.00350109 0.00303954 0.00260569 0.00222792 + 0.00191033 0.00163917 0.00140949 0.00121464 0.0010471 0.000900638 + 0.000768847 0.000645236 0.000524807 0.000460275 0.000442237 + 0.000446775 0.000397026 0.000301585 0.000228994 0.000190894 + 0.000166569 0.000152261 0.000137953 0.000123644 0.000109336 + 9.50281e-05 8.56557e-05 7.78437e-05 7.00318e-05 6.22198e-05 + 5.44079e-05 4.87539e-05 4.57761e-05 4.27982e-05 3.98203e-05 + 3.68425e-05 3.38646e-05 3.08868e-05 2.79089e-05 2.4931e-05 + 2.19532e-05 1.89753e-05 1.75244e-05 1.64095e-05 1.52946e-05 + 1.41797e-05 1.30648e-05 1.19499e-05 1.0835e-05 9.72011e-06 + 8.60521e-06 7.4903e-06 6.5117e-06 6.10334e-06 5.69497e-06 + 5.2866e-06 4.87824e-06 4.46987e-06 4.06151e-06 3.65314e-06 + 3.24477e-06 EOD @v[9].set(<<-'EOD') - 1.86175 1.99708 2.07867 2.01211 2.43309 3.27194 3.63896 - 3.90426 4.11074 4.27932 4.41496 4.52543 4.61491 4.68862 - 4.7479 4.79666 4.72895 4.68886 4.70354 4.81353 5.01568 5.14184 - 5.10482 5.07362 5.05143 5.03638 5.02323 5.01465 5.00853 - 5.00383 4.99985 5.00454 5.00652 5.00546 5.00411 5.003 5.00214 - 5.00151 5.00106 5.00073 5.0005 5.00034 5.00023 5.00015 5.0001 - 5.00005 5 5.00001 5.00005 5.00005 5.00003 5 4.99998 4.99996 - 4.99994 4.99995 4.99997 4.99998 5 5.00001 5.00002 5.00002 - 5.00003 5.00003 5.00003 5.00003 5.00003 5.00003 5.00002 - 5.00002 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998 - 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.17392 4.94828 3.78491 - 1.52079 0.608874 0.244031 0.127087 0.0552995 0.0361032 0.0169025 - 0.006364 0.00217624 0.000921391 0.000457305 0.000786754 - -0.120016 -0.148054 -0.15898 -0.0801463 0.16463 0.174017 - 0.0799249 0.0318788 0.0129696 0.00483397 0.0025677 0.0042079 - 0.00350003 0.00178404 -8.72902e-05 -0.00128497 -0.00142213 - -0.00130018 -0.00106874 -0.000789207 -0.000824335 -0.00104518 - -0.00136799 -0.004366 -0.0102621 -0.0109254 -0.00649259 - -0.00194842 0.00029793 0.00148673 0.00221085 0.00228291 - 0.00185261 0.00139687 0.00148183 0.00562266 0.00844119 0.00754627 - 0.00657396 0.00591212 0.00539269 0.0049282 0.00448417 0.0040572 - 0.00363719 0.00320392 0.00279607 0.00243938 0.00211505 0.00182302 - 0.00156254 0.0013341 0.00113834 0.000971865 0.00082776 0.000706193 - 0.000602499 0.000515059 0.000441401 0.00037897 0.000325459 - 0.00028083 0.000242096 0.000207274 0.000176444 0.000150372 - 0.000126407 0.000103373 9.05522e-05 8.53555e-05 8.63685e-05 - 9.02593e-05 8.37346e-05 7.72099e-05 7.06852e-05 6.41605e-05 - 5.76358e-05 5.11112e-05 4.45865e-05 4.08176e-05 3.72497e-05 - 3.36818e-05 3.01138e-05 2.65459e-05 2.2978e-05 1.94101e-05 - 1.76154e-05 1.67399e-05 1.58645e-05 1.4989e-05 1.41136e-05 - 1.32381e-05 1.23626e-05 1.14872e-05 1.06117e-05 9.73629e-06 - 8.86083e-06 7.98538e-06 7.10993e-06 6.23447e-06 5.44363e-06 - 5.32578e-06 5.20792e-06 5.09007e-06 4.97222e-06 0.0784323 - 0.0474527 -0.0764232 -0.151146 0.0615785 0.0144489 0.00974161 - 0.00947176 0.00849005 0.00728201 0.00630581 0.00554032 0.00487809 - 0.00441504 0.00384139 -0.118943 -0.149894 -0.161173 -0.0825299 - 0.171686 0.176912 0.0816085 0.0335236 0.013791 0.0056976 - 0.00238833 0.00105348 0.000526199 0.00025969 0.000396026 - 0.000837835 0.00170131 0.00196699 -0.000553314 -0.0061621 - -0.0111895 -0.0142698 -0.0124608 -0.00795847 -0.00467822 - -0.0043058 -0.00874449 -0.0118584 -0.00871386 -0.00377892 - 1.95244e-05 0.00218952 0.00325486 0.00386497 0.00422837 - 0.00446883 0.00447065 0.00486647 0.00547838 0.00565398 0.00559092 - 0.00538752 0.00507015 0.00466305 0.00420756 0.00373465 0.00328404 - 0.00287059 0.00250057 0.00216124 0.00184861 0.00156815 0.00134624 - 0.00117857 0.00103412 0.0008948 0.000761012 0.000619853 - 0.000462614 0.000319965 0.000287666 0.000356415 0.000379946 - 0.000339183 0.00027972 0.000252982 0.000226244 0.000199507 - 0.000172769 0.000146031 0.000130097 0.000117578 0.000105059 - 9.25401e-05 8.00213e-05 7.11204e-05 6.67061e-05 6.22918e-05 - 5.78775e-05 5.34632e-05 4.90489e-05 4.46346e-05 4.02203e-05 - 3.5806e-05 3.13916e-05 2.69773e-05 2.4827e-05 2.31747e-05 - 2.15225e-05 1.98702e-05 1.8218e-05 1.65658e-05 1.49135e-05 - 1.32613e-05 1.1609e-05 9.95678e-06 8.50108e-06 7.86765e-06 - 7.23422e-06 6.60079e-06 5.96736e-06 5.33393e-06 4.7005e-06 - 4.06707e-06 3.43363e-06 + 1.86175 1.99708 2.07867 2.01211 2.43309 3.27194 3.63896 + 3.90426 4.11074 4.27932 4.41496 4.52543 4.61491 4.68862 + 4.7479 4.79666 4.72895 4.68886 4.70354 4.81353 5.01568 5.14184 + 5.10482 5.07362 5.05143 5.03638 5.02323 5.01465 5.00853 + 5.00383 4.99985 5.00454 5.00652 5.00546 5.00411 5.003 5.00214 + 5.00151 5.00106 5.00073 5.0005 5.00034 5.00023 5.00015 5.0001 + 5.00005 5 5.00001 5.00005 5.00005 5.00003 5 4.99998 4.99996 + 4.99994 4.99995 4.99997 4.99998 5 5.00001 5.00002 5.00002 + 5.00003 5.00003 5.00003 5.00003 5.00003 5.00003 5.00002 + 5.00002 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998 + 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.17392 4.94828 3.78491 + 1.52079 0.608874 0.244031 0.127087 0.0552995 0.0361032 0.0169025 + 0.006364 0.00217624 0.000921391 0.000457305 0.000786754 + -0.120016 -0.148054 -0.15898 -0.0801463 0.16463 0.174017 + 0.0799249 0.0318788 0.0129696 0.00483397 0.0025677 0.0042079 + 0.00350003 0.00178404 -8.72902e-05 -0.00128497 -0.00142213 + -0.00130018 -0.00106874 -0.000789207 -0.000824335 -0.00104518 + -0.00136799 -0.004366 -0.0102621 -0.0109254 -0.00649259 + -0.00194842 0.00029793 0.00148673 0.00221085 0.00228291 + 0.00185261 0.00139687 0.00148183 0.00562266 0.00844119 0.00754627 + 0.00657396 0.00591212 0.00539269 0.0049282 0.00448417 0.0040572 + 0.00363719 0.00320392 0.00279607 0.00243938 0.00211505 0.00182302 + 0.00156254 0.0013341 0.00113834 0.000971865 0.00082776 0.000706193 + 0.000602499 0.000515059 0.000441401 0.00037897 0.000325459 + 0.00028083 0.000242096 0.000207274 0.000176444 0.000150372 + 0.000126407 0.000103373 9.05522e-05 8.53555e-05 8.63685e-05 + 9.02593e-05 8.37346e-05 7.72099e-05 7.06852e-05 6.41605e-05 + 5.76358e-05 5.11112e-05 4.45865e-05 4.08176e-05 3.72497e-05 + 3.36818e-05 3.01138e-05 2.65459e-05 2.2978e-05 1.94101e-05 + 1.76154e-05 1.67399e-05 1.58645e-05 1.4989e-05 1.41136e-05 + 1.32381e-05 1.23626e-05 1.14872e-05 1.06117e-05 9.73629e-06 + 8.86083e-06 7.98538e-06 7.10993e-06 6.23447e-06 5.44363e-06 + 5.32578e-06 5.20792e-06 5.09007e-06 4.97222e-06 0.0784323 + 0.0474527 -0.0764232 -0.151146 0.0615785 0.0144489 0.00974161 + 0.00947176 0.00849005 0.00728201 0.00630581 0.00554032 0.00487809 + 0.00441504 0.00384139 -0.118943 -0.149894 -0.161173 -0.0825299 + 0.171686 0.176912 0.0816085 0.0335236 0.013791 0.0056976 + 0.00238833 0.00105348 0.000526199 0.00025969 0.000396026 + 0.000837835 0.00170131 0.00196699 -0.000553314 -0.0061621 + -0.0111895 -0.0142698 -0.0124608 -0.00795847 -0.00467822 + -0.0043058 -0.00874449 -0.0118584 -0.00871386 -0.00377892 + 1.95244e-05 0.00218952 0.00325486 0.00386497 0.00422837 + 0.00446883 0.00447065 0.00486647 0.00547838 0.00565398 0.00559092 + 0.00538752 0.00507015 0.00466305 0.00420756 0.00373465 0.00328404 + 0.00287059 0.00250057 0.00216124 0.00184861 0.00156815 0.00134624 + 0.00117857 0.00103412 0.0008948 0.000761012 0.000619853 + 0.000462614 0.000319965 0.000287666 0.000356415 0.000379946 + 0.000339183 0.00027972 0.000252982 0.000226244 0.000199507 + 0.000172769 0.000146031 0.000130097 0.000117578 0.000105059 + 9.25401e-05 8.00213e-05 7.11204e-05 6.67061e-05 6.22918e-05 + 5.78775e-05 5.34632e-05 4.90489e-05 4.46346e-05 4.02203e-05 + 3.5806e-05 3.13916e-05 2.69773e-05 2.4827e-05 2.31747e-05 + 2.15225e-05 1.98702e-05 1.8218e-05 1.65658e-05 1.49135e-05 + 1.32613e-05 1.1609e-05 9.95678e-06 8.50108e-06 7.86765e-06 + 7.23422e-06 6.60079e-06 5.96736e-06 5.33393e-06 4.7005e-06 + 4.06707e-06 3.43363e-06 EOD @v[10].set(<<-'EOD') - 1.86175 1.99308 2.16619 2.46661 3.09359 3.76864 4.31299 - 4.65564 4.83425 4.92153 4.96157 4.98063 4.98649 4.99039 - 4.9945 4.9972 4.96206 4.89882 4.83865 4.83202 4.91016 5.04479 - 5.06078 5.04827 5.03474 5.0246 5.01639 5.00996 5.00569 5.00239 - 5.00043 5.00296 5.00437 5.00382 5.00287 5.00208 5.00148 - 5.00104 5.00073 5.0005 5.00034 5.00023 5.00016 5.00011 5.00008 - 5.00007 5.00007 5.00004 5 4.99998 4.99998 4.99997 4.99998 - 4.99999 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001 - 5.00001 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5.10081 - 5.10949 4.98359 5.00733 5.15145 4.37298 2.36126 0.470759 - 0.0577238 0.0115884 0.00262611 0.000671499 0.000389038 0.000291291 - 0.000317347 -0.0167823 -0.0158344 -0.0140559 0.0104849 0.0865874 - 0.107813 0.0524688 0.0214369 0.00876443 0.00341595 0.00170778 - 0.00259042 0.0022241 0.00118519 1.10217e-06 -0.000784506 - -0.000948169 -0.000856256 -0.000696719 -0.000485987 -0.000724787 - -0.000981491 -0.001454 -0.00552498 -0.0114992 -0.0105266 - -0.00543527 -0.000982798 0.00127356 0.00224212 0.00275439 - 0.00281098 0.0025471 0.00230368 0.00222576 0.00485522 0.00729453 - 0.00691796 0.0062615 0.00573987 0.0052688 0.00481185 0.00436934 - 0.00394326 0.00352712 0.00309978 0.00270038 0.00235335 0.00203742 - 0.00175256 0.00150067 0.00128126 0.00109323 0.000933619 - 0.000795113 0.000678182 0.00057843 0.000494345 0.000423609 - 0.000363821 0.000312766 0.000269856 0.000232389 0.000198382 - 0.000168126 0.00014267 0.000119293 9.69034e-05 8.5669e-05 - 8.26828e-05 8.64066e-05 9.26665e-05 8.5454e-05 7.82416e-05 - 7.10291e-05 6.38167e-05 5.66043e-05 4.93918e-05 4.21794e-05 - 3.86073e-05 3.53007e-05 3.19941e-05 2.86876e-05 2.5381e-05 - 2.20744e-05 1.87678e-05 1.70933e-05 1.62648e-05 1.54363e-05 - 1.46079e-05 1.37794e-05 1.2951e-05 1.21225e-05 1.12941e-05 - 1.04656e-05 9.63716e-06 8.80871e-06 7.98026e-06 7.1518e-06 - 6.32335e-06 5.5374e-06 5.08959e-06 4.64178e-06 4.19397e-06 - 3.74616e-06 0.0438026 0.0242078 -0.0602019 -0.0840866 0.00148461 - -0.00292489 0.000442098 0.00219489 0.00281478 0.00290756 - 0.00277945 0.00263896 0.00240099 0.00223283 0.001947 -0.0153629 - -0.0148815 -0.0128673 0.0126017 0.0905161 0.11051 0.0538958 - 0.022562 0.00935726 0.00397422 0.00172534 0.000790207 0.000416322 - 0.000191632 0.000469721 0.0009779 0.00192566 0.00200688 - -0.0016502 -0.00733932 -0.0128113 -0.0147608 -0.0115456 - -0.00668995 -0.00401368 -0.00463908 -0.0101197 -0.0118993 - -0.0076276 -0.00262656 0.000813059 0.00264455 0.00350796 - 0.00399494 0.0043049 0.00451658 0.00444739 0.00503842 0.00559516 - 0.00568213 0.00556459 0.0053176 0.00496654 0.00454337 0.00408592 - 0.00362171 0.00317793 0.00277001 0.00240394 0.00207009 0.00176575 - 0.00149725 0.00129045 0.00114257 0.00101135 0.000871672 - 0.000723764 0.000580438 0.000427507 0.000296956 0.000281834 - 0.000376628 0.000412266 0.000367547 0.000295305 0.000264513 - 0.000233721 0.000202929 0.000172137 0.000141345 0.000124721 - 0.000112577 0.000100433 8.82893e-05 7.61453e-05 6.75517e-05 - 6.33609e-05 5.91701e-05 5.49792e-05 5.07884e-05 4.65976e-05 - 4.24067e-05 3.82159e-05 3.40251e-05 2.98342e-05 2.56434e-05 - 2.36401e-05 2.21181e-05 2.05961e-05 1.90741e-05 1.75521e-05 - 1.60301e-05 1.45081e-05 1.29861e-05 1.14641e-05 9.94208e-06 - 8.59252e-06 7.96439e-06 7.33626e-06 6.70813e-06 6.07999e-06 - 5.45186e-06 4.82373e-06 4.1956e-06 3.56747e-06 + 1.86175 1.99308 2.16619 2.46661 3.09359 3.76864 4.31299 + 4.65564 4.83425 4.92153 4.96157 4.98063 4.98649 4.99039 + 4.9945 4.9972 4.96206 4.89882 4.83865 4.83202 4.91016 5.04479 + 5.06078 5.04827 5.03474 5.0246 5.01639 5.00996 5.00569 5.00239 + 5.00043 5.00296 5.00437 5.00382 5.00287 5.00208 5.00148 + 5.00104 5.00073 5.0005 5.00034 5.00023 5.00016 5.00011 5.00008 + 5.00007 5.00007 5.00004 5 4.99998 4.99998 4.99997 4.99998 + 4.99999 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001 + 5.00001 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5.10081 + 5.10949 4.98359 5.00733 5.15145 4.37298 2.36126 0.470759 + 0.0577238 0.0115884 0.00262611 0.000671499 0.000389038 0.000291291 + 0.000317347 -0.0167823 -0.0158344 -0.0140559 0.0104849 0.0865874 + 0.107813 0.0524688 0.0214369 0.00876443 0.00341595 0.00170778 + 0.00259042 0.0022241 0.00118519 1.10217e-06 -0.000784506 + -0.000948169 -0.000856256 -0.000696719 -0.000485987 -0.000724787 + -0.000981491 -0.001454 -0.00552498 -0.0114992 -0.0105266 + -0.00543527 -0.000982798 0.00127356 0.00224212 0.00275439 + 0.00281098 0.0025471 0.00230368 0.00222576 0.00485522 0.00729453 + 0.00691796 0.0062615 0.00573987 0.0052688 0.00481185 0.00436934 + 0.00394326 0.00352712 0.00309978 0.00270038 0.00235335 0.00203742 + 0.00175256 0.00150067 0.00128126 0.00109323 0.000933619 + 0.000795113 0.000678182 0.00057843 0.000494345 0.000423609 + 0.000363821 0.000312766 0.000269856 0.000232389 0.000198382 + 0.000168126 0.00014267 0.000119293 9.69034e-05 8.5669e-05 + 8.26828e-05 8.64066e-05 9.26665e-05 8.5454e-05 7.82416e-05 + 7.10291e-05 6.38167e-05 5.66043e-05 4.93918e-05 4.21794e-05 + 3.86073e-05 3.53007e-05 3.19941e-05 2.86876e-05 2.5381e-05 + 2.20744e-05 1.87678e-05 1.70933e-05 1.62648e-05 1.54363e-05 + 1.46079e-05 1.37794e-05 1.2951e-05 1.21225e-05 1.12941e-05 + 1.04656e-05 9.63716e-06 8.80871e-06 7.98026e-06 7.1518e-06 + 6.32335e-06 5.5374e-06 5.08959e-06 4.64178e-06 4.19397e-06 + 3.74616e-06 0.0438026 0.0242078 -0.0602019 -0.0840866 0.00148461 + -0.00292489 0.000442098 0.00219489 0.00281478 0.00290756 + 0.00277945 0.00263896 0.00240099 0.00223283 0.001947 -0.0153629 + -0.0148815 -0.0128673 0.0126017 0.0905161 0.11051 0.0538958 + 0.022562 0.00935726 0.00397422 0.00172534 0.000790207 0.000416322 + 0.000191632 0.000469721 0.0009779 0.00192566 0.00200688 + -0.0016502 -0.00733932 -0.0128113 -0.0147608 -0.0115456 + -0.00668995 -0.00401368 -0.00463908 -0.0101197 -0.0118993 + -0.0076276 -0.00262656 0.000813059 0.00264455 0.00350796 + 0.00399494 0.0043049 0.00451658 0.00444739 0.00503842 0.00559516 + 0.00568213 0.00556459 0.0053176 0.00496654 0.00454337 0.00408592 + 0.00362171 0.00317793 0.00277001 0.00240394 0.00207009 0.00176575 + 0.00149725 0.00129045 0.00114257 0.00101135 0.000871672 + 0.000723764 0.000580438 0.000427507 0.000296956 0.000281834 + 0.000376628 0.000412266 0.000367547 0.000295305 0.000264513 + 0.000233721 0.000202929 0.000172137 0.000141345 0.000124721 + 0.000112577 0.000100433 8.82893e-05 7.61453e-05 6.75517e-05 + 6.33609e-05 5.91701e-05 5.49792e-05 5.07884e-05 4.65976e-05 + 4.24067e-05 3.82159e-05 3.40251e-05 2.98342e-05 2.56434e-05 + 2.36401e-05 2.21181e-05 2.05961e-05 1.90741e-05 1.75521e-05 + 1.60301e-05 1.45081e-05 1.29861e-05 1.14641e-05 9.94208e-06 + 8.59252e-06 7.96439e-06 7.33626e-06 6.70813e-06 6.07999e-06 + 5.45186e-06 4.82373e-06 4.1956e-06 3.56747e-06 EOD @v[11].set(<<-'EOD') - 1.86175 1.73419 1.42874 1.04055 0.943004 0.268275 0.0826455 - 0.0388346 0.0214104 0.0135431 0.00961322 0.00712846 0.00588262 - 0.00432397 0.00377774 0.00270134 -0.00393731 -0.00542187 - -0.00126596 0.0113777 0.0134522 0.00477056 -0.00211067 -0.00229253 - -0.00173355 -0.00122404 -0.00113426 -0.000744931 -0.000520112 - -0.000410048 -0.000220439 0.000508104 5.15856e-05 -0.000112593 - -0.000118917 -9.57394e-05 -7.15727e-05 -5.11847e-05 -3.58275e-05 - -2.47166e-05 -1.68866e-05 -1.14082e-05 -7.66646e-06 -5.12139e-06 - -3.63426e-06 -3.01815e-06 -2.64862e-06 -1.4947e-06 -1.91403e-07 - -2.5763e-08 -7.73699e-07 -1.52164e-06 -1.07268e-06 -3.81696e-07 - 2.6727e-07 4.75489e-07 6.83708e-07 8.91926e-07 1.10014e-06 - 1.30836e-06 1.2482e-06 1.00726e-06 7.66311e-07 5.25364e-07 - 2.84417e-07 6.27857e-08 7.43904e-10 -6.12979e-08 -1.2334e-07 - -1.85382e-07 -2.47423e-07 -3.09465e-07 -3.71507e-07 -4.33549e-07 - -4.95591e-07 -5.57633e-07 -6.04571e-07 -5.4944e-07 -4.9431e-07 - -4.3918e-07 -3.84049e-07 -3.28919e-07 -2.73789e-07 -2.18659e-07 - -1.63528e-07 -1.08398e-07 -5.32678e-08 1.062e-09 5.08502e-08 - 1.00638e-07 1.50427e-07 2.00215e-07 2.50003e-07 2.99791e-07 - 3.4958e-07 3.99368e-07 4.49156e-07 4.98944e-07 5.34512e-07 - 5.01032e-07 4.67553e-07 4.34073e-07 4.00593e-07 3.67113e-07 - 3.33633e-07 3.00153e-07 2.66674e-07 2.33194e-07 1.99714e-07 - 1.66234e-07 1.32754e-07 9.92744e-08 6.57945e-08 3.23147e-08 - -1.16513e-09 -3.4645e-08 -6.81248e-08 -1.01605e-07 -1.35084e-07 - -1.68564e-07 -2.18729e-07 0.0114926 -0.0245378 -0.111828 - 0.0964775 1.61491 3.22668 4.22041 4.54492 4.82845 4.94868 - 4.98588 4.99609 4.9981 4.99908 4.99788 4.98395 4.99294 4.99724 - 5.01939 5.0471 5.00902 4.98194 4.98496 4.99188 4.99623 4.99862 - 5.00025 4.99974 4.99953 4.99946 4.99958 5.00012 4.99997 - 4.99992 4.99988 4.99985 4.9998 4.9997 4.9988 4.99806 4.99982 - 5.00143 5.00159 5.00098 5.00053 5.00028 5.00007 4.99977 - 4.99992 5.00005 5.00133 5.0009 4.99993 4.99972 4.99975 4.9998 - 4.99982 4.99983 4.99983 4.99983 4.99983 4.99984 4.99986 - 4.99987 4.99989 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995 - 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99998 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002 - 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 5 5 5.01457 4.99482 4.96561 4.99326 - 5.03452 5.00424 5.00101 5.00045 5.00004 4.99965 4.99997 - 4.99994 4.99958 4.99999 4.99936 4.9839 4.99248 4.99717 5.01976 - 5.04869 5.0087 4.98143 4.98488 4.99199 4.99622 4.9983 4.99928 - 4.99971 4.99986 5.00031 5.00022 5.00035 5.0001 4.99884 4.99811 - 4.99803 4.99887 5.00078 5.00151 5.00116 5.00007 4.99843 - 4.99915 5.00107 5.00168 5.00141 5.00092 5.00055 5.0003 5.00016 - 5.0001 5.00001 5.00016 5.0002 5.00009 4.99993 4.99975 4.99984 - 4.99991 4.99991 4.99982 4.99974 4.99974 4.99985 4.99995 - 4.99999 4.99998 5.00004 5.00013 5.00015 5.00007 4.99988 - 4.99982 4.99985 4.99995 5.00006 5.0002 5.00025 5.0002 5.00009 - 5.00006 5.00004 5.00002 5 4.99998 4.99997 4.99998 4.99998 - 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 - 4.99998 4.99998 4.99998 + 1.86175 1.73419 1.42874 1.04055 0.943004 0.268275 0.0826455 + 0.0388346 0.0214104 0.0135431 0.00961322 0.00712846 0.00588262 + 0.00432397 0.00377774 0.00270134 -0.00393731 -0.00542187 + -0.00126596 0.0113777 0.0134522 0.00477056 -0.00211067 -0.00229253 + -0.00173355 -0.00122404 -0.00113426 -0.000744931 -0.000520112 + -0.000410048 -0.000220439 0.000508104 5.15856e-05 -0.000112593 + -0.000118917 -9.57394e-05 -7.15727e-05 -5.11847e-05 -3.58275e-05 + -2.47166e-05 -1.68866e-05 -1.14082e-05 -7.66646e-06 -5.12139e-06 + -3.63426e-06 -3.01815e-06 -2.64862e-06 -1.4947e-06 -1.91403e-07 + -2.5763e-08 -7.73699e-07 -1.52164e-06 -1.07268e-06 -3.81696e-07 + 2.6727e-07 4.75489e-07 6.83708e-07 8.91926e-07 1.10014e-06 + 1.30836e-06 1.2482e-06 1.00726e-06 7.66311e-07 5.25364e-07 + 2.84417e-07 6.27857e-08 7.43904e-10 -6.12979e-08 -1.2334e-07 + -1.85382e-07 -2.47423e-07 -3.09465e-07 -3.71507e-07 -4.33549e-07 + -4.95591e-07 -5.57633e-07 -6.04571e-07 -5.4944e-07 -4.9431e-07 + -4.3918e-07 -3.84049e-07 -3.28919e-07 -2.73789e-07 -2.18659e-07 + -1.63528e-07 -1.08398e-07 -5.32678e-08 1.062e-09 5.08502e-08 + 1.00638e-07 1.50427e-07 2.00215e-07 2.50003e-07 2.99791e-07 + 3.4958e-07 3.99368e-07 4.49156e-07 4.98944e-07 5.34512e-07 + 5.01032e-07 4.67553e-07 4.34073e-07 4.00593e-07 3.67113e-07 + 3.33633e-07 3.00153e-07 2.66674e-07 2.33194e-07 1.99714e-07 + 1.66234e-07 1.32754e-07 9.92744e-08 6.57945e-08 3.23147e-08 + -1.16513e-09 -3.4645e-08 -6.81248e-08 -1.01605e-07 -1.35084e-07 + -1.68564e-07 -2.18729e-07 0.0114926 -0.0245378 -0.111828 + 0.0964775 1.61491 3.22668 4.22041 4.54492 4.82845 4.94868 + 4.98588 4.99609 4.9981 4.99908 4.99788 4.98395 4.99294 4.99724 + 5.01939 5.0471 5.00902 4.98194 4.98496 4.99188 4.99623 4.99862 + 5.00025 4.99974 4.99953 4.99946 4.99958 5.00012 4.99997 + 4.99992 4.99988 4.99985 4.9998 4.9997 4.9988 4.99806 4.99982 + 5.00143 5.00159 5.00098 5.00053 5.00028 5.00007 4.99977 + 4.99992 5.00005 5.00133 5.0009 4.99993 4.99972 4.99975 4.9998 + 4.99982 4.99983 4.99983 4.99983 4.99983 4.99984 4.99986 + 4.99987 4.99989 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995 + 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99998 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002 + 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 5 5 5.01457 4.99482 4.96561 4.99326 + 5.03452 5.00424 5.00101 5.00045 5.00004 4.99965 4.99997 + 4.99994 4.99958 4.99999 4.99936 4.9839 4.99248 4.99717 5.01976 + 5.04869 5.0087 4.98143 4.98488 4.99199 4.99622 4.9983 4.99928 + 4.99971 4.99986 5.00031 5.00022 5.00035 5.0001 4.99884 4.99811 + 4.99803 4.99887 5.00078 5.00151 5.00116 5.00007 4.99843 + 4.99915 5.00107 5.00168 5.00141 5.00092 5.00055 5.0003 5.00016 + 5.0001 5.00001 5.00016 5.0002 5.00009 4.99993 4.99975 4.99984 + 4.99991 4.99991 4.99982 4.99974 4.99974 4.99985 4.99995 + 4.99999 4.99998 5.00004 5.00013 5.00015 5.00007 4.99988 + 4.99982 4.99985 4.99995 5.00006 5.0002 5.00025 5.0002 5.00009 + 5.00006 5.00004 5.00002 5 4.99998 4.99997 4.99998 4.99998 + 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 + 4.99998 4.99998 4.99998 EOD @v[12].set(<<-'EOD') - 5 5.16975 4.78685 2.94241 0.126698 0.0487004 -0.00422591 - -0.00130689 -0.000486756 -0.000195875 -0.000108988 -6.66736e-05 - -7.26005e-05 -5.63608e-05 -3.81859e-05 -2.123e-05 -0.0646846 - -0.0184474 0.182248 1.06731 3.10988 4.46133 4.84133 4.95113 - 4.98364 4.99455 4.99694 4.99727 4.9994 4.99975 5.0001 5.00132 - 5.00089 5.00039 5.00019 5.00011 5.00006 5.00005 5.00004 - 5.00001 4.99992 4.99992 5.00002 5.00013 5.00017 5.00009 - 4.99992 4.99991 4.99994 4.99996 4.99998 4.99999 5.00001 - 5.00004 5.00006 5.00005 5.00004 5.00003 5.00002 5.00001 - 5 4.99999 4.99999 4.99998 4.99998 4.99997 4.99997 4.99998 - 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 - 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 5 5.14699 4.78074 - 3.19424 0.305663 0.0611255 -0.00179951 -0.0012032 0.000405978 - 0.000989399 0.000445194 0.000191447 8.30476e-05 3.96236e-05 - 1.91866e-05 1.70665e-05 -0.0655239 -0.0210234 0.1827 1.06848 - 3.11554 4.46518 4.84212 4.94853 4.98244 4.99434 4.9997 5.00081 - 5.00009 4.99972 4.99985 4.99974 4.9995 4.99949 4.99958 4.99973 - 4.99948 4.99914 4.99874 4.99946 5.00309 5.0091 5.01576 5.01835 - 5.01852 5.0176 5.01625 5.01479 5.01345 5.01264 5.011 5.01092 - 5.01344 5.01363 5.01289 5.01184 5.01071 5.00956 5.00848 - 5.00751 5.00663 5.00577 5.00497 5.00427 5.00365 5.0031 5.00264 - 5.00224 5.00191 5.00163 5.00138 5.00117 5.00099 5.00083 - 5.00071 5.00061 5.00053 5.00045 5.00037 5.00029 5.00022 - 5.00019 5.0002 5.00023 5.00024 5.00023 5.00023 5.00022 5.0002 - 5.00018 5.00016 5.00014 5.00011 5.00009 5.00007 5.00006 - 5.00005 5.00005 5.00004 5.00003 5.00002 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 - 5.00002 5.00001 5.00001 5.00001 5.14298 4.79809 3.32704 - 0.498385 0.105773 0.0160646 0.0319912 0.0299434 0.0240102 - 0.0185844 0.0130411 0.0106532 0.00864871 0.00744519 0.00660887 - -0.0612913 -0.0203719 0.174998 0.991787 3.06292 4.60005 - 4.93058 4.98917 5.00033 4.9999 4.99909 4.9966 4.9955 4.99488 - 4.99374 4.9943 5.00131 5.00506 4.99311 4.96288 4.93567 4.92439 - 4.94236 4.9732 4.98864 4.99458 5.00031 5.00694 5.01525 5.01945 - 5.01998 5.01953 5.01874 5.01766 5.0164 5.01509 5.01326 5.01423 - 5.01455 5.01361 5.01245 5.01122 5.01002 5.00888 5.00783 - 5.00687 5.00596 5.00514 5.00442 5.00379 5.00325 5.00279 - 5.0024 5.00208 5.0018 5.00153 5.00126 5.00107 5.00094 5.00085 - 5.00078 5.00072 5.00063 5.00053 5.00042 5.00038 5.00034 - 5.0003 5.00027 5.00023 5.00021 5.00019 5.00017 5.00015 5.00013 - 5.00012 5.00011 5.0001 5.0001 5.00009 5.00008 5.00007 5.00007 - 5.00006 5.00005 5.00005 5.00004 5.00004 5.00003 5.00003 - 5.00002 5.00002 5.00002 5.00001 5.00001 5 5 5 5.00001 5.00001 - 5.00001 5.00002 5.00002 5.00002 5.00002 + 5 5.16975 4.78685 2.94241 0.126698 0.0487004 -0.00422591 + -0.00130689 -0.000486756 -0.000195875 -0.000108988 -6.66736e-05 + -7.26005e-05 -5.63608e-05 -3.81859e-05 -2.123e-05 -0.0646846 + -0.0184474 0.182248 1.06731 3.10988 4.46133 4.84133 4.95113 + 4.98364 4.99455 4.99694 4.99727 4.9994 4.99975 5.0001 5.00132 + 5.00089 5.00039 5.00019 5.00011 5.00006 5.00005 5.00004 + 5.00001 4.99992 4.99992 5.00002 5.00013 5.00017 5.00009 + 4.99992 4.99991 4.99994 4.99996 4.99998 4.99999 5.00001 + 5.00004 5.00006 5.00005 5.00004 5.00003 5.00002 5.00001 + 5 4.99999 4.99999 4.99998 4.99998 4.99997 4.99997 4.99998 + 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 + 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 5 5.14699 4.78074 + 3.19424 0.305663 0.0611255 -0.00179951 -0.0012032 0.000405978 + 0.000989399 0.000445194 0.000191447 8.30476e-05 3.96236e-05 + 1.91866e-05 1.70665e-05 -0.0655239 -0.0210234 0.1827 1.06848 + 3.11554 4.46518 4.84212 4.94853 4.98244 4.99434 4.9997 5.00081 + 5.00009 4.99972 4.99985 4.99974 4.9995 4.99949 4.99958 4.99973 + 4.99948 4.99914 4.99874 4.99946 5.00309 5.0091 5.01576 5.01835 + 5.01852 5.0176 5.01625 5.01479 5.01345 5.01264 5.011 5.01092 + 5.01344 5.01363 5.01289 5.01184 5.01071 5.00956 5.00848 + 5.00751 5.00663 5.00577 5.00497 5.00427 5.00365 5.0031 5.00264 + 5.00224 5.00191 5.00163 5.00138 5.00117 5.00099 5.00083 + 5.00071 5.00061 5.00053 5.00045 5.00037 5.00029 5.00022 + 5.00019 5.0002 5.00023 5.00024 5.00023 5.00023 5.00022 5.0002 + 5.00018 5.00016 5.00014 5.00011 5.00009 5.00007 5.00006 + 5.00005 5.00005 5.00004 5.00003 5.00002 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 + 5.00002 5.00001 5.00001 5.00001 5.14298 4.79809 3.32704 + 0.498385 0.105773 0.0160646 0.0319912 0.0299434 0.0240102 + 0.0185844 0.0130411 0.0106532 0.00864871 0.00744519 0.00660887 + -0.0612913 -0.0203719 0.174998 0.991787 3.06292 4.60005 + 4.93058 4.98917 5.00033 4.9999 4.99909 4.9966 4.9955 4.99488 + 4.99374 4.9943 5.00131 5.00506 4.99311 4.96288 4.93567 4.92439 + 4.94236 4.9732 4.98864 4.99458 5.00031 5.00694 5.01525 5.01945 + 5.01998 5.01953 5.01874 5.01766 5.0164 5.01509 5.01326 5.01423 + 5.01455 5.01361 5.01245 5.01122 5.01002 5.00888 5.00783 + 5.00687 5.00596 5.00514 5.00442 5.00379 5.00325 5.00279 + 5.0024 5.00208 5.0018 5.00153 5.00126 5.00107 5.00094 5.00085 + 5.00078 5.00072 5.00063 5.00053 5.00042 5.00038 5.00034 + 5.0003 5.00027 5.00023 5.00021 5.00019 5.00017 5.00015 5.00013 + 5.00012 5.00011 5.0001 5.0001 5.00009 5.00008 5.00007 5.00007 + 5.00006 5.00005 5.00005 5.00004 5.00004 5.00003 5.00003 + 5.00002 5.00002 5.00002 5.00001 5.00001 5 5 5 5.00001 5.00001 + 5.00001 5.00002 5.00002 5.00002 5.00002 EOD @v[13].set(<<-'EOD') - 9.73784e-10 0.0189926 0.0926769 0.206309 0.111533 0.0953491 - 0.0426966 0.0214177 0.0117943 0.00741442 0.00528816 0.00398417 - 0.0032967 0.00266499 0.00206647 0.00158788 -0.0371391 -0.0439528 - -0.0408653 -0.0188706 0.0150241 0.0126852 0.00209817 -0.000239206 - -5.31488e-05 0.000876324 -0.00451221 -0.0165223 -0.0284127 - -0.0427584 -0.0502453 -0.0257366 -0.00903938 -0.00376456 - -0.00233385 -0.00169922 -0.00130397 -0.00102542 -0.000811435 - -0.000648115 -0.000529266 -0.00043795 -0.00036574 -0.00030716 - -0.00026221 -0.000229662 -0.000205112 -0.000181038 -0.000162045 - -0.000148988 -0.000137633 -0.000126278 -0.000115562 -0.000104976 - -9.49324e-05 -9.0585e-05 -8.62375e-05 -8.18901e-05 -7.75426e-05 - -7.31952e-05 -6.93752e-05 -6.59106e-05 -6.24461e-05 -5.89815e-05 - -5.55169e-05 -5.22412e-05 -5.05263e-05 -4.88114e-05 -4.70966e-05 - -4.53817e-05 -4.36668e-05 -4.19519e-05 -4.0237e-05 -3.85222e-05 - -3.68073e-05 -3.50924e-05 -3.34782e-05 -3.25442e-05 -3.16102e-05 - -3.06763e-05 -2.97423e-05 -2.88083e-05 -2.78744e-05 -2.69404e-05 - -2.60064e-05 -2.50725e-05 -2.41385e-05 -2.32635e-05 -2.27232e-05 - -2.21829e-05 -2.16426e-05 -2.11023e-05 -2.0562e-05 -2.00217e-05 - -1.94814e-05 -1.89411e-05 -1.84007e-05 -1.78604e-05 -1.73647e-05 - -1.70853e-05 -1.68059e-05 -1.65265e-05 -1.62471e-05 -1.59677e-05 - -1.56883e-05 -1.54089e-05 -1.51295e-05 -1.48501e-05 -1.45707e-05 - -1.42913e-05 -1.40119e-05 -1.37325e-05 -1.34531e-05 -1.31737e-05 - -1.28943e-05 -1.26149e-05 -1.23355e-05 -1.20561e-05 -1.17767e-05 - -1.14973e-05 -1.10954e-05 0.0152675 0.0228237 -0.00460678 - -0.0341525 0.0232109 -0.0138039 -0.0416538 -0.0458764 -0.0201967 - -0.00878316 -0.00379173 -0.00164621 -0.000785131 -0.00037575 - -0.000352375 -0.0545586 -0.0746881 -0.0771865 -0.05386 -0.0022199 - 0.0136703 0.00633526 0.00138826 -0.00108934 0.0038886 0.0298077 - 0.0475776 0.0481003 0.0464167 0.047818 0.042789 0.035207 - 0.0264423 0.0193959 0.0151614 0.00624257 -0.00913057 -0.0310696 - -0.0430238 0.016426 0.189762 0.49025 0.820116 1.13919 1.43549 - 1.70658 1.95183 2.17414 2.38506 2.5657 2.73958 2.97905 3.21403 - 3.43025 3.62645 3.8028 3.96002 4.09996 4.22443 4.33427 4.42886 - 4.51097 4.5817 4.64326 4.6957 4.74132 4.7797 4.81298 4.84102 - 4.86512 4.88523 4.90224 4.91649 4.92846 4.93868 4.94755 - 4.95483 4.96114 4.96682 4.97161 4.97502 4.9776 4.97944 4.98141 - 4.98319 4.98467 4.98585 4.9869 4.98796 4.98902 4.99008 4.99114 - 4.9922 4.99326 4.9938 4.99429 4.99479 4.99528 4.99578 4.99628 - 4.99677 4.99704 4.99718 4.99733 4.99747 4.99762 4.99777 - 4.99791 4.99806 4.9982 4.99835 4.9985 4.99864 4.99879 4.99893 - 4.99907 4.99916 4.99925 4.99934 4.99943 5.01473 4.92293 - 4.61974 4.0316 3.7835 3.74195 3.78344 3.87272 3.97386 4.07319 - 4.16686 4.25256 4.33126 4.40264 4.46697 4.49249 4.51807 - 4.55803 4.64055 4.78574 4.86074 4.88334 4.8999 4.91455 4.92814 - 4.93926 4.94761 4.95433 4.95907 4.9654 4.98317 5.0208 5.05134 - 4.85852 4.16041 3.00077 1.68376 0.672707 0.240838 0.0794725 - -0.0106347 -0.00879443 0.107196 0.368163 0.701424 1.03581 - 1.3601 1.6678 1.95731 2.22701 2.47544 2.69099 2.92327 3.16648 - 3.3877 3.59067 3.77344 3.93584 4.08066 4.20863 4.32065 4.41791 - 4.50211 4.57423 4.63614 4.68888 4.73377 4.7721 4.80519 4.83338 - 4.85732 4.87815 4.89514 4.90927 4.92108 4.93122 4.94014 - 4.94845 4.95601 4.96251 4.96576 4.969 4.97225 4.9755 4.97874 - 4.98087 4.98265 4.98442 4.9862 4.98797 4.98924 4.9899 4.99055 - 4.9912 4.99186 4.99251 4.99316 4.99381 4.99447 4.99512 4.99577 - 4.99609 4.99634 4.99659 4.99683 4.99708 4.99732 4.99757 - 4.99782 4.99806 4.99831 4.99853 4.99863 4.99873 4.99883 - 4.99893 4.99903 4.99913 4.99923 4.99933 + 9.73784e-10 0.0189926 0.0926769 0.206309 0.111533 0.0953491 + 0.0426966 0.0214177 0.0117943 0.00741442 0.00528816 0.00398417 + 0.0032967 0.00266499 0.00206647 0.00158788 -0.0371391 -0.0439528 + -0.0408653 -0.0188706 0.0150241 0.0126852 0.00209817 -0.000239206 + -5.31488e-05 0.000876324 -0.00451221 -0.0165223 -0.0284127 + -0.0427584 -0.0502453 -0.0257366 -0.00903938 -0.00376456 + -0.00233385 -0.00169922 -0.00130397 -0.00102542 -0.000811435 + -0.000648115 -0.000529266 -0.00043795 -0.00036574 -0.00030716 + -0.00026221 -0.000229662 -0.000205112 -0.000181038 -0.000162045 + -0.000148988 -0.000137633 -0.000126278 -0.000115562 -0.000104976 + -9.49324e-05 -9.0585e-05 -8.62375e-05 -8.18901e-05 -7.75426e-05 + -7.31952e-05 -6.93752e-05 -6.59106e-05 -6.24461e-05 -5.89815e-05 + -5.55169e-05 -5.22412e-05 -5.05263e-05 -4.88114e-05 -4.70966e-05 + -4.53817e-05 -4.36668e-05 -4.19519e-05 -4.0237e-05 -3.85222e-05 + -3.68073e-05 -3.50924e-05 -3.34782e-05 -3.25442e-05 -3.16102e-05 + -3.06763e-05 -2.97423e-05 -2.88083e-05 -2.78744e-05 -2.69404e-05 + -2.60064e-05 -2.50725e-05 -2.41385e-05 -2.32635e-05 -2.27232e-05 + -2.21829e-05 -2.16426e-05 -2.11023e-05 -2.0562e-05 -2.00217e-05 + -1.94814e-05 -1.89411e-05 -1.84007e-05 -1.78604e-05 -1.73647e-05 + -1.70853e-05 -1.68059e-05 -1.65265e-05 -1.62471e-05 -1.59677e-05 + -1.56883e-05 -1.54089e-05 -1.51295e-05 -1.48501e-05 -1.45707e-05 + -1.42913e-05 -1.40119e-05 -1.37325e-05 -1.34531e-05 -1.31737e-05 + -1.28943e-05 -1.26149e-05 -1.23355e-05 -1.20561e-05 -1.17767e-05 + -1.14973e-05 -1.10954e-05 0.0152675 0.0228237 -0.00460678 + -0.0341525 0.0232109 -0.0138039 -0.0416538 -0.0458764 -0.0201967 + -0.00878316 -0.00379173 -0.00164621 -0.000785131 -0.00037575 + -0.000352375 -0.0545586 -0.0746881 -0.0771865 -0.05386 -0.0022199 + 0.0136703 0.00633526 0.00138826 -0.00108934 0.0038886 0.0298077 + 0.0475776 0.0481003 0.0464167 0.047818 0.042789 0.035207 + 0.0264423 0.0193959 0.0151614 0.00624257 -0.00913057 -0.0310696 + -0.0430238 0.016426 0.189762 0.49025 0.820116 1.13919 1.43549 + 1.70658 1.95183 2.17414 2.38506 2.5657 2.73958 2.97905 3.21403 + 3.43025 3.62645 3.8028 3.96002 4.09996 4.22443 4.33427 4.42886 + 4.51097 4.5817 4.64326 4.6957 4.74132 4.7797 4.81298 4.84102 + 4.86512 4.88523 4.90224 4.91649 4.92846 4.93868 4.94755 + 4.95483 4.96114 4.96682 4.97161 4.97502 4.9776 4.97944 4.98141 + 4.98319 4.98467 4.98585 4.9869 4.98796 4.98902 4.99008 4.99114 + 4.9922 4.99326 4.9938 4.99429 4.99479 4.99528 4.99578 4.99628 + 4.99677 4.99704 4.99718 4.99733 4.99747 4.99762 4.99777 + 4.99791 4.99806 4.9982 4.99835 4.9985 4.99864 4.99879 4.99893 + 4.99907 4.99916 4.99925 4.99934 4.99943 5.01473 4.92293 + 4.61974 4.0316 3.7835 3.74195 3.78344 3.87272 3.97386 4.07319 + 4.16686 4.25256 4.33126 4.40264 4.46697 4.49249 4.51807 + 4.55803 4.64055 4.78574 4.86074 4.88334 4.8999 4.91455 4.92814 + 4.93926 4.94761 4.95433 4.95907 4.9654 4.98317 5.0208 5.05134 + 4.85852 4.16041 3.00077 1.68376 0.672707 0.240838 0.0794725 + -0.0106347 -0.00879443 0.107196 0.368163 0.701424 1.03581 + 1.3601 1.6678 1.95731 2.22701 2.47544 2.69099 2.92327 3.16648 + 3.3877 3.59067 3.77344 3.93584 4.08066 4.20863 4.32065 4.41791 + 4.50211 4.57423 4.63614 4.68888 4.73377 4.7721 4.80519 4.83338 + 4.85732 4.87815 4.89514 4.90927 4.92108 4.93122 4.94014 + 4.94845 4.95601 4.96251 4.96576 4.969 4.97225 4.9755 4.97874 + 4.98087 4.98265 4.98442 4.9862 4.98797 4.98924 4.9899 4.99055 + 4.9912 4.99186 4.99251 4.99316 4.99381 4.99447 4.99512 4.99577 + 4.99609 4.99634 4.99659 4.99683 4.99708 4.99732 4.99757 + 4.99782 4.99806 4.99831 4.99853 4.99863 4.99873 4.99883 + 4.99893 4.99903 4.99913 4.99923 4.99933 EOD @v[14].set(<<-'EOD') - 1.86175 2.00147 1.85141 1.0654 0.275481 0.205547 0.0712627 - 0.0313387 0.0151431 0.00864531 0.00593861 0.00438111 0.0037479 - 0.00305857 0.00221221 0.0017081 -0.0896128 -0.109079 -0.121356 - -0.0542001 0.175821 0.177442 0.0814591 0.0333042 0.0134909 - 0.00625777 0.00100092 -0.00552776 -0.00411139 -0.00150395 - -0.000564784 3.48169e-05 -0.000287014 -0.000538515 -0.000456537 - -0.000325677 -0.000275468 -0.000166452 -8.27481e-05 -8.28704e-05 - -7.47644e-05 -4.60552e-05 -2.61481e-06 2.26359e-05 2.53852e-05 - -1.39853e-06 -4.23456e-05 -4.0907e-05 -2.8501e-05 -1.5945e-05 - -9.01122e-06 -2.07747e-06 1.49328e-06 4.38398e-06 6.84248e-06 - 4.76711e-06 2.69173e-06 6.16362e-07 -1.45901e-06 -3.53438e-06 - -4.14256e-06 -3.76238e-06 -3.3822e-06 -3.00202e-06 -2.62184e-06 - -2.24878e-06 -1.93456e-06 -1.62033e-06 -1.3061e-06 -9.91867e-07 - -6.77638e-07 -3.63409e-07 -4.91792e-08 2.6505e-07 5.7928e-07 - 8.93509e-07 1.16076e-06 1.11055e-06 1.06034e-06 1.01014e-06 - 9.59927e-07 9.09719e-07 8.59511e-07 8.09302e-07 7.59094e-07 - 7.08886e-07 6.58678e-07 5.99251e-07 4.87523e-07 3.75795e-07 - 2.64068e-07 1.5234e-07 4.06119e-08 -7.1116e-08 -1.82844e-07 - -2.94572e-07 -4.063e-07 -5.18027e-07 -6.08517e-07 -5.95879e-07 - -5.83241e-07 -5.70604e-07 -5.57966e-07 -5.45328e-07 -5.3269e-07 - -5.20053e-07 -5.07415e-07 -4.94777e-07 -4.8214e-07 -4.69502e-07 - -4.56864e-07 -4.44226e-07 -4.31589e-07 -4.18951e-07 -4.06313e-07 - -3.93676e-07 -3.81038e-07 -3.684e-07 -3.55762e-07 -3.43125e-07 - 1.06736e-05 0.0797407 0.0437947 -0.0645098 -0.0877312 0.0653203 - -0.00621184 -0.0353188 -0.0491378 -0.0251957 -0.0110996 - -0.00481123 -0.0020941 -0.000998038 -0.000478747 -0.000445332 - -0.102046 -0.135753 -0.154351 -0.0827509 0.163348 0.174012 - 0.0794822 0.0310624 0.0112213 0.00249061 0.00130764 0.00181315 - 0.00163875 0.00101454 0.000497435 0.000195258 5.31901e-05 - 2.4607e-05 6.62736e-05 7.90718e-05 4.0372e-05 -0.000141184 - -0.000280623 5.5608e-05 0.000799565 0.000920189 0.000931616 - 0.000494527 0.000162303 -8.24884e-05 -0.000183938 -0.000203899 - -0.000144788 -9.87063e-05 -0.000227929 2.93932e-05 0.000208563 - 1.88958e-06 -7.6335e-05 -0.000172472 -0.000165656 -0.000145889 - -0.000177311 -0.000191058 -0.000168287 -0.00015755 -0.00013142 - -8.10488e-05 -6.36115e-05 -7.8699e-05 -8.11282e-05 -7.98625e-05 - -5.98807e-05 -3.40879e-05 -1.95464e-05 -1.79247e-05 -4.45514e-05 - -7.47995e-05 -8.7682e-05 -7.50806e-05 -3.25561e-05 -4.34114e-05 - -7.69099e-05 -0.000141101 -0.00018743 -0.000148471 -5.06546e-05 - 0.000120195 0.000177635 0.000177052 0.000146344 9.75126e-05 - 8.31233e-05 6.8734e-05 5.43447e-05 3.99554e-05 2.55661e-05 - 1.11768e-05 -3.21253e-06 -3.88937e-06 -3.56628e-06 -3.24318e-06 - -2.92008e-06 -2.59699e-06 -2.27389e-06 -1.9508e-06 -1.73227e-06 - -1.56796e-06 -1.40365e-06 -1.23934e-06 -1.07503e-06 -9.10722e-07 - -7.46412e-07 -5.82101e-07 -4.1779e-07 -2.5348e-07 -8.91694e-08 - 7.51412e-08 2.39452e-07 4.03762e-07 5.95733e-07 1.00771e-06 - 1.41969e-06 1.83167e-06 2.24365e-06 0.0828257 0.231038 0.465438 - 1.54516 2.8461 3.19221 3.40395 3.6382 3.80758 3.93848 4.04882 - 4.15428 4.247 4.32917 4.40235 4.36941 4.397 4.48862 4.64552 - 4.86595 5.03475 5.0348 5.02627 5.01967 5.01542 5.00925 4.98613 - 4.9519 4.91581 4.87357 4.82302 4.80403 4.82565 4.86102 4.89483 - 4.92253 4.94428 4.96257 4.97608 4.98373 4.98823 4.99182 - 4.99437 4.99635 4.99745 4.99802 4.99843 4.99873 4.99895 - 4.99912 4.99925 4.99931 4.99962 4.99973 4.99972 4.99971 - 4.9997 4.99969 4.9997 4.99971 4.99973 4.99974 4.99976 4.99978 - 4.9998 4.99982 4.99985 4.99987 4.99989 4.9999 4.99991 4.99991 - 4.99993 4.99994 4.99997 5.00001 5.00006 5.00008 5.00006 - 5.00002 5 4.99999 4.99998 4.99997 4.99995 4.99995 4.99995 - 4.99995 4.99995 4.99995 4.99995 4.99996 4.99997 4.99997 - 4.99998 4.99999 5 5 5.00001 5.00002 5.00002 5.00002 5.00002 - 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001 - 5.00001 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999 + 1.86175 2.00147 1.85141 1.0654 0.275481 0.205547 0.0712627 + 0.0313387 0.0151431 0.00864531 0.00593861 0.00438111 0.0037479 + 0.00305857 0.00221221 0.0017081 -0.0896128 -0.109079 -0.121356 + -0.0542001 0.175821 0.177442 0.0814591 0.0333042 0.0134909 + 0.00625777 0.00100092 -0.00552776 -0.00411139 -0.00150395 + -0.000564784 3.48169e-05 -0.000287014 -0.000538515 -0.000456537 + -0.000325677 -0.000275468 -0.000166452 -8.27481e-05 -8.28704e-05 + -7.47644e-05 -4.60552e-05 -2.61481e-06 2.26359e-05 2.53852e-05 + -1.39853e-06 -4.23456e-05 -4.0907e-05 -2.8501e-05 -1.5945e-05 + -9.01122e-06 -2.07747e-06 1.49328e-06 4.38398e-06 6.84248e-06 + 4.76711e-06 2.69173e-06 6.16362e-07 -1.45901e-06 -3.53438e-06 + -4.14256e-06 -3.76238e-06 -3.3822e-06 -3.00202e-06 -2.62184e-06 + -2.24878e-06 -1.93456e-06 -1.62033e-06 -1.3061e-06 -9.91867e-07 + -6.77638e-07 -3.63409e-07 -4.91792e-08 2.6505e-07 5.7928e-07 + 8.93509e-07 1.16076e-06 1.11055e-06 1.06034e-06 1.01014e-06 + 9.59927e-07 9.09719e-07 8.59511e-07 8.09302e-07 7.59094e-07 + 7.08886e-07 6.58678e-07 5.99251e-07 4.87523e-07 3.75795e-07 + 2.64068e-07 1.5234e-07 4.06119e-08 -7.1116e-08 -1.82844e-07 + -2.94572e-07 -4.063e-07 -5.18027e-07 -6.08517e-07 -5.95879e-07 + -5.83241e-07 -5.70604e-07 -5.57966e-07 -5.45328e-07 -5.3269e-07 + -5.20053e-07 -5.07415e-07 -4.94777e-07 -4.8214e-07 -4.69502e-07 + -4.56864e-07 -4.44226e-07 -4.31589e-07 -4.18951e-07 -4.06313e-07 + -3.93676e-07 -3.81038e-07 -3.684e-07 -3.55762e-07 -3.43125e-07 + 1.06736e-05 0.0797407 0.0437947 -0.0645098 -0.0877312 0.0653203 + -0.00621184 -0.0353188 -0.0491378 -0.0251957 -0.0110996 + -0.00481123 -0.0020941 -0.000998038 -0.000478747 -0.000445332 + -0.102046 -0.135753 -0.154351 -0.0827509 0.163348 0.174012 + 0.0794822 0.0310624 0.0112213 0.00249061 0.00130764 0.00181315 + 0.00163875 0.00101454 0.000497435 0.000195258 5.31901e-05 + 2.4607e-05 6.62736e-05 7.90718e-05 4.0372e-05 -0.000141184 + -0.000280623 5.5608e-05 0.000799565 0.000920189 0.000931616 + 0.000494527 0.000162303 -8.24884e-05 -0.000183938 -0.000203899 + -0.000144788 -9.87063e-05 -0.000227929 2.93932e-05 0.000208563 + 1.88958e-06 -7.6335e-05 -0.000172472 -0.000165656 -0.000145889 + -0.000177311 -0.000191058 -0.000168287 -0.00015755 -0.00013142 + -8.10488e-05 -6.36115e-05 -7.8699e-05 -8.11282e-05 -7.98625e-05 + -5.98807e-05 -3.40879e-05 -1.95464e-05 -1.79247e-05 -4.45514e-05 + -7.47995e-05 -8.7682e-05 -7.50806e-05 -3.25561e-05 -4.34114e-05 + -7.69099e-05 -0.000141101 -0.00018743 -0.000148471 -5.06546e-05 + 0.000120195 0.000177635 0.000177052 0.000146344 9.75126e-05 + 8.31233e-05 6.8734e-05 5.43447e-05 3.99554e-05 2.55661e-05 + 1.11768e-05 -3.21253e-06 -3.88937e-06 -3.56628e-06 -3.24318e-06 + -2.92008e-06 -2.59699e-06 -2.27389e-06 -1.9508e-06 -1.73227e-06 + -1.56796e-06 -1.40365e-06 -1.23934e-06 -1.07503e-06 -9.10722e-07 + -7.46412e-07 -5.82101e-07 -4.1779e-07 -2.5348e-07 -8.91694e-08 + 7.51412e-08 2.39452e-07 4.03762e-07 5.95733e-07 1.00771e-06 + 1.41969e-06 1.83167e-06 2.24365e-06 0.0828257 0.231038 0.465438 + 1.54516 2.8461 3.19221 3.40395 3.6382 3.80758 3.93848 4.04882 + 4.15428 4.247 4.32917 4.40235 4.36941 4.397 4.48862 4.64552 + 4.86595 5.03475 5.0348 5.02627 5.01967 5.01542 5.00925 4.98613 + 4.9519 4.91581 4.87357 4.82302 4.80403 4.82565 4.86102 4.89483 + 4.92253 4.94428 4.96257 4.97608 4.98373 4.98823 4.99182 + 4.99437 4.99635 4.99745 4.99802 4.99843 4.99873 4.99895 + 4.99912 4.99925 4.99931 4.99962 4.99973 4.99972 4.99971 + 4.9997 4.99969 4.9997 4.99971 4.99973 4.99974 4.99976 4.99978 + 4.9998 4.99982 4.99985 4.99987 4.99989 4.9999 4.99991 4.99991 + 4.99993 4.99994 4.99997 5.00001 5.00006 5.00008 5.00006 + 5.00002 5 4.99999 4.99998 4.99997 4.99995 4.99995 4.99995 + 4.99995 4.99995 4.99995 4.99995 4.99996 4.99997 4.99997 + 4.99998 4.99999 5 5 5.00001 5.00002 5.00002 5.00002 5.00002 + 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001 + 5.00001 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999 EOD @v[15].set(<<-'EOD') - 1.86175 2.00199 2.08919 1.84314 1.08254 0.214737 0.0377351 - 0.00952455 0.00232763 0.000563614 0.000263477 0.000148642 - 0.000285086 0.000242592 7.34699e-05 -1.53467e-05 -0.0161874 - -0.0157876 -0.0141194 0.0132576 0.0903272 0.109938 0.0535295 - 0.0224216 0.00940945 0.00466825 -0.000649972 -0.00654752 - -0.00333248 -0.00103671 -0.000508276 -5.8896e-05 -0.00043938 - -0.000544704 -0.00044444 -0.000307093 -0.00024517 -0.000154538 - -8.78602e-05 -7.10461e-05 -6.06485e-05 -3.91039e-05 -8.45988e-06 - 9.43442e-06 1.28351e-05 -2.16734e-06 -2.6142e-05 -2.54768e-05 - -1.88997e-05 -1.17906e-05 -7.3808e-06 -2.97101e-06 1.19146e-07 - 2.94246e-06 5.38942e-06 3.88851e-06 2.38761e-06 8.86704e-07 - -6.14201e-07 -2.11511e-06 -2.59565e-06 -2.38885e-06 -2.18205e-06 - -1.97525e-06 -1.76845e-06 -1.56241e-06 -1.36258e-06 -1.16276e-06 - -9.62939e-07 -7.63116e-07 -5.63293e-07 -3.6347e-07 -1.63647e-07 - 3.61756e-08 2.35999e-07 4.35822e-07 6.07653e-07 5.90323e-07 - 5.72994e-07 5.55665e-07 5.38336e-07 5.21007e-07 5.03678e-07 - 4.86349e-07 4.6902e-07 4.51691e-07 4.34361e-07 4.11899e-07 - 3.60315e-07 3.08731e-07 2.57146e-07 2.05562e-07 1.53977e-07 - 1.02393e-07 5.08082e-08 -7.76222e-10 -5.23607e-08 -1.03945e-07 - -1.47815e-07 -1.54225e-07 -1.60635e-07 -1.67045e-07 -1.73455e-07 - -1.79864e-07 -1.86274e-07 -1.92684e-07 -1.99094e-07 -2.05504e-07 - -2.11914e-07 -2.18324e-07 -2.24734e-07 -2.31144e-07 -2.37554e-07 - -2.43964e-07 -2.50373e-07 -2.56783e-07 -2.63193e-07 -2.69603e-07 - -2.76013e-07 -2.82423e-07 2.92534e-06 0.0446777 0.024278 - -0.0518987 -0.0636547 0.00983929 -0.000518204 -0.000265194 - 0.000154772 0.000299538 3.12715e-05 -3.18225e-05 -2.48268e-05 - -1.16701e-05 -6.05117e-06 7.61116e-06 -0.0163668 -0.0158244 - -0.0141177 0.0100085 0.0857144 0.107784 0.051862 0.0204448 - 0.00629858 0.000967736 0.00121674 0.00190276 0.00154009 - 0.000860922 0.000410386 0.000164585 3.99493e-05 1.93797e-05 - 5.67594e-05 0.000110126 2.49925e-05 -7.17815e-05 -0.000142299 - -1.63109e-05 0.000439529 0.000562489 0.000594599 0.000326164 - 0.000126423 -4.26063e-05 -0.000122927 -0.000114152 -6.72706e-05 - -6.41242e-05 -0.000135588 2.61507e-05 0.000134036 6.43734e-06 - -4.6223e-05 -0.000112047 -0.000101388 -8.67847e-05 -0.000117664 - -0.000133957 -0.000116558 -0.000100873 -7.65448e-05 -4.44964e-05 - -3.6677e-05 -5.26632e-05 -5.45172e-05 -5.13545e-05 -3.73869e-05 - -1.99732e-05 -1.0907e-05 -1.10081e-05 -3.02609e-05 -5.18517e-05 - -6.13597e-05 -5.30706e-05 -2.39572e-05 -3.24146e-05 -5.70062e-05 - -0.000103448 -0.000135376 -0.0001024 -2.39007e-05 0.000110929 - 0.000151226 0.000142044 0.000105922 5.62834e-05 4.78476e-05 - 3.94117e-05 3.09759e-05 2.25401e-05 1.41042e-05 5.66837e-06 - -2.76747e-06 -3.08639e-06 -2.81341e-06 -2.54043e-06 -2.26745e-06 - -1.99447e-06 -1.72149e-06 -1.44851e-06 -1.26226e-06 -1.12096e-06 - -9.79661e-07 -8.38363e-07 -6.97065e-07 -5.55768e-07 -4.1447e-07 - -2.73173e-07 -1.31875e-07 9.42259e-09 1.5072e-07 2.92018e-07 - 4.33315e-07 5.74613e-07 7.10363e-07 8.01984e-07 8.93604e-07 - 9.85225e-07 1.07685e-06 0.04474 0.0928765 0.141327 0.0176048 - -0.071675 -0.0124613 0.989022 2.28104 3.40619 4.21417 4.67173 - 4.87438 4.96044 4.98996 4.99858 4.96672 4.89502 4.79391 - 4.76433 4.8387 4.98612 5.0161 5.01722 5.01437 5.01256 4.99827 - 4.95807 4.9209 4.88217 4.83006 4.78461 4.80759 4.85548 4.89604 - 4.9254 4.94617 4.96126 4.97374 4.98255 4.98792 4.99126 4.99361 - 4.99554 4.99699 4.99792 4.99846 4.99881 4.99905 4.99924 - 4.99938 4.99949 4.99955 4.9997 4.9998 4.99982 4.99982 4.99982 - 4.99982 4.99982 4.99983 4.99984 4.99985 4.99986 4.99987 - 4.99988 4.99989 4.9999 4.99992 4.99993 4.99994 4.99995 4.99995 - 4.99996 4.99996 4.99998 4.99999 5.00001 5.00002 5.00002 - 5.00001 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99998 - 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 - 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 1.86175 2.00199 2.08919 1.84314 1.08254 0.214737 0.0377351 + 0.00952455 0.00232763 0.000563614 0.000263477 0.000148642 + 0.000285086 0.000242592 7.34699e-05 -1.53467e-05 -0.0161874 + -0.0157876 -0.0141194 0.0132576 0.0903272 0.109938 0.0535295 + 0.0224216 0.00940945 0.00466825 -0.000649972 -0.00654752 + -0.00333248 -0.00103671 -0.000508276 -5.8896e-05 -0.00043938 + -0.000544704 -0.00044444 -0.000307093 -0.00024517 -0.000154538 + -8.78602e-05 -7.10461e-05 -6.06485e-05 -3.91039e-05 -8.45988e-06 + 9.43442e-06 1.28351e-05 -2.16734e-06 -2.6142e-05 -2.54768e-05 + -1.88997e-05 -1.17906e-05 -7.3808e-06 -2.97101e-06 1.19146e-07 + 2.94246e-06 5.38942e-06 3.88851e-06 2.38761e-06 8.86704e-07 + -6.14201e-07 -2.11511e-06 -2.59565e-06 -2.38885e-06 -2.18205e-06 + -1.97525e-06 -1.76845e-06 -1.56241e-06 -1.36258e-06 -1.16276e-06 + -9.62939e-07 -7.63116e-07 -5.63293e-07 -3.6347e-07 -1.63647e-07 + 3.61756e-08 2.35999e-07 4.35822e-07 6.07653e-07 5.90323e-07 + 5.72994e-07 5.55665e-07 5.38336e-07 5.21007e-07 5.03678e-07 + 4.86349e-07 4.6902e-07 4.51691e-07 4.34361e-07 4.11899e-07 + 3.60315e-07 3.08731e-07 2.57146e-07 2.05562e-07 1.53977e-07 + 1.02393e-07 5.08082e-08 -7.76222e-10 -5.23607e-08 -1.03945e-07 + -1.47815e-07 -1.54225e-07 -1.60635e-07 -1.67045e-07 -1.73455e-07 + -1.79864e-07 -1.86274e-07 -1.92684e-07 -1.99094e-07 -2.05504e-07 + -2.11914e-07 -2.18324e-07 -2.24734e-07 -2.31144e-07 -2.37554e-07 + -2.43964e-07 -2.50373e-07 -2.56783e-07 -2.63193e-07 -2.69603e-07 + -2.76013e-07 -2.82423e-07 2.92534e-06 0.0446777 0.024278 + -0.0518987 -0.0636547 0.00983929 -0.000518204 -0.000265194 + 0.000154772 0.000299538 3.12715e-05 -3.18225e-05 -2.48268e-05 + -1.16701e-05 -6.05117e-06 7.61116e-06 -0.0163668 -0.0158244 + -0.0141177 0.0100085 0.0857144 0.107784 0.051862 0.0204448 + 0.00629858 0.000967736 0.00121674 0.00190276 0.00154009 + 0.000860922 0.000410386 0.000164585 3.99493e-05 1.93797e-05 + 5.67594e-05 0.000110126 2.49925e-05 -7.17815e-05 -0.000142299 + -1.63109e-05 0.000439529 0.000562489 0.000594599 0.000326164 + 0.000126423 -4.26063e-05 -0.000122927 -0.000114152 -6.72706e-05 + -6.41242e-05 -0.000135588 2.61507e-05 0.000134036 6.43734e-06 + -4.6223e-05 -0.000112047 -0.000101388 -8.67847e-05 -0.000117664 + -0.000133957 -0.000116558 -0.000100873 -7.65448e-05 -4.44964e-05 + -3.6677e-05 -5.26632e-05 -5.45172e-05 -5.13545e-05 -3.73869e-05 + -1.99732e-05 -1.0907e-05 -1.10081e-05 -3.02609e-05 -5.18517e-05 + -6.13597e-05 -5.30706e-05 -2.39572e-05 -3.24146e-05 -5.70062e-05 + -0.000103448 -0.000135376 -0.0001024 -2.39007e-05 0.000110929 + 0.000151226 0.000142044 0.000105922 5.62834e-05 4.78476e-05 + 3.94117e-05 3.09759e-05 2.25401e-05 1.41042e-05 5.66837e-06 + -2.76747e-06 -3.08639e-06 -2.81341e-06 -2.54043e-06 -2.26745e-06 + -1.99447e-06 -1.72149e-06 -1.44851e-06 -1.26226e-06 -1.12096e-06 + -9.79661e-07 -8.38363e-07 -6.97065e-07 -5.55768e-07 -4.1447e-07 + -2.73173e-07 -1.31875e-07 9.42259e-09 1.5072e-07 2.92018e-07 + 4.33315e-07 5.74613e-07 7.10363e-07 8.01984e-07 8.93604e-07 + 9.85225e-07 1.07685e-06 0.04474 0.0928765 0.141327 0.0176048 + -0.071675 -0.0124613 0.989022 2.28104 3.40619 4.21417 4.67173 + 4.87438 4.96044 4.98996 4.99858 4.96672 4.89502 4.79391 + 4.76433 4.8387 4.98612 5.0161 5.01722 5.01437 5.01256 4.99827 + 4.95807 4.9209 4.88217 4.83006 4.78461 4.80759 4.85548 4.89604 + 4.9254 4.94617 4.96126 4.97374 4.98255 4.98792 4.99126 4.99361 + 4.99554 4.99699 4.99792 4.99846 4.99881 4.99905 4.99924 + 4.99938 4.99949 4.99955 4.9997 4.9998 4.99982 4.99982 4.99982 + 4.99982 4.99982 4.99983 4.99984 4.99985 4.99986 4.99987 + 4.99988 4.99989 4.9999 4.99992 4.99993 4.99994 4.99995 4.99995 + 4.99996 4.99996 4.99998 4.99999 5.00001 5.00002 5.00002 + 5.00001 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99998 + 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 + 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 EOD @v[16].set(<<-'EOD') - 1.86175 1.73073 1.50572 1.89001 3.39004 4.36034 4.79012 - 4.93798 4.98305 4.99539 4.9979 4.99904 4.99772 4.9983 4.99935 - 4.99975 4.98837 4.99456 4.99728 5.01838 5.04568 5.00759 - 4.98112 4.98479 4.99197 4.99641 4.99747 4.99775 5.00043 - 5.0007 5.00035 5.00023 4.99976 5.00002 5.00007 5.0002 4.99993 - 5.00003 5.00021 5.00006 4.99993 4.99992 5.00002 5.00013 - 5.00017 5.00009 4.99992 4.99991 4.99993 4.99996 4.99998 - 4.99999 5.00001 5.00003 5.00005 5.00004 5.00004 5.00003 - 5.00002 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99997 - 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 - 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 5 5.01498 4.99342 4.96899 5.00301 5.02627 4.9977 - 4.99548 4.99757 5.00277 5.00245 5.0014 5.00069 5.00032 5.00014 - 5.00009 4.9867 4.99262 4.99607 5.01805 5.04713 5.00927 4.98184 - 4.98483 4.9914 4.99616 4.99902 4.9999 4.99987 4.99979 4.99981 - 4.99989 4.99994 4.99998 5.0002 5.00001 5.00008 5.00008 5.0001 - 5.00021 5.00032 5.00025 5.00019 5.00006 5.00007 4.99994 - 4.99997 4.99999 5.00023 5.00008 4.99993 4.99998 4.99986 - 4.99982 5.00003 4.99985 4.99996 5.00014 5 4.99984 4.99979 - 4.99982 4.99993 5.00008 5.00011 5.00002 4.99996 4.9999 4.99994 - 5.00001 5.00007 5.00009 4.99995 4.99978 4.99971 4.99976 - 4.99997 4.99996 4.99989 4.99972 4.99955 4.99953 4.99959 - 4.99976 4.9999 5.00005 5.00023 5.00039 5.00034 5.00029 5.00024 - 5.00019 5.00014 5.00009 5.00004 5.00003 5.00002 5.00001 - 5 5 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 - 5.00001 5.00002 5.00003 5.00004 5.01564 5.03395 5.04932 - 5.11868 3.92502 1.31888 0.163888 0.0946876 0.0789578 0.0565084 - 0.0260333 0.0156986 0.00907667 0.00613629 0.00468417 -0.00174008 - -0.0021422 0.000586962 0.0124937 0.0147977 0.00838454 0.00039383 - -0.000522021 -0.000426598 -0.000290214 -0.00173713 -0.00384132 - -0.00382945 -0.00429219 -0.00580193 -0.00393246 0.0017543 - 0.00423045 0.00408931 0.0031976 0.00245457 0.00187293 0.00159068 - 0.00105697 0.000609902 0.000358825 0.000334125 0.000212708 - 0.000168116 8.97349e-05 5.21578e-05 3.84527e-05 2.93033e-05 - 2.10067e-05 1.59954e-05 1.13917e-05 5.49738e-06 2.77217e-05 - 6.51259e-06 -6.65468e-06 2.09837e-06 -6.617e-06 -4.80187e-06 - 1.55031e-06 4.26536e-06 7.69457e-07 -1.46213e-06 -7.25202e-07 - 3.26501e-06 6.55807e-06 7.524e-06 6.07209e-06 6.00701e-06 - 5.41166e-06 3.86573e-06 1.10651e-06 -2.74603e-06 -2.18566e-06 - 2.3658e-06 8.59956e-06 8.35046e-06 2.90621e-06 -8.75982e-07 - -1.87189e-06 -2.1528e-06 -1.94875e-06 -1.74471e-06 -1.54067e-06 - -1.33662e-06 -1.13258e-06 -8.40567e-07 -5.20743e-07 -2.00918e-07 - 1.18906e-07 4.38731e-07 6.11382e-07 6.01529e-07 5.91675e-07 - 5.81822e-07 5.71968e-07 5.62115e-07 5.52261e-07 5.42407e-07 - 5.32554e-07 5.227e-07 5.12847e-07 4.72812e-07 4.26137e-07 - 3.79462e-07 3.32786e-07 2.86111e-07 2.39436e-07 1.92761e-07 - 1.46086e-07 9.94107e-08 5.27356e-08 -2.77779e-10 -7.98079e-08 - -1.59338e-07 -2.38868e-07 -3.18398e-07 -3.97928e-07 -4.77458e-07 - -5.56988e-07 -6.36519e-07 + 1.86175 1.73073 1.50572 1.89001 3.39004 4.36034 4.79012 + 4.93798 4.98305 4.99539 4.9979 4.99904 4.99772 4.9983 4.99935 + 4.99975 4.98837 4.99456 4.99728 5.01838 5.04568 5.00759 + 4.98112 4.98479 4.99197 4.99641 4.99747 4.99775 5.00043 + 5.0007 5.00035 5.00023 4.99976 5.00002 5.00007 5.0002 4.99993 + 5.00003 5.00021 5.00006 4.99993 4.99992 5.00002 5.00013 + 5.00017 5.00009 4.99992 4.99991 4.99993 4.99996 4.99998 + 4.99999 5.00001 5.00003 5.00005 5.00004 5.00004 5.00003 + 5.00002 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99997 + 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 + 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 5 5.01498 4.99342 4.96899 5.00301 5.02627 4.9977 + 4.99548 4.99757 5.00277 5.00245 5.0014 5.00069 5.00032 5.00014 + 5.00009 4.9867 4.99262 4.99607 5.01805 5.04713 5.00927 4.98184 + 4.98483 4.9914 4.99616 4.99902 4.9999 4.99987 4.99979 4.99981 + 4.99989 4.99994 4.99998 5.0002 5.00001 5.00008 5.00008 5.0001 + 5.00021 5.00032 5.00025 5.00019 5.00006 5.00007 4.99994 + 4.99997 4.99999 5.00023 5.00008 4.99993 4.99998 4.99986 + 4.99982 5.00003 4.99985 4.99996 5.00014 5 4.99984 4.99979 + 4.99982 4.99993 5.00008 5.00011 5.00002 4.99996 4.9999 4.99994 + 5.00001 5.00007 5.00009 4.99995 4.99978 4.99971 4.99976 + 4.99997 4.99996 4.99989 4.99972 4.99955 4.99953 4.99959 + 4.99976 4.9999 5.00005 5.00023 5.00039 5.00034 5.00029 5.00024 + 5.00019 5.00014 5.00009 5.00004 5.00003 5.00002 5.00001 + 5 5 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 + 5.00001 5.00002 5.00003 5.00004 5.01564 5.03395 5.04932 + 5.11868 3.92502 1.31888 0.163888 0.0946876 0.0789578 0.0565084 + 0.0260333 0.0156986 0.00907667 0.00613629 0.00468417 -0.00174008 + -0.0021422 0.000586962 0.0124937 0.0147977 0.00838454 0.00039383 + -0.000522021 -0.000426598 -0.000290214 -0.00173713 -0.00384132 + -0.00382945 -0.00429219 -0.00580193 -0.00393246 0.0017543 + 0.00423045 0.00408931 0.0031976 0.00245457 0.00187293 0.00159068 + 0.00105697 0.000609902 0.000358825 0.000334125 0.000212708 + 0.000168116 8.97349e-05 5.21578e-05 3.84527e-05 2.93033e-05 + 2.10067e-05 1.59954e-05 1.13917e-05 5.49738e-06 2.77217e-05 + 6.51259e-06 -6.65468e-06 2.09837e-06 -6.617e-06 -4.80187e-06 + 1.55031e-06 4.26536e-06 7.69457e-07 -1.46213e-06 -7.25202e-07 + 3.26501e-06 6.55807e-06 7.524e-06 6.07209e-06 6.00701e-06 + 5.41166e-06 3.86573e-06 1.10651e-06 -2.74603e-06 -2.18566e-06 + 2.3658e-06 8.59956e-06 8.35046e-06 2.90621e-06 -8.75982e-07 + -1.87189e-06 -2.1528e-06 -1.94875e-06 -1.74471e-06 -1.54067e-06 + -1.33662e-06 -1.13258e-06 -8.40567e-07 -5.20743e-07 -2.00918e-07 + 1.18906e-07 4.38731e-07 6.11382e-07 6.01529e-07 5.91675e-07 + 5.81822e-07 5.71968e-07 5.62115e-07 5.52261e-07 5.42407e-07 + 5.32554e-07 5.227e-07 5.12847e-07 4.72812e-07 4.26137e-07 + 3.79462e-07 3.32786e-07 2.86111e-07 2.39436e-07 1.92761e-07 + 1.46086e-07 9.94107e-08 5.27356e-08 -2.77779e-10 -7.98079e-08 + -1.59338e-07 -2.38868e-07 -3.18398e-07 -3.97928e-07 -4.77458e-07 + -5.56988e-07 -6.36519e-07 EOD @v[17].set(<<-'EOD') - 5 5.16963 4.84136 3.33754 0.316206 0.103113 0.0273341 0.0221102 - 0.0177008 0.0143758 0.0115203 0.00929231 0.00752716 0.00625439 - 0.00489872 0.00403656 -0.0657317 -0.0256467 0.165394 0.985963 - 3.05067 4.55799 4.89728 4.92464 4.8882 4.90592 4.97315 4.99241 - 4.99694 4.99845 4.99905 4.99939 4.99959 4.99971 4.9998 4.99986 - 4.9999 4.99993 4.99995 4.99996 4.99997 4.99998 4.99998 4.99999 - 4.99999 4.99999 4.99999 4.99999 5 5.00001 5.00003 5.00005 - 5.00004 5.00002 5 4.99999 4.99999 4.99998 4.99998 4.99997 - 4.99997 4.99998 4.99998 4.99999 4.99999 5 5 5 5 5 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 - 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998 - 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 5 5 5 5 5 5 5.00025 5.1657 4.69981 2.43895 - 0.0229743 0.0351406 -0.0211974 -0.0312063 -0.0160331 -0.0021718 - -0.000766597 -0.000251052 -5.49363e-05 -3.36364e-06 -2.01983e-06 - -9.70575e-06 -0.0657007 -0.0205247 0.183332 1.07163 3.11839 - 4.46213 4.84163 4.95195 4.99159 5.02084 5.04029 5.04138 - 5.0271 5.00445 4.97957 4.95702 4.95231 4.97819 4.99191 4.9963 - 4.99822 4.99878 4.99903 4.99925 4.99942 4.9995 4.99954 4.99957 - 4.99961 4.99966 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986 - 4.99988 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995 4.99996 - 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001 - 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 - 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.14239 4.76219 - 3.16574 0.299969 0.0631609 -0.00118611 -0.00026052 -5.96333e-05 - -1.44904e-05 -4.3859e-06 -2.99454e-06 1.10547e-06 4.84662e-06 - 1.30971e-05 2.23082e-05 -0.0655844 -0.0204818 0.182507 1.05954 - 3.12277 4.46735 4.83915 4.94512 4.97679 4.98654 4.9966 5.00833 - 5.00776 5.00432 5.00199 5.00086 5.00033 5.00008 5 5.00001 - 5 5.00005 5.00002 4.99981 4.99991 4.99998 4.99979 4.99979 - 4.99984 4.9998 4.9998 5.00006 5.00002 5.00001 5 5 4.99992 - 4.99998 4.99999 5.00002 5.00014 4.99999 4.99987 4.99993 - 5.00003 5.00011 5.00005 4.99996 4.99987 4.99985 4.99994 - 5.00009 5.0001 5 4.99993 4.99997 5.00008 5.00015 5.00021 - 5.00021 5.00007 4.99978 4.99965 4.99973 4.9999 4.99992 4.99995 - 4.99997 4.99999 5.00001 5.00002 5.00001 5.00001 5.00001 - 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001 5.00002 - 5.00002 5.00002 + 5 5.16963 4.84136 3.33754 0.316206 0.103113 0.0273341 0.0221102 + 0.0177008 0.0143758 0.0115203 0.00929231 0.00752716 0.00625439 + 0.00489872 0.00403656 -0.0657317 -0.0256467 0.165394 0.985963 + 3.05067 4.55799 4.89728 4.92464 4.8882 4.90592 4.97315 4.99241 + 4.99694 4.99845 4.99905 4.99939 4.99959 4.99971 4.9998 4.99986 + 4.9999 4.99993 4.99995 4.99996 4.99997 4.99998 4.99998 4.99999 + 4.99999 4.99999 4.99999 4.99999 5 5.00001 5.00003 5.00005 + 5.00004 5.00002 5 4.99999 4.99999 4.99998 4.99998 4.99997 + 4.99997 4.99998 4.99998 4.99999 4.99999 5 5 5 5 5 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 + 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998 + 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 5 5 5 5 5 5 5.00025 5.1657 4.69981 2.43895 + 0.0229743 0.0351406 -0.0211974 -0.0312063 -0.0160331 -0.0021718 + -0.000766597 -0.000251052 -5.49363e-05 -3.36364e-06 -2.01983e-06 + -9.70575e-06 -0.0657007 -0.0205247 0.183332 1.07163 3.11839 + 4.46213 4.84163 4.95195 4.99159 5.02084 5.04029 5.04138 + 5.0271 5.00445 4.97957 4.95702 4.95231 4.97819 4.99191 4.9963 + 4.99822 4.99878 4.99903 4.99925 4.99942 4.9995 4.99954 4.99957 + 4.99961 4.99966 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986 + 4.99988 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995 4.99996 + 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001 + 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 + 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.14239 4.76219 + 3.16574 0.299969 0.0631609 -0.00118611 -0.00026052 -5.96333e-05 + -1.44904e-05 -4.3859e-06 -2.99454e-06 1.10547e-06 4.84662e-06 + 1.30971e-05 2.23082e-05 -0.0655844 -0.0204818 0.182507 1.05954 + 3.12277 4.46735 4.83915 4.94512 4.97679 4.98654 4.9966 5.00833 + 5.00776 5.00432 5.00199 5.00086 5.00033 5.00008 5 5.00001 + 5 5.00005 5.00002 4.99981 4.99991 4.99998 4.99979 4.99979 + 4.99984 4.9998 4.9998 5.00006 5.00002 5.00001 5 5 4.99992 + 4.99998 4.99999 5.00002 5.00014 4.99999 4.99987 4.99993 + 5.00003 5.00011 5.00005 4.99996 4.99987 4.99985 4.99994 + 5.00009 5.0001 5 4.99993 4.99997 5.00008 5.00015 5.00021 + 5.00021 5.00007 4.99978 4.99965 4.99973 4.9999 4.99992 4.99995 + 4.99997 4.99999 5.00001 5.00002 5.00001 5.00001 5.00001 + 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001 5.00002 + 5.00002 5.00002 EOD @v[18].set(<<-'EOD') - 5 5.0333 5.02472 4.92559 4.18383 3.93923 3.9961 4.14293 - 4.28591 4.41336 4.52157 4.61101 4.68472 4.7439 4.79294 4.83239 - 4.80697 4.78808 4.79322 4.8838 5.08529 5.21863 4.88852 3.90198 - 2.14586 0.383977 0.101103 0.0525711 0.0318287 0.020895 0.0146908 - 0.010831 0.00830272 0.00656377 0.00532066 0.00440078 0.00369956 - 0.00315713 0.00272614 0.00237965 0.00209659 0.00186339 0.00167014 - 0.0015081 0.00137172 0.00125607 0.00115393 0.00106076 0.000980166 - 0.000918015 0.000862837 0.00080766 0.000763488 0.000721541 - 0.000680825 0.000653026 0.000625226 0.000597426 0.000569627 - 0.000541827 0.000519087 0.000499756 0.000480424 0.000461093 - 0.000441761 0.000423291 0.000411941 0.00040059 0.00038924 - 0.000377889 0.000366539 0.000355188 0.000343838 0.000332487 - 0.000321137 0.000309786 0.000299055 0.000292509 0.000285963 - 0.000279417 0.000272871 0.000266325 0.000259779 0.000253233 - 0.000246686 0.00024014 0.000233594 0.000227387 0.0002231 - 0.000218813 0.000214526 0.00021024 0.000205953 0.000201666 - 0.000197379 0.000193092 0.000188805 0.000184519 0.000180526 - 0.000177963 0.0001754 0.000172837 0.000170274 0.000167711 - 0.000165148 0.000162585 0.000160022 0.000157459 0.000154895 - 0.000152332 0.000149769 0.000147206 0.000144643 0.00014208 - 0.000139517 0.000136954 0.000134391 0.000131828 0.000129265 - 0.000126702 0.000132838 0.0311184 0.163151 0.34986 0.604501 - 0.357125 0.136137 0.0711304 0.0346959 0.0212674 0.00872193 - 0.00252206 0.000455269 7.59332e-05 2.91532e-05 0.000320562 - -0.0720911 -0.0840491 -0.0791345 -0.0404143 0.0182035 -0.0235871 - -0.0426072 -0.0597501 0.00824773 0.481404 1.32496 2.11949 - 2.57317 2.58202 2.15054 1.33786 0.45702 0.153772 0.0913584 - 0.0604989 0.0421591 0.0271456 0.0170021 0.0115815 0.00907886 - 0.00742466 0.00626096 0.00531127 0.00450501 0.00381927 0.00323718 - 0.00274374 0.00232494 0.00196885 0.00166686 0.00141134 0.00119437 - 0.0010109 0.000855534 0.000723378 0.000611408 0.000516704 - 0.000436769 0.000369523 0.000313026 0.00026526 0.000223976 - 0.000188972 0.000159042 0.000134148 0.000112688 9.49738e-05 - 7.97877e-05 6.721e-05 5.65115e-05 4.77194e-05 4.03591e-05 - 3.42848e-05 2.92627e-05 2.50435e-05 2.1412e-05 1.84532e-05 - 1.58624e-05 1.34673e-05 1.14461e-05 1.00935e-05 9.12375e-06 - 8.50202e-06 7.81431e-06 7.20729e-06 6.73936e-06 6.3702e-06 - 5.90049e-06 5.43077e-06 4.96105e-06 4.49133e-06 4.02162e-06 - 3.5519e-06 3.08218e-06 2.79099e-06 2.51281e-06 2.23463e-06 - 1.95645e-06 1.67827e-06 1.40009e-06 1.12191e-06 1.01376e-06 - 9.9375e-07 9.73741e-07 9.53733e-07 9.33724e-07 9.13715e-07 - 8.93707e-07 8.73698e-07 8.5369e-07 8.33681e-07 8.13673e-07 - 7.93664e-07 7.73655e-07 7.53647e-07 7.21781e-07 5.956e-07 - 4.69419e-07 3.43239e-07 2.17058e-07 0.0284032 0.0374438 - -0.0157543 -0.0680497 0.0504768 0.0100294 0.00222261 0.000528697 - 0.000132929 3.99489e-05 2.46066e-05 4.56327e-06 -6.54853e-06 - 1.33783e-05 -3.68221e-05 -0.0724498 -0.0843663 -0.0792935 - -0.0406426 0.0200019 0.0426259 0.0220753 0.00668555 -0.000968483 - 0.024662 0.0383437 0.0911513 0.087848 0.0602076 0.0390559 - 0.0260573 0.0180444 0.012974 0.00985409 0.00788132 0.0064228 - 0.005545 0.00453571 0.00364245 0.00310278 0.00270523 0.00236439 - 0.0020945 0.00186808 0.00167493 0.00151731 0.00138594 0.00126945 - 0.00116695 0.0010762 0.000996366 0.000928387 0.000864414 - 0.000808258 0.000759574 0.000713865 0.000666712 0.000632716 - 0.000601262 0.000572163 0.000543986 0.000515253 0.0004897 - 0.000468112 0.000449313 0.000432981 0.000417911 0.000401307 - 0.000382712 0.000366678 0.000355736 0.000349171 0.000335727 - 0.000317091 0.000296086 0.000283543 0.000277366 0.000272233 - 0.000267001 0.000263147 0.000256699 0.000250251 0.000243803 - 0.000237355 0.000230907 0.000225424 0.000220247 0.000215069 - 0.000209892 0.000204714 0.000200213 0.000196548 0.000192884 - 0.00018922 0.000185556 0.000181892 0.000178228 0.000174564 - 0.0001709 0.000167236 0.000163572 0.000160824 0.000158279 - 0.000155733 0.000153187 0.000150641 0.000148095 0.000145549 - 0.000143003 0.000140457 0.000137911 0.000135457 0.000133386 - 0.000131315 0.000129245 0.000127174 0.000125103 0.000123032 - 0.000120961 0.000118891 + 5 5.0333 5.02472 4.92559 4.18383 3.93923 3.9961 4.14293 + 4.28591 4.41336 4.52157 4.61101 4.68472 4.7439 4.79294 4.83239 + 4.80697 4.78808 4.79322 4.8838 5.08529 5.21863 4.88852 3.90198 + 2.14586 0.383977 0.101103 0.0525711 0.0318287 0.020895 0.0146908 + 0.010831 0.00830272 0.00656377 0.00532066 0.00440078 0.00369956 + 0.00315713 0.00272614 0.00237965 0.00209659 0.00186339 0.00167014 + 0.0015081 0.00137172 0.00125607 0.00115393 0.00106076 0.000980166 + 0.000918015 0.000862837 0.00080766 0.000763488 0.000721541 + 0.000680825 0.000653026 0.000625226 0.000597426 0.000569627 + 0.000541827 0.000519087 0.000499756 0.000480424 0.000461093 + 0.000441761 0.000423291 0.000411941 0.00040059 0.00038924 + 0.000377889 0.000366539 0.000355188 0.000343838 0.000332487 + 0.000321137 0.000309786 0.000299055 0.000292509 0.000285963 + 0.000279417 0.000272871 0.000266325 0.000259779 0.000253233 + 0.000246686 0.00024014 0.000233594 0.000227387 0.0002231 + 0.000218813 0.000214526 0.00021024 0.000205953 0.000201666 + 0.000197379 0.000193092 0.000188805 0.000184519 0.000180526 + 0.000177963 0.0001754 0.000172837 0.000170274 0.000167711 + 0.000165148 0.000162585 0.000160022 0.000157459 0.000154895 + 0.000152332 0.000149769 0.000147206 0.000144643 0.00014208 + 0.000139517 0.000136954 0.000134391 0.000131828 0.000129265 + 0.000126702 0.000132838 0.0311184 0.163151 0.34986 0.604501 + 0.357125 0.136137 0.0711304 0.0346959 0.0212674 0.00872193 + 0.00252206 0.000455269 7.59332e-05 2.91532e-05 0.000320562 + -0.0720911 -0.0840491 -0.0791345 -0.0404143 0.0182035 -0.0235871 + -0.0426072 -0.0597501 0.00824773 0.481404 1.32496 2.11949 + 2.57317 2.58202 2.15054 1.33786 0.45702 0.153772 0.0913584 + 0.0604989 0.0421591 0.0271456 0.0170021 0.0115815 0.00907886 + 0.00742466 0.00626096 0.00531127 0.00450501 0.00381927 0.00323718 + 0.00274374 0.00232494 0.00196885 0.00166686 0.00141134 0.00119437 + 0.0010109 0.000855534 0.000723378 0.000611408 0.000516704 + 0.000436769 0.000369523 0.000313026 0.00026526 0.000223976 + 0.000188972 0.000159042 0.000134148 0.000112688 9.49738e-05 + 7.97877e-05 6.721e-05 5.65115e-05 4.77194e-05 4.03591e-05 + 3.42848e-05 2.92627e-05 2.50435e-05 2.1412e-05 1.84532e-05 + 1.58624e-05 1.34673e-05 1.14461e-05 1.00935e-05 9.12375e-06 + 8.50202e-06 7.81431e-06 7.20729e-06 6.73936e-06 6.3702e-06 + 5.90049e-06 5.43077e-06 4.96105e-06 4.49133e-06 4.02162e-06 + 3.5519e-06 3.08218e-06 2.79099e-06 2.51281e-06 2.23463e-06 + 1.95645e-06 1.67827e-06 1.40009e-06 1.12191e-06 1.01376e-06 + 9.9375e-07 9.73741e-07 9.53733e-07 9.33724e-07 9.13715e-07 + 8.93707e-07 8.73698e-07 8.5369e-07 8.33681e-07 8.13673e-07 + 7.93664e-07 7.73655e-07 7.53647e-07 7.21781e-07 5.956e-07 + 4.69419e-07 3.43239e-07 2.17058e-07 0.0284032 0.0374438 + -0.0157543 -0.0680497 0.0504768 0.0100294 0.00222261 0.000528697 + 0.000132929 3.99489e-05 2.46066e-05 4.56327e-06 -6.54853e-06 + 1.33783e-05 -3.68221e-05 -0.0724498 -0.0843663 -0.0792935 + -0.0406426 0.0200019 0.0426259 0.0220753 0.00668555 -0.000968483 + 0.024662 0.0383437 0.0911513 0.087848 0.0602076 0.0390559 + 0.0260573 0.0180444 0.012974 0.00985409 0.00788132 0.0064228 + 0.005545 0.00453571 0.00364245 0.00310278 0.00270523 0.00236439 + 0.0020945 0.00186808 0.00167493 0.00151731 0.00138594 0.00126945 + 0.00116695 0.0010762 0.000996366 0.000928387 0.000864414 + 0.000808258 0.000759574 0.000713865 0.000666712 0.000632716 + 0.000601262 0.000572163 0.000543986 0.000515253 0.0004897 + 0.000468112 0.000449313 0.000432981 0.000417911 0.000401307 + 0.000382712 0.000366678 0.000355736 0.000349171 0.000335727 + 0.000317091 0.000296086 0.000283543 0.000277366 0.000272233 + 0.000267001 0.000263147 0.000256699 0.000250251 0.000243803 + 0.000237355 0.000230907 0.000225424 0.000220247 0.000215069 + 0.000209892 0.000204714 0.000200213 0.000196548 0.000192884 + 0.00018922 0.000185556 0.000181892 0.000178228 0.000174564 + 0.0001709 0.000167236 0.000163572 0.000160824 0.000158279 + 0.000155733 0.000153187 0.000150641 0.000148095 0.000145549 + 0.000143003 0.000140457 0.000137911 0.000135457 0.000133386 + 0.000131315 0.000129245 0.000127174 0.000125103 0.000123032 + 0.000120961 0.000118891 EOD @v[19].set(<<-'EOD') - 1.86175 1.99994 2.0833 2.01627 2.42503 3.25769 3.62134 3.88827 - 4.09688 4.26773 4.40529 4.51734 4.60827 4.68313 4.74346 - 4.79302 4.72815 4.68959 4.70421 4.81316 5.01375 5.14493 - 5.10305 5.0699 5.04484 5.03751 5.03348 5.02504 5.01799 5.01271 - 5.00895 5.00628 5.0044 5.00309 5.00216 5.00151 5.00105 5.00073 - 5.00051 5.00034 5.00023 5.00015 5.0001 5.00007 5.00003 4.99998 - 4.99993 4.99993 4.99995 4.99999 5.00001 5.00003 5.00002 - 5.00001 5 5 5 5 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00017 5.17398 - 4.94779 3.78508 1.52302 0.608808 0.244311 0.126053 0.0597175 - 0.038422 0.0158174 0.00481338 0.00107847 0.000301256 0.000114861 - 0.00059489 -0.118904 -0.147478 -0.158986 -0.080544 0.165361 - 0.171378 0.0776087 0.0435738 0.0428235 0.0423755 0.0347695 - 0.0225061 0.0155539 0.0121357 0.0107997 0.0103976 0.0124406 - 0.016814 0.0167556 0.0149852 0.01459 0.0141182 0.0131934 - 0.0120286 0.0108692 0.0097184 0.00855881 0.00744912 0.00643877 - 0.00554044 0.00475165 0.00406535 0.00347158 0.00295981 0.00251995 - 0.00214318 0.00182101 0.00154613 0.00131196 0.0011119 0.000941587 - 0.000796999 0.000674582 0.000571283 0.000484276 0.000410649 - 0.000347005 0.000292984 0.000246715 0.000208143 0.00017489 - 0.000147412 0.000123854 0.000104332 8.77229e-05 7.40686e-05 - 6.2637e-05 5.32e-05 4.53946e-05 3.88343e-05 3.31864e-05 - 2.85905e-05 2.45725e-05 2.08671e-05 1.77301e-05 1.55911e-05 - 1.40153e-05 1.29421e-05 1.18693e-05 1.09815e-05 1.03484e-05 - 9.87664e-06 9.14446e-06 8.41228e-06 7.68011e-06 6.94793e-06 - 6.21575e-06 5.48357e-06 4.7514e-06 4.38454e-06 4.04432e-06 - 3.7041e-06 3.36388e-06 3.02366e-06 2.68344e-06 2.34322e-06 - 2.15196e-06 2.03791e-06 1.92386e-06 1.80982e-06 1.69577e-06 - 1.58173e-06 1.46768e-06 1.35363e-06 1.23959e-06 1.12554e-06 - 1.0115e-06 8.9745e-07 7.83404e-07 6.69358e-07 4.76113e-07 - -3.47071e-07 -1.17025e-06 -1.99344e-06 -2.81662e-06 0.0783754 - 0.0500262 -0.0659563 -0.120914 0.0815957 0.0154255 0.00347177 - 0.000840357 0.000214582 6.54655e-05 3.91709e-05 8.07396e-06 - -4.44265e-07 1.74384e-05 -4.52725e-05 -0.119379 -0.147984 - -0.159247 -0.0824604 0.169014 0.177628 0.0758742 0.010558 - -0.0346506 -0.0710288 -0.0838952 -0.0599521 -0.034568 -0.0181615 - -0.00968034 -0.00547115 -0.00333511 -0.00232468 -0.00181159 - -0.00143841 -0.00116601 -0.000839755 -0.000569764 -0.000578683 - -0.000490551 -0.000411712 -0.000437859 -0.000408185 -0.000356644 - -0.000311332 -0.000269006 -0.000221396 -0.000210054 -0.0001923 - -0.000175122 -0.000161039 -0.0001428 -0.000126123 -0.000127893 - -8.14516e-05 -0.000120166 -0.000154909 -0.000112733 -8.40377e-05 - -7.11342e-05 -8.09538e-05 -9.77789e-05 -9.82402e-05 -7.73531e-05 - -5.28255e-05 -3.1096e-05 -1.87967e-05 -1.96552e-05 -4.16655e-05 - -5.77185e-05 -5.24142e-05 -2.83153e-05 -1.90012e-05 -1.54415e-05 - -2.52569e-05 -6.23747e-05 -0.000130543 -0.000149394 -0.000110886 - -4.35517e-05 -4.17084e-05 -3.98651e-05 -3.80218e-05 -3.61785e-05 - -3.43352e-05 -3.36249e-05 -3.32729e-05 -3.29208e-05 -3.25687e-05 - -3.22166e-05 -3.17143e-05 -3.10258e-05 -3.03372e-05 -2.96486e-05 - -2.89601e-05 -2.82715e-05 -2.75829e-05 -2.68944e-05 -2.62058e-05 - -2.55173e-05 -2.48287e-05 -2.43043e-05 -2.38159e-05 -2.33276e-05 - -2.28393e-05 -2.2351e-05 -2.18626e-05 -2.13743e-05 -2.0886e-05 - -2.03977e-05 -1.99093e-05 -1.945e-05 -1.91122e-05 -1.87744e-05 - -1.84366e-05 -1.80987e-05 -1.77609e-05 -1.74231e-05 -1.70853e-05 - -1.67474e-05 + 1.86175 1.99994 2.0833 2.01627 2.42503 3.25769 3.62134 3.88827 + 4.09688 4.26773 4.40529 4.51734 4.60827 4.68313 4.74346 + 4.79302 4.72815 4.68959 4.70421 4.81316 5.01375 5.14493 + 5.10305 5.0699 5.04484 5.03751 5.03348 5.02504 5.01799 5.01271 + 5.00895 5.00628 5.0044 5.00309 5.00216 5.00151 5.00105 5.00073 + 5.00051 5.00034 5.00023 5.00015 5.0001 5.00007 5.00003 4.99998 + 4.99993 4.99993 4.99995 4.99999 5.00001 5.00003 5.00002 + 5.00001 5 5 5 5 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00017 5.17398 + 4.94779 3.78508 1.52302 0.608808 0.244311 0.126053 0.0597175 + 0.038422 0.0158174 0.00481338 0.00107847 0.000301256 0.000114861 + 0.00059489 -0.118904 -0.147478 -0.158986 -0.080544 0.165361 + 0.171378 0.0776087 0.0435738 0.0428235 0.0423755 0.0347695 + 0.0225061 0.0155539 0.0121357 0.0107997 0.0103976 0.0124406 + 0.016814 0.0167556 0.0149852 0.01459 0.0141182 0.0131934 + 0.0120286 0.0108692 0.0097184 0.00855881 0.00744912 0.00643877 + 0.00554044 0.00475165 0.00406535 0.00347158 0.00295981 0.00251995 + 0.00214318 0.00182101 0.00154613 0.00131196 0.0011119 0.000941587 + 0.000796999 0.000674582 0.000571283 0.000484276 0.000410649 + 0.000347005 0.000292984 0.000246715 0.000208143 0.00017489 + 0.000147412 0.000123854 0.000104332 8.77229e-05 7.40686e-05 + 6.2637e-05 5.32e-05 4.53946e-05 3.88343e-05 3.31864e-05 + 2.85905e-05 2.45725e-05 2.08671e-05 1.77301e-05 1.55911e-05 + 1.40153e-05 1.29421e-05 1.18693e-05 1.09815e-05 1.03484e-05 + 9.87664e-06 9.14446e-06 8.41228e-06 7.68011e-06 6.94793e-06 + 6.21575e-06 5.48357e-06 4.7514e-06 4.38454e-06 4.04432e-06 + 3.7041e-06 3.36388e-06 3.02366e-06 2.68344e-06 2.34322e-06 + 2.15196e-06 2.03791e-06 1.92386e-06 1.80982e-06 1.69577e-06 + 1.58173e-06 1.46768e-06 1.35363e-06 1.23959e-06 1.12554e-06 + 1.0115e-06 8.9745e-07 7.83404e-07 6.69358e-07 4.76113e-07 + -3.47071e-07 -1.17025e-06 -1.99344e-06 -2.81662e-06 0.0783754 + 0.0500262 -0.0659563 -0.120914 0.0815957 0.0154255 0.00347177 + 0.000840357 0.000214582 6.54655e-05 3.91709e-05 8.07396e-06 + -4.44265e-07 1.74384e-05 -4.52725e-05 -0.119379 -0.147984 + -0.159247 -0.0824604 0.169014 0.177628 0.0758742 0.010558 + -0.0346506 -0.0710288 -0.0838952 -0.0599521 -0.034568 -0.0181615 + -0.00968034 -0.00547115 -0.00333511 -0.00232468 -0.00181159 + -0.00143841 -0.00116601 -0.000839755 -0.000569764 -0.000578683 + -0.000490551 -0.000411712 -0.000437859 -0.000408185 -0.000356644 + -0.000311332 -0.000269006 -0.000221396 -0.000210054 -0.0001923 + -0.000175122 -0.000161039 -0.0001428 -0.000126123 -0.000127893 + -8.14516e-05 -0.000120166 -0.000154909 -0.000112733 -8.40377e-05 + -7.11342e-05 -8.09538e-05 -9.77789e-05 -9.82402e-05 -7.73531e-05 + -5.28255e-05 -3.1096e-05 -1.87967e-05 -1.96552e-05 -4.16655e-05 + -5.77185e-05 -5.24142e-05 -2.83153e-05 -1.90012e-05 -1.54415e-05 + -2.52569e-05 -6.23747e-05 -0.000130543 -0.000149394 -0.000110886 + -4.35517e-05 -4.17084e-05 -3.98651e-05 -3.80218e-05 -3.61785e-05 + -3.43352e-05 -3.36249e-05 -3.32729e-05 -3.29208e-05 -3.25687e-05 + -3.22166e-05 -3.17143e-05 -3.10258e-05 -3.03372e-05 -2.96486e-05 + -2.89601e-05 -2.82715e-05 -2.75829e-05 -2.68944e-05 -2.62058e-05 + -2.55173e-05 -2.48287e-05 -2.43043e-05 -2.38159e-05 -2.33276e-05 + -2.28393e-05 -2.2351e-05 -2.18626e-05 -2.13743e-05 -2.0886e-05 + -2.03977e-05 -1.99093e-05 -1.945e-05 -1.91122e-05 -1.87744e-05 + -1.84366e-05 -1.80987e-05 -1.77609e-05 -1.74231e-05 -1.70853e-05 + -1.67474e-05 EOD @v[20].set(<<-'EOD') - 1.86175 1.99724 2.17266 2.48439 3.15933 3.85231 4.38091 - 4.69033 4.85034 4.92851 4.96453 4.98188 4.98736 4.991 4.99482 - 4.9973 4.96422 4.89989 4.83907 4.83151 4.90868 5.04854 5.06104 - 5.04571 5.03219 5.03025 5.02273 5.01707 5.0123 5.0087 5.00611 - 5.00429 5.00301 5.00211 5.00148 5.00103 5.00072 5.0005 5.00035 - 5.00024 5.00016 5.00011 5.00007 5.00005 5.00003 5.00001 - 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999 - 5 5 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002 - 5.00002 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 - 5 5 4.99981 5.10081 5.10903 4.98404 5.00999 5.14946 4.36501 - 2.23938 0.325144 0.00660272 -0.0102186 -0.0082401 -0.00556785 - -0.00374178 -0.00264763 -0.00202823 -0.0182241 -0.0169551 - -0.0150395 0.0103736 0.0877592 0.104382 0.0515938 0.0373818 - 0.0411547 0.0397009 0.0308946 0.0205793 0.0154037 0.0129191 - 0.0119327 0.011527 0.0124295 0.0161152 0.0161076 0.0145391 - 0.0144541 0.0139287 0.0129215 0.0117239 0.0105795 0.00942983 - 0.00827423 0.00718354 0.00619954 0.00532868 0.00456631 0.00390448 - 0.00333254 0.00284003 0.00241714 0.00205524 0.0017458 0.00148202 - 0.00125739 0.0010655 0.000902213 0.000763611 0.000646279 - 0.000547291 0.000463934 0.000393401 0.000332424 0.000280655 - 0.000236328 0.000199386 0.000167536 0.000141218 0.000118654 - 9.99559e-05 8.40479e-05 7.09694e-05 6.00188e-05 5.09786e-05 - 4.3502e-05 3.72191e-05 3.18114e-05 2.74071e-05 2.35539e-05 - 1.99967e-05 1.69871e-05 1.49449e-05 1.3451e-05 1.24492e-05 - 1.14256e-05 1.05669e-05 9.94487e-06 9.47514e-06 8.77318e-06 - 8.07123e-06 7.36927e-06 6.66731e-06 5.96536e-06 5.2634e-06 - 4.56144e-06 4.23044e-06 3.92649e-06 3.62254e-06 3.31858e-06 - 3.01463e-06 2.71068e-06 2.40673e-06 2.23063e-06 2.12082e-06 - 2.01102e-06 1.90121e-06 1.7914e-06 1.68159e-06 1.57178e-06 - 1.46197e-06 1.35216e-06 1.24235e-06 1.13255e-06 1.02274e-06 - 9.12929e-07 8.0312e-07 6.33171e-07 -1.51288e-08 -6.63428e-07 - -1.31173e-06 -1.96003e-06 0.0437517 0.0265689 -0.0515377 - -0.0658688 0.010727 -0.000511921 -8.36924e-05 2.13278e-05 - 1.45207e-05 4.54862e-06 -6.14726e-06 2.0062e-06 1.02709e-06 - 1.4152e-05 -3.08225e-05 -0.0166501 -0.0157139 -0.013957 - 0.0107537 0.0873717 0.111302 0.0454129 -0.00530142 -0.0468336 - -0.0790063 -0.0826944 -0.0534753 -0.0288705 -0.0149009 -0.00801592 - -0.0046342 -0.00291835 -0.00213019 -0.00170055 -0.001352 - -0.00110593 -0.000742655 -0.000532042 -0.000544742 -0.000479206 - -0.000407307 -0.000403575 -0.000366209 -0.000324161 -0.000286183 - -0.000247579 -0.000214281 -0.000203435 -0.000186896 -0.000171033 - -0.00015779 -0.000145259 -0.000128069 -0.000122647 -9.89398e-05 - -0.000114926 -0.000132195 -0.000107872 -8.91015e-05 -7.87996e-05 - -8.14061e-05 -8.9098e-05 -8.83368e-05 -7.6122e-05 -6.14668e-05 - -4.75402e-05 -3.81855e-05 -3.69696e-05 -4.78656e-05 -5.61346e-05 - -5.35007e-05 -4.1459e-05 -3.35411e-05 -2.52374e-05 -2.37479e-05 - -4.6406e-05 -9.41884e-05 -0.000109222 -8.52676e-05 -4.25166e-05 - -4.10125e-05 -3.95085e-05 -3.80045e-05 -3.65004e-05 -3.49964e-05 - -3.41627e-05 -3.3541e-05 -3.29193e-05 -3.22976e-05 -3.16758e-05 - -3.10334e-05 -3.03653e-05 -2.96971e-05 -2.9029e-05 -2.83609e-05 - -2.76928e-05 -2.70246e-05 -2.63565e-05 -2.56884e-05 -2.50203e-05 - -2.43521e-05 -2.38716e-05 -2.34324e-05 -2.29932e-05 -2.25539e-05 - -2.21147e-05 -2.16755e-05 -2.12362e-05 -2.0797e-05 -2.03578e-05 - -1.99186e-05 -1.95079e-05 -1.9217e-05 -1.8926e-05 -1.8635e-05 - -1.8344e-05 -1.8053e-05 -1.7762e-05 -1.74711e-05 -1.71801e-05 + 1.86175 1.99724 2.17266 2.48439 3.15933 3.85231 4.38091 + 4.69033 4.85034 4.92851 4.96453 4.98188 4.98736 4.991 4.99482 + 4.9973 4.96422 4.89989 4.83907 4.83151 4.90868 5.04854 5.06104 + 5.04571 5.03219 5.03025 5.02273 5.01707 5.0123 5.0087 5.00611 + 5.00429 5.00301 5.00211 5.00148 5.00103 5.00072 5.0005 5.00035 + 5.00024 5.00016 5.00011 5.00007 5.00005 5.00003 5.00001 + 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999 + 5 5 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002 + 5.00002 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 + 5 5 4.99981 5.10081 5.10903 4.98404 5.00999 5.14946 4.36501 + 2.23938 0.325144 0.00660272 -0.0102186 -0.0082401 -0.00556785 + -0.00374178 -0.00264763 -0.00202823 -0.0182241 -0.0169551 + -0.0150395 0.0103736 0.0877592 0.104382 0.0515938 0.0373818 + 0.0411547 0.0397009 0.0308946 0.0205793 0.0154037 0.0129191 + 0.0119327 0.011527 0.0124295 0.0161152 0.0161076 0.0145391 + 0.0144541 0.0139287 0.0129215 0.0117239 0.0105795 0.00942983 + 0.00827423 0.00718354 0.00619954 0.00532868 0.00456631 0.00390448 + 0.00333254 0.00284003 0.00241714 0.00205524 0.0017458 0.00148202 + 0.00125739 0.0010655 0.000902213 0.000763611 0.000646279 + 0.000547291 0.000463934 0.000393401 0.000332424 0.000280655 + 0.000236328 0.000199386 0.000167536 0.000141218 0.000118654 + 9.99559e-05 8.40479e-05 7.09694e-05 6.00188e-05 5.09786e-05 + 4.3502e-05 3.72191e-05 3.18114e-05 2.74071e-05 2.35539e-05 + 1.99967e-05 1.69871e-05 1.49449e-05 1.3451e-05 1.24492e-05 + 1.14256e-05 1.05669e-05 9.94487e-06 9.47514e-06 8.77318e-06 + 8.07123e-06 7.36927e-06 6.66731e-06 5.96536e-06 5.2634e-06 + 4.56144e-06 4.23044e-06 3.92649e-06 3.62254e-06 3.31858e-06 + 3.01463e-06 2.71068e-06 2.40673e-06 2.23063e-06 2.12082e-06 + 2.01102e-06 1.90121e-06 1.7914e-06 1.68159e-06 1.57178e-06 + 1.46197e-06 1.35216e-06 1.24235e-06 1.13255e-06 1.02274e-06 + 9.12929e-07 8.0312e-07 6.33171e-07 -1.51288e-08 -6.63428e-07 + -1.31173e-06 -1.96003e-06 0.0437517 0.0265689 -0.0515377 + -0.0658688 0.010727 -0.000511921 -8.36924e-05 2.13278e-05 + 1.45207e-05 4.54862e-06 -6.14726e-06 2.0062e-06 1.02709e-06 + 1.4152e-05 -3.08225e-05 -0.0166501 -0.0157139 -0.013957 + 0.0107537 0.0873717 0.111302 0.0454129 -0.00530142 -0.0468336 + -0.0790063 -0.0826944 -0.0534753 -0.0288705 -0.0149009 -0.00801592 + -0.0046342 -0.00291835 -0.00213019 -0.00170055 -0.001352 + -0.00110593 -0.000742655 -0.000532042 -0.000544742 -0.000479206 + -0.000407307 -0.000403575 -0.000366209 -0.000324161 -0.000286183 + -0.000247579 -0.000214281 -0.000203435 -0.000186896 -0.000171033 + -0.00015779 -0.000145259 -0.000128069 -0.000122647 -9.89398e-05 + -0.000114926 -0.000132195 -0.000107872 -8.91015e-05 -7.87996e-05 + -8.14061e-05 -8.9098e-05 -8.83368e-05 -7.6122e-05 -6.14668e-05 + -4.75402e-05 -3.81855e-05 -3.69696e-05 -4.78656e-05 -5.61346e-05 + -5.35007e-05 -4.1459e-05 -3.35411e-05 -2.52374e-05 -2.37479e-05 + -4.6406e-05 -9.41884e-05 -0.000109222 -8.52676e-05 -4.25166e-05 + -4.10125e-05 -3.95085e-05 -3.80045e-05 -3.65004e-05 -3.49964e-05 + -3.41627e-05 -3.3541e-05 -3.29193e-05 -3.22976e-05 -3.16758e-05 + -3.10334e-05 -3.03653e-05 -2.96971e-05 -2.9029e-05 -2.83609e-05 + -2.76928e-05 -2.70246e-05 -2.63565e-05 -2.56884e-05 -2.50203e-05 + -2.43521e-05 -2.38716e-05 -2.34324e-05 -2.29932e-05 -2.25539e-05 + -2.21147e-05 -2.16755e-05 -2.12362e-05 -2.0797e-05 -2.03578e-05 + -1.99186e-05 -1.95079e-05 -1.9217e-05 -1.8926e-05 -1.8635e-05 + -1.8344e-05 -1.8053e-05 -1.7762e-05 -1.74711e-05 -1.71801e-05 EOD @v[21].set(<<-'EOD') - 1.86175 1.73273 1.42016 1.02483 0.944013 0.274107 0.0823742 - 0.0379366 0.020816 0.0132952 0.00955525 0.00717008 0.00592286 - 0.00437379 0.00383557 0.00273694 -0.0037467 -0.0054191 -0.00131454 - 0.0112179 0.0133918 0.00519747 -0.00260113 -0.00252847 -0.00181292 - 0.000183398 -0.000667607 -0.000750747 -0.000594314 -0.000433904 - -0.000308985 -0.000217858 -0.000152926 -0.000107454 -7.54076e-05 - -5.2675e-05 -3.66299e-05 -2.54341e-05 -1.75095e-05 -1.18848e-05 - -7.97289e-06 -5.30239e-06 -3.53615e-06 -2.38504e-06 -2.40158e-06 - -3.84485e-06 -5.29435e-06 -2.57099e-06 1.95189e-06 3.55083e-06 - 2.06179e-06 5.72753e-07 3.30469e-07 3.40296e-07 3.60221e-07 - 4.86081e-07 6.1194e-07 7.37799e-07 8.63659e-07 9.89518e-07 - 9.21274e-07 7.22275e-07 5.23276e-07 3.24277e-07 1.25278e-07 - -5.59467e-08 -9.03265e-08 -1.24706e-07 -1.59086e-07 -1.93466e-07 - -2.27846e-07 -2.62226e-07 -2.96605e-07 -3.30985e-07 -3.65365e-07 - -3.99745e-07 -4.24266e-07 -3.82163e-07 -3.40061e-07 -2.97959e-07 - -2.55857e-07 -2.13755e-07 -1.71652e-07 -1.2955e-07 -8.7448e-08 - -4.53457e-08 -3.24353e-09 3.76901e-08 7.19937e-08 1.06297e-07 - 1.40601e-07 1.74904e-07 2.09208e-07 2.43512e-07 2.77815e-07 - 3.12119e-07 3.46422e-07 3.80726e-07 4.04507e-07 3.77191e-07 - 3.49876e-07 3.22561e-07 2.95246e-07 2.67931e-07 2.40616e-07 - 2.13301e-07 1.85986e-07 1.58671e-07 1.31356e-07 1.04041e-07 - 7.67256e-08 4.94105e-08 2.20955e-08 -5.21962e-09 -3.25347e-08 - -5.98498e-08 -8.71649e-08 -1.1448e-07 -1.41795e-07 -1.6911e-07 - 7.87893e-06 0.0114592 -0.0245712 -0.111637 0.0961324 1.61168 - 3.22343 4.20442 4.53535 4.83834 4.95464 4.98874 4.99746 - 4.99883 4.99948 4.99815 4.98431 4.99298 4.99718 5.01948 - 5.04749 5.008 4.98243 4.98985 4.99781 4.99887 4.99679 4.99616 - 4.99743 4.99859 4.99936 4.99972 5.00058 5.00123 5.0002 4.99945 - 4.99983 4.9998 4.99966 4.99958 4.99956 4.99956 4.99956 4.99958 - 4.99961 4.99965 4.99969 4.99973 4.99977 4.9998 4.99983 4.99985 - 4.99987 4.99989 4.99991 4.99992 4.99993 4.99994 4.99995 - 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001 - 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 - 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.01454 - 4.99566 4.96796 4.99819 5.03232 5.00034 4.99867 4.99937 - 4.99977 4.99992 4.99997 4.99999 5.00001 5.00021 4.99974 - 4.98462 4.99301 4.99723 5.01936 5.04807 5.00929 4.9789 4.97876 - 4.98244 4.9863 4.99575 5.0069 5.00863 5.00624 5.00357 5.0019 - 5.00098 5.00048 5.00025 5.00016 5.00011 5.00013 5.00009 - 4.99982 4.99994 5.00005 4.99994 4.99988 4.99989 4.99997 - 5.00003 5.00005 5.00002 5.00001 5.00001 5.00001 4.99993 - 4.99999 5 5.00021 4.99997 4.99981 5 5.00009 5.0001 5.00001 - 4.99991 4.9999 5 5.00011 5.00017 5.00018 5.00018 5.00014 - 5.00007 4.99999 4.9999 4.9999 5.00001 5.00016 5.00014 4.99999 - 4.99993 4.99999 5.00009 5.00007 5.00006 5.00004 5.00003 - 5.00001 5.00001 5 4.99999 4.99998 4.99997 4.99997 4.99997 - 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999 - 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002 - 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5 5 + 1.86175 1.73273 1.42016 1.02483 0.944013 0.274107 0.0823742 + 0.0379366 0.020816 0.0132952 0.00955525 0.00717008 0.00592286 + 0.00437379 0.00383557 0.00273694 -0.0037467 -0.0054191 -0.00131454 + 0.0112179 0.0133918 0.00519747 -0.00260113 -0.00252847 -0.00181292 + 0.000183398 -0.000667607 -0.000750747 -0.000594314 -0.000433904 + -0.000308985 -0.000217858 -0.000152926 -0.000107454 -7.54076e-05 + -5.2675e-05 -3.66299e-05 -2.54341e-05 -1.75095e-05 -1.18848e-05 + -7.97289e-06 -5.30239e-06 -3.53615e-06 -2.38504e-06 -2.40158e-06 + -3.84485e-06 -5.29435e-06 -2.57099e-06 1.95189e-06 3.55083e-06 + 2.06179e-06 5.72753e-07 3.30469e-07 3.40296e-07 3.60221e-07 + 4.86081e-07 6.1194e-07 7.37799e-07 8.63659e-07 9.89518e-07 + 9.21274e-07 7.22275e-07 5.23276e-07 3.24277e-07 1.25278e-07 + -5.59467e-08 -9.03265e-08 -1.24706e-07 -1.59086e-07 -1.93466e-07 + -2.27846e-07 -2.62226e-07 -2.96605e-07 -3.30985e-07 -3.65365e-07 + -3.99745e-07 -4.24266e-07 -3.82163e-07 -3.40061e-07 -2.97959e-07 + -2.55857e-07 -2.13755e-07 -1.71652e-07 -1.2955e-07 -8.7448e-08 + -4.53457e-08 -3.24353e-09 3.76901e-08 7.19937e-08 1.06297e-07 + 1.40601e-07 1.74904e-07 2.09208e-07 2.43512e-07 2.77815e-07 + 3.12119e-07 3.46422e-07 3.80726e-07 4.04507e-07 3.77191e-07 + 3.49876e-07 3.22561e-07 2.95246e-07 2.67931e-07 2.40616e-07 + 2.13301e-07 1.85986e-07 1.58671e-07 1.31356e-07 1.04041e-07 + 7.67256e-08 4.94105e-08 2.20955e-08 -5.21962e-09 -3.25347e-08 + -5.98498e-08 -8.71649e-08 -1.1448e-07 -1.41795e-07 -1.6911e-07 + 7.87893e-06 0.0114592 -0.0245712 -0.111637 0.0961324 1.61168 + 3.22343 4.20442 4.53535 4.83834 4.95464 4.98874 4.99746 + 4.99883 4.99948 4.99815 4.98431 4.99298 4.99718 5.01948 + 5.04749 5.008 4.98243 4.98985 4.99781 4.99887 4.99679 4.99616 + 4.99743 4.99859 4.99936 4.99972 5.00058 5.00123 5.0002 4.99945 + 4.99983 4.9998 4.99966 4.99958 4.99956 4.99956 4.99956 4.99958 + 4.99961 4.99965 4.99969 4.99973 4.99977 4.9998 4.99983 4.99985 + 4.99987 4.99989 4.99991 4.99992 4.99993 4.99994 4.99995 + 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001 + 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 + 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.01454 + 4.99566 4.96796 4.99819 5.03232 5.00034 4.99867 4.99937 + 4.99977 4.99992 4.99997 4.99999 5.00001 5.00021 4.99974 + 4.98462 4.99301 4.99723 5.01936 5.04807 5.00929 4.9789 4.97876 + 4.98244 4.9863 4.99575 5.0069 5.00863 5.00624 5.00357 5.0019 + 5.00098 5.00048 5.00025 5.00016 5.00011 5.00013 5.00009 + 4.99982 4.99994 5.00005 4.99994 4.99988 4.99989 4.99997 + 5.00003 5.00005 5.00002 5.00001 5.00001 5.00001 4.99993 + 4.99999 5 5.00021 4.99997 4.99981 5 5.00009 5.0001 5.00001 + 4.99991 4.9999 5 5.00011 5.00017 5.00018 5.00018 5.00014 + 5.00007 4.99999 4.9999 4.9999 5.00001 5.00016 5.00014 4.99999 + 4.99993 4.99999 5.00009 5.00007 5.00006 5.00004 5.00003 + 5.00001 5.00001 5 4.99999 4.99998 4.99997 4.99997 4.99997 + 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999 + 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002 + 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5 5 EOD @v[22].set(<<-'EOD') - 7.10441e-10 0.00107105 0.000637109 -0.00236346 -0.018079 - -0.0120077 -0.00217059 0.00266679 0.00403383 0.00403836 - 0.00356705 0.00303303 0.00244716 0.00198586 0.0016855 0.00136497 - -3.96022e-05 -0.000367409 -3.77079e-05 0.00194085 0.00506964 - -0.0400214 -0.0402572 0.0524434 0.286234 0.803011 1.44795 - 2.02473 2.54768 3.02748 3.4415 3.78287 4.09667 4.35152 4.53987 - 4.67614 4.77407 4.84319 4.89227 4.92702 4.95119 4.96764 - 4.97846 4.98557 4.98982 4.99209 4.99371 4.99569 4.99727 - 4.99802 4.99834 4.99867 4.99892 4.99915 4.99936 4.99939 - 4.99943 4.99946 4.9995 4.99953 4.99957 4.9996 4.99963 4.99967 - 4.9997 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978 4.9998 - 4.99981 4.99982 4.99983 4.99984 4.99985 4.99986 4.99986 - 4.99986 4.99987 4.99987 4.99988 4.99988 4.99989 4.99989 - 4.9999 4.9999 4.9999 4.9999 4.99991 4.99991 4.99991 4.99991 - 4.99992 4.99992 4.99992 4.99992 4.99993 4.99993 4.99993 - 4.99993 4.99993 4.99993 4.99993 4.99993 4.99994 4.99994 - 4.99994 4.99994 4.99994 4.99994 4.99994 4.99994 4.99995 - 4.99995 4.99995 4.99995 4.99995 4.99995 4.99995 5.00145 - 5.00659 5.01209 5.01931 5.00279 4.99273 4.99217 4.99295 - 4.99471 4.99594 4.99696 4.9978 4.99844 4.99891 4.99924 4.99635 - 4.99699 4.99813 5.00068 5.00307 5.0588 4.96365 4.54012 3.6307 - 2.35176 1.0322 0.354379 0.115986 0.0435668 0.0245112 0.020786 - 0.0164656 0.0118409 0.00849698 0.00597078 0.0040105 0.0026076 - 0.0016597 0.00118185 0.00121067 0.00153587 0.00174836 0.00136519 - -0.000189116 -0.00315555 -0.00646603 -0.00898042 -0.010203 - -0.0110896 -0.0123764 -0.00953841 -0.00225795 0.000818314 - 0.00152252 0.00150269 0.00119025 0.000767068 0.000308852 - -3.79272e-05 -0.00019691 -0.000186642 -9.73653e-05 -8.49784e-06 - 2.04147e-05 -9.91086e-06 -1.55959e-05 -1.80499e-05 -1.77097e-05 - -1.51548e-05 -1.1978e-05 -9.84916e-06 -1.29728e-05 -1.67235e-05 - -1.74153e-05 -1.39958e-05 -5.92272e-06 -8.08216e-06 -1.53077e-05 - -2.92531e-05 -3.91049e-05 -2.98935e-05 -7.32122e-06 3.18534e-05 - 4.39134e-05 4.18753e-05 3.22759e-05 1.86766e-05 1.58432e-05 - 1.30098e-05 1.01765e-05 7.34312e-06 4.50975e-06 1.67639e-06 - -1.15697e-06 -1.23877e-06 -1.11991e-06 -1.00106e-06 -8.82208e-07 - -7.63355e-07 -6.44502e-07 -5.2565e-07 -4.29318e-07 -3.44661e-07 - -2.60004e-07 -1.75347e-07 -9.06904e-08 -6.03349e-09 7.86234e-08 - 1.6328e-07 2.47937e-07 3.32594e-07 4.17251e-07 5.01908e-07 - 5.86565e-07 6.71222e-07 7.36123e-07 6.43886e-07 5.5165e-07 - 4.59414e-07 3.67178e-07 0.000334759 -4.60833e-05 -0.00106139 - -0.00166624 0.000859563 0.00102606 0.00410037 0.00419931 - 0.00518997 0.00459791 0.00503125 0.00523877 0.00452158 0.00339924 - 0.00233399 0.000876915 0.000546439 0.000444299 0.000983968 - 0.00119304 -0.0429422 -0.0403983 0.0534896 0.288013 0.807345 - 1.44247 2.03448 2.57021 3.05049 3.47332 3.8131 4.1009 4.34677 - 4.53512 4.67127 4.76531 4.82526 4.86593 4.89586 4.91904 - 4.93806 4.95348 4.96597 4.97629 4.9843 4.98983 4.99335 4.9957 - 4.99741 4.99864 4.99946 4.99994 5.00047 5.00073 5.00086 - 5.00092 5.00094 5.00091 5.00087 5.00081 5.00074 5.00067 - 5.00059 5.00052 5.00046 5.0004 5.00034 5.0003 5.00026 5.00022 - 5.00019 5.00016 5.00014 5.00012 5.0001 5.00009 5.00007 5.00006 - 5.00006 5.00005 5.00004 5.00004 5.00004 5.00003 5.00003 - 5.00003 5.00002 5.00002 5.00002 5.00002 5.00001 5.00001 - 5.00001 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001 - 5.00001 5.00001 5.00002 5.00002 + 7.10441e-10 0.00107105 0.000637109 -0.00236346 -0.018079 + -0.0120077 -0.00217059 0.00266679 0.00403383 0.00403836 + 0.00356705 0.00303303 0.00244716 0.00198586 0.0016855 0.00136497 + -3.96022e-05 -0.000367409 -3.77079e-05 0.00194085 0.00506964 + -0.0400214 -0.0402572 0.0524434 0.286234 0.803011 1.44795 + 2.02473 2.54768 3.02748 3.4415 3.78287 4.09667 4.35152 4.53987 + 4.67614 4.77407 4.84319 4.89227 4.92702 4.95119 4.96764 + 4.97846 4.98557 4.98982 4.99209 4.99371 4.99569 4.99727 + 4.99802 4.99834 4.99867 4.99892 4.99915 4.99936 4.99939 + 4.99943 4.99946 4.9995 4.99953 4.99957 4.9996 4.99963 4.99967 + 4.9997 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978 4.9998 + 4.99981 4.99982 4.99983 4.99984 4.99985 4.99986 4.99986 + 4.99986 4.99987 4.99987 4.99988 4.99988 4.99989 4.99989 + 4.9999 4.9999 4.9999 4.9999 4.99991 4.99991 4.99991 4.99991 + 4.99992 4.99992 4.99992 4.99992 4.99993 4.99993 4.99993 + 4.99993 4.99993 4.99993 4.99993 4.99993 4.99994 4.99994 + 4.99994 4.99994 4.99994 4.99994 4.99994 4.99994 4.99995 + 4.99995 4.99995 4.99995 4.99995 4.99995 4.99995 5.00145 + 5.00659 5.01209 5.01931 5.00279 4.99273 4.99217 4.99295 + 4.99471 4.99594 4.99696 4.9978 4.99844 4.99891 4.99924 4.99635 + 4.99699 4.99813 5.00068 5.00307 5.0588 4.96365 4.54012 3.6307 + 2.35176 1.0322 0.354379 0.115986 0.0435668 0.0245112 0.020786 + 0.0164656 0.0118409 0.00849698 0.00597078 0.0040105 0.0026076 + 0.0016597 0.00118185 0.00121067 0.00153587 0.00174836 0.00136519 + -0.000189116 -0.00315555 -0.00646603 -0.00898042 -0.010203 + -0.0110896 -0.0123764 -0.00953841 -0.00225795 0.000818314 + 0.00152252 0.00150269 0.00119025 0.000767068 0.000308852 + -3.79272e-05 -0.00019691 -0.000186642 -9.73653e-05 -8.49784e-06 + 2.04147e-05 -9.91086e-06 -1.55959e-05 -1.80499e-05 -1.77097e-05 + -1.51548e-05 -1.1978e-05 -9.84916e-06 -1.29728e-05 -1.67235e-05 + -1.74153e-05 -1.39958e-05 -5.92272e-06 -8.08216e-06 -1.53077e-05 + -2.92531e-05 -3.91049e-05 -2.98935e-05 -7.32122e-06 3.18534e-05 + 4.39134e-05 4.18753e-05 3.22759e-05 1.86766e-05 1.58432e-05 + 1.30098e-05 1.01765e-05 7.34312e-06 4.50975e-06 1.67639e-06 + -1.15697e-06 -1.23877e-06 -1.11991e-06 -1.00106e-06 -8.82208e-07 + -7.63355e-07 -6.44502e-07 -5.2565e-07 -4.29318e-07 -3.44661e-07 + -2.60004e-07 -1.75347e-07 -9.06904e-08 -6.03349e-09 7.86234e-08 + 1.6328e-07 2.47937e-07 3.32594e-07 4.17251e-07 5.01908e-07 + 5.86565e-07 6.71222e-07 7.36123e-07 6.43886e-07 5.5165e-07 + 4.59414e-07 3.67178e-07 0.000334759 -4.60833e-05 -0.00106139 + -0.00166624 0.000859563 0.00102606 0.00410037 0.00419931 + 0.00518997 0.00459791 0.00503125 0.00523877 0.00452158 0.00339924 + 0.00233399 0.000876915 0.000546439 0.000444299 0.000983968 + 0.00119304 -0.0429422 -0.0403983 0.0534896 0.288013 0.807345 + 1.44247 2.03448 2.57021 3.05049 3.47332 3.8131 4.1009 4.34677 + 4.53512 4.67127 4.76531 4.82526 4.86593 4.89586 4.91904 + 4.93806 4.95348 4.96597 4.97629 4.9843 4.98983 4.99335 4.9957 + 4.99741 4.99864 4.99946 4.99994 5.00047 5.00073 5.00086 + 5.00092 5.00094 5.00091 5.00087 5.00081 5.00074 5.00067 + 5.00059 5.00052 5.00046 5.0004 5.00034 5.0003 5.00026 5.00022 + 5.00019 5.00016 5.00014 5.00012 5.0001 5.00009 5.00007 5.00006 + 5.00006 5.00005 5.00004 5.00004 5.00004 5.00003 5.00003 + 5.00003 5.00002 5.00002 5.00002 5.00002 5.00001 5.00001 + 5.00001 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001 + 5.00001 5.00001 5.00002 5.00002 EOD @v[23].set(<<-'EOD') - 5 5.00284 5.01266 5.01895 4.98936 4.99575 4.99217 4.99545 - 4.99775 4.99894 4.99946 4.99968 4.99975 4.99977 4.99986 - 4.9999 4.99528 4.99808 5.00039 5.00392 5.00512 4.99985 4.99863 - 4.99942 4.99992 5.00017 4.99897 4.99803 4.99784 4.99739 - 4.99883 5.00365 5.00298 5.00133 5.00048 5.00019 5.00008 - 5.00005 5.00004 5.00003 5.00002 5.00002 5.00001 5.00001 - 5.00001 5.00001 5.00001 5 5 4.99999 4.99997 4.99995 4.99996 - 4.99998 5 5.00001 5.00001 5.00002 5.00002 5.00003 5.00003 - 5.00002 5.00002 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99998 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002 - 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5 5 5 5 5 5 5 5.00217 5.00108 4.99547 4.99658 5.00667 - 4.99641 4.99532 4.99938 5.00328 5.00222 5.00114 5.00052 - 5.00024 5.00011 5.00009 4.99285 4.99591 4.99897 5.00403 - 5.00786 5.00318 4.99942 4.9992 4.99949 5.001 5.00408 5.00319 - 5.00063 4.99995 5.00014 4.99982 4.99832 4.99838 4.99865 - 4.99912 4.99836 4.99735 4.99606 4.99814 5.00958 5.02973 - 5.05293 5.06103 4.99342 4.80726 4.50744 4.07509 3.41358 - 2.37924 1.03194 0.261552 0.142392 0.0904482 0.0555071 0.0322869 - 0.018289 0.0113802 0.00875182 0.00757055 0.00629906 0.00523 - 0.00403349 0.0031953 0.00280864 0.00286119 0.00250389 0.00202815 - 0.001723 0.00147312 0.0012411 0.00104401 0.000886204 0.000758277 - 0.000651915 0.00056348 0.000487966 0.000424048 0.000365613 - 0.000308178 0.000258725 0.000228061 0.000207976 0.000198491 - 0.00018518 0.000172716 0.000163197 0.000155007 0.000141734 - 0.000128461 0.000115188 0.000101915 8.86417e-05 7.53686e-05 - 6.20956e-05 5.69164e-05 5.23275e-05 4.77385e-05 4.31495e-05 - 3.85605e-05 3.39716e-05 2.93826e-05 2.69449e-05 2.56224e-05 - 2.42999e-05 2.29774e-05 2.16549e-05 2.03324e-05 1.90099e-05 - 1.76873e-05 1.63648e-05 1.50423e-05 1.37198e-05 1.23973e-05 - 1.10748e-05 9.75232e-06 8.48447e-06 7.65129e-06 6.81811e-06 - 5.98494e-06 5.15176e-06 0.00056893 -0.00787906 -0.0217381 - -0.0370066 -0.00770505 0.00659312 0.00975477 0.00949456 - 0.00777552 0.00655645 0.00568776 0.00508782 0.00458121 0.00410187 - 0.00365665 0.0015121 0.00160863 0.00263181 0.00638941 0.00772607 - 0.00225583 0.0010843 0.000882939 0.000801563 0.00075632 - 0.000554992 0.000435131 0.0003474 0.000217667 0.000491602 - 0.0012267 0.00250446 0.000212058 -0.0174972 -0.0527527 -0.0479071 - 0.194908 1.45838 3.40677 4.49242 4.86894 4.97215 5.01218 - 5.04342 5.06228 5.03069 4.87169 4.57056 4.11523 3.38264 - 2.19691 0.715839 0.172818 0.102162 0.0627162 0.0363388 0.020289 - 0.0119414 0.00826608 0.0066417 0.00549092 0.00492505 0.00439443 - 0.0037156 0.00306471 0.00247451 0.00195965 0.0014822 0.0010815 - 0.000904464 0.0010514 0.00152308 0.00120752 0.000228447 - -0.00102833 -0.00116644 -0.00042067 4.78758e-05 5.09599e-05 - -4.45756e-05 -3.22966e-06 3.81163e-05 7.94622e-05 0.000120808 - 0.000162154 0.000161895 0.000148481 0.000135068 0.000121654 - 0.000108241 9.81453e-05 9.2164e-05 8.61827e-05 8.02014e-05 - 7.42201e-05 6.82388e-05 6.22576e-05 5.62763e-05 5.0295e-05 - 4.43137e-05 3.83324e-05 3.54323e-05 3.321e-05 3.09877e-05 - 2.87654e-05 2.65431e-05 2.43209e-05 2.20986e-05 1.98763e-05 - 1.7654e-05 1.54317e-05 1.34612e-05 1.25441e-05 1.1627e-05 - 1.07099e-05 9.79276e-06 8.87564e-06 7.95851e-06 7.04139e-06 - 6.12427e-06 + 5 5.00284 5.01266 5.01895 4.98936 4.99575 4.99217 4.99545 + 4.99775 4.99894 4.99946 4.99968 4.99975 4.99977 4.99986 + 4.9999 4.99528 4.99808 5.00039 5.00392 5.00512 4.99985 4.99863 + 4.99942 4.99992 5.00017 4.99897 4.99803 4.99784 4.99739 + 4.99883 5.00365 5.00298 5.00133 5.00048 5.00019 5.00008 + 5.00005 5.00004 5.00003 5.00002 5.00002 5.00001 5.00001 + 5.00001 5.00001 5.00001 5 5 4.99999 4.99997 4.99995 4.99996 + 4.99998 5 5.00001 5.00001 5.00002 5.00002 5.00003 5.00003 + 5.00002 5.00002 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99998 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002 + 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5 5 5 5 5 5 5 5.00217 5.00108 4.99547 4.99658 5.00667 + 4.99641 4.99532 4.99938 5.00328 5.00222 5.00114 5.00052 + 5.00024 5.00011 5.00009 4.99285 4.99591 4.99897 5.00403 + 5.00786 5.00318 4.99942 4.9992 4.99949 5.001 5.00408 5.00319 + 5.00063 4.99995 5.00014 4.99982 4.99832 4.99838 4.99865 + 4.99912 4.99836 4.99735 4.99606 4.99814 5.00958 5.02973 + 5.05293 5.06103 4.99342 4.80726 4.50744 4.07509 3.41358 + 2.37924 1.03194 0.261552 0.142392 0.0904482 0.0555071 0.0322869 + 0.018289 0.0113802 0.00875182 0.00757055 0.00629906 0.00523 + 0.00403349 0.0031953 0.00280864 0.00286119 0.00250389 0.00202815 + 0.001723 0.00147312 0.0012411 0.00104401 0.000886204 0.000758277 + 0.000651915 0.00056348 0.000487966 0.000424048 0.000365613 + 0.000308178 0.000258725 0.000228061 0.000207976 0.000198491 + 0.00018518 0.000172716 0.000163197 0.000155007 0.000141734 + 0.000128461 0.000115188 0.000101915 8.86417e-05 7.53686e-05 + 6.20956e-05 5.69164e-05 5.23275e-05 4.77385e-05 4.31495e-05 + 3.85605e-05 3.39716e-05 2.93826e-05 2.69449e-05 2.56224e-05 + 2.42999e-05 2.29774e-05 2.16549e-05 2.03324e-05 1.90099e-05 + 1.76873e-05 1.63648e-05 1.50423e-05 1.37198e-05 1.23973e-05 + 1.10748e-05 9.75232e-06 8.48447e-06 7.65129e-06 6.81811e-06 + 5.98494e-06 5.15176e-06 0.00056893 -0.00787906 -0.0217381 + -0.0370066 -0.00770505 0.00659312 0.00975477 0.00949456 + 0.00777552 0.00655645 0.00568776 0.00508782 0.00458121 0.00410187 + 0.00365665 0.0015121 0.00160863 0.00263181 0.00638941 0.00772607 + 0.00225583 0.0010843 0.000882939 0.000801563 0.00075632 + 0.000554992 0.000435131 0.0003474 0.000217667 0.000491602 + 0.0012267 0.00250446 0.000212058 -0.0174972 -0.0527527 -0.0479071 + 0.194908 1.45838 3.40677 4.49242 4.86894 4.97215 5.01218 + 5.04342 5.06228 5.03069 4.87169 4.57056 4.11523 3.38264 + 2.19691 0.715839 0.172818 0.102162 0.0627162 0.0363388 0.020289 + 0.0119414 0.00826608 0.0066417 0.00549092 0.00492505 0.00439443 + 0.0037156 0.00306471 0.00247451 0.00195965 0.0014822 0.0010815 + 0.000904464 0.0010514 0.00152308 0.00120752 0.000228447 + -0.00102833 -0.00116644 -0.00042067 4.78758e-05 5.09599e-05 + -4.45756e-05 -3.22966e-06 3.81163e-05 7.94622e-05 0.000120808 + 0.000162154 0.000161895 0.000148481 0.000135068 0.000121654 + 0.000108241 9.81453e-05 9.2164e-05 8.61827e-05 8.02014e-05 + 7.42201e-05 6.82388e-05 6.22576e-05 5.62763e-05 5.0295e-05 + 4.43137e-05 3.83324e-05 3.54323e-05 3.321e-05 3.09877e-05 + 2.87654e-05 2.65431e-05 2.43209e-05 2.20986e-05 1.98763e-05 + 1.7654e-05 1.54317e-05 1.34612e-05 1.25441e-05 1.1627e-05 + 1.07099e-05 9.79276e-06 8.87564e-06 7.95851e-06 7.04139e-06 + 6.12427e-06 EOD @v[24].set(<<-'EOD') - 5 5.01099 5.00866 4.97845 4.92369 4.9273 4.97413 4.9929 - 4.99826 4.99958 4.99978 5.00005 4.99968 4.99959 5.00014 - 4.99979 4.99914 4.99982 5.00023 5.00295 5.00664 4.99854 - 4.99647 5.00438 5.01722 5.03681 5.04766 5.04799 5.04867 - 5.04873 5.04685 5.04413 5.0367 5.02505 5.01726 5.01183 5.00806 - 5.00549 5.00371 5.00246 5.00162 5.00105 5.00069 5.00045 - 5.00031 5.00024 5.00019 5.00012 5.00007 5.00004 5.00001 - 4.99998 4.99999 4.99999 5 5.00001 5.00001 5.00002 5.00002 - 5.00003 5.00003 5.00003 5.00002 5.00002 5.00001 5.00001 - 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 5 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5.00418 4.99953 4.99152 - 4.99807 5.00497 5.00112 5.00055 5.00038 5.00018 5.00006 - 5.00006 5.00007 5.00006 5.00004 5.00004 4.99853 4.99945 - 4.99998 5.00304 5.00935 5.00742 4.99181 4.97421 4.93603 - 4.8853 4.8927 4.93984 4.97458 4.99039 4.99614 4.99801 4.99851 - 4.99869 4.99924 5.00108 5.00181 5.00119 5.00059 5.00031 - 5.00022 5.00018 5.00011 5.00001 5.00006 4.99981 4.99977 - 4.99982 5.00012 4.99993 5.00008 5.00043 5.00048 5.00024 - 5.00008 4.99984 4.99993 5.00011 4.99996 4.9998 4.99977 4.9998 - 4.99993 5.00008 5.00011 5.00002 4.99995 4.99989 4.99993 - 5 5.00007 5.00009 4.99994 4.99977 4.9997 4.99975 4.99996 - 4.99996 4.99988 4.9997 4.99952 4.9995 4.99956 4.99973 4.99988 - 5.00005 5.00025 5.00042 5.00036 5.00031 5.00025 5.0002 5.00014 - 5.00009 5.00003 5.00002 5.00001 5.00001 5 4.99999 4.99998 - 4.99998 4.99997 4.99998 4.99998 4.99998 4.99998 4.99998 - 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5.00284 - 5.00442 5.00381 4.98997 4.99092 5.00733 5.07791 4.98237 - 4.86434 4.76835 4.74067 4.79278 4.85094 4.90068 4.93603 - 4.95698 4.96984 4.97856 4.98869 4.99904 5.0005 4.99524 5.00181 - 5.01878 5.05177 5.07986 4.98917 4.56217 3.68 2.3539 1.18541 - 0.505772 0.221044 0.115287 0.0760938 0.0589194 0.0476784 - 0.0457213 0.0412911 0.033889 0.0259741 0.0191452 0.0139018 - 0.0100235 0.00711788 0.00497657 0.00349368 0.00250021 0.00176179 - 0.00121843 0.000838368 0.000582711 0.000423458 0.000294608 - 0.000201251 0.000133748 8.6227e-05 5.44252e-05 3.30514e-05 - 1.93926e-05 1.09814e-05 5.29857e-06 1.92247e-06 3.08708e-07 - -3.74311e-07 -6.11121e-07 -7.27807e-07 -4.87604e-07 -4.80493e-07 - -9.15925e-07 -2.03774e-06 -4.01128e-06 -2.46644e-06 2.10626e-06 - 8.22422e-06 1.04922e-05 9.83047e-06 7.27106e-06 3.29654e-06 - -2.06736e-06 -2.18019e-06 -2.29303e-06 -2.40586e-06 -2.51869e-06 - -2.63153e-06 -2.24615e-06 -1.70325e-06 -1.16036e-06 -6.17468e-07 - -7.45754e-08 2.45198e-07 2.88285e-07 3.31373e-07 3.7446e-07 - 4.17548e-07 4.60635e-07 5.03723e-07 5.4681e-07 5.89898e-07 - 6.32985e-07 6.76073e-07 6.19054e-07 5.4001e-07 4.60967e-07 - 3.81923e-07 3.02879e-07 2.23836e-07 1.44792e-07 6.57488e-08 - -1.32948e-08 -9.23383e-08 -1.6698e-07 -2.23206e-07 -2.79432e-07 - -3.35658e-07 -3.91884e-07 -4.48109e-07 -5.04335e-07 -5.60561e-07 - -6.16787e-07 + 5 5.01099 5.00866 4.97845 4.92369 4.9273 4.97413 4.9929 + 4.99826 4.99958 4.99978 5.00005 4.99968 4.99959 5.00014 + 4.99979 4.99914 4.99982 5.00023 5.00295 5.00664 4.99854 + 4.99647 5.00438 5.01722 5.03681 5.04766 5.04799 5.04867 + 5.04873 5.04685 5.04413 5.0367 5.02505 5.01726 5.01183 5.00806 + 5.00549 5.00371 5.00246 5.00162 5.00105 5.00069 5.00045 + 5.00031 5.00024 5.00019 5.00012 5.00007 5.00004 5.00001 + 4.99998 4.99999 4.99999 5 5.00001 5.00001 5.00002 5.00002 + 5.00003 5.00003 5.00003 5.00002 5.00002 5.00001 5.00001 + 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 5 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5.00418 4.99953 4.99152 + 4.99807 5.00497 5.00112 5.00055 5.00038 5.00018 5.00006 + 5.00006 5.00007 5.00006 5.00004 5.00004 4.99853 4.99945 + 4.99998 5.00304 5.00935 5.00742 4.99181 4.97421 4.93603 + 4.8853 4.8927 4.93984 4.97458 4.99039 4.99614 4.99801 4.99851 + 4.99869 4.99924 5.00108 5.00181 5.00119 5.00059 5.00031 + 5.00022 5.00018 5.00011 5.00001 5.00006 4.99981 4.99977 + 4.99982 5.00012 4.99993 5.00008 5.00043 5.00048 5.00024 + 5.00008 4.99984 4.99993 5.00011 4.99996 4.9998 4.99977 4.9998 + 4.99993 5.00008 5.00011 5.00002 4.99995 4.99989 4.99993 + 5 5.00007 5.00009 4.99994 4.99977 4.9997 4.99975 4.99996 + 4.99996 4.99988 4.9997 4.99952 4.9995 4.99956 4.99973 4.99988 + 5.00005 5.00025 5.00042 5.00036 5.00031 5.00025 5.0002 5.00014 + 5.00009 5.00003 5.00002 5.00001 5.00001 5 4.99999 4.99998 + 4.99998 4.99997 4.99998 4.99998 4.99998 4.99998 4.99998 + 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5.00284 + 5.00442 5.00381 4.98997 4.99092 5.00733 5.07791 4.98237 + 4.86434 4.76835 4.74067 4.79278 4.85094 4.90068 4.93603 + 4.95698 4.96984 4.97856 4.98869 4.99904 5.0005 4.99524 5.00181 + 5.01878 5.05177 5.07986 4.98917 4.56217 3.68 2.3539 1.18541 + 0.505772 0.221044 0.115287 0.0760938 0.0589194 0.0476784 + 0.0457213 0.0412911 0.033889 0.0259741 0.0191452 0.0139018 + 0.0100235 0.00711788 0.00497657 0.00349368 0.00250021 0.00176179 + 0.00121843 0.000838368 0.000582711 0.000423458 0.000294608 + 0.000201251 0.000133748 8.6227e-05 5.44252e-05 3.30514e-05 + 1.93926e-05 1.09814e-05 5.29857e-06 1.92247e-06 3.08708e-07 + -3.74311e-07 -6.11121e-07 -7.27807e-07 -4.87604e-07 -4.80493e-07 + -9.15925e-07 -2.03774e-06 -4.01128e-06 -2.46644e-06 2.10626e-06 + 8.22422e-06 1.04922e-05 9.83047e-06 7.27106e-06 3.29654e-06 + -2.06736e-06 -2.18019e-06 -2.29303e-06 -2.40586e-06 -2.51869e-06 + -2.63153e-06 -2.24615e-06 -1.70325e-06 -1.16036e-06 -6.17468e-07 + -7.45754e-08 2.45198e-07 2.88285e-07 3.31373e-07 3.7446e-07 + 4.17548e-07 4.60635e-07 5.03723e-07 5.4681e-07 5.89898e-07 + 6.32985e-07 6.76073e-07 6.19054e-07 5.4001e-07 4.60967e-07 + 3.81923e-07 3.02879e-07 2.23836e-07 1.44792e-07 6.57488e-08 + -1.32948e-08 -9.23383e-08 -1.6698e-07 -2.23206e-07 -2.79432e-07 + -3.35658e-07 -3.91884e-07 -4.48109e-07 -5.04335e-07 -5.60561e-07 + -6.16787e-07 EOD @v[25].set(<<-'EOD') - 1.34824 1.35838 1.36465 1.34675 1.29167 1.23161 1.2201 1.2185 - 1.2181 1.21798 1.21793 1.21788 1.21785 1.21782 1.21779 1.21776 - 1.21655 1.21656 1.21669 1.21871 1.22421 1.22247 1.21858 - 1.2228 1.23803 1.27737 1.10647 0.395248 0.0600669 0.027687 - 0.0192374 0.015425 0.0130881 0.00977445 0.00696598 0.00491122 - 0.00341952 0.00237078 0.00162339 0.00109178 0.000726647 - 0.000478886 0.00031568 0.000207902 0.000143494 0.000109768 - 8.62987e-05 5.69775e-05 3.36547e-05 2.30356e-05 1.86108e-05 - 1.41861e-05 1.08293e-05 7.68835e-06 4.79593e-06 4.51019e-06 - 4.22444e-06 3.9387e-06 3.65295e-06 3.36721e-06 3.04559e-06 - 2.69981e-06 2.35403e-06 2.00825e-06 1.66247e-06 1.34508e-06 - 1.26225e-06 1.17941e-06 1.09657e-06 1.01373e-06 9.30893e-07 - 8.48054e-07 7.65216e-07 6.82378e-07 5.9954e-07 5.16702e-07 - 4.37489e-07 3.82774e-07 3.2806e-07 2.73346e-07 2.18632e-07 - 1.63917e-07 1.09203e-07 5.4489e-08 -2.2523e-10 -5.49395e-08 - -1.09654e-07 -1.52862e-07 -1.3079e-07 -1.08718e-07 -8.6646e-08 - -6.45739e-08 -4.25019e-08 -2.04298e-08 1.64229e-09 2.37144e-08 - 4.57864e-08 6.78585e-08 8.71693e-08 9.30725e-08 9.89758e-08 - 1.04879e-07 1.10782e-07 1.16685e-07 1.22589e-07 1.28492e-07 - 1.34395e-07 1.40298e-07 1.46201e-07 1.52105e-07 1.58008e-07 - 1.63911e-07 1.69814e-07 1.75718e-07 1.81621e-07 1.87524e-07 - 1.93427e-07 1.9933e-07 2.05234e-07 2.11137e-07 2.19788e-07 - 0.000393944 -0.000218983 -0.00105784 0.00172403 -0.00027134 - -0.000204147 8.79968e-06 5.93762e-05 5.83554e-05 4.13815e-05 - 3.71369e-05 3.03372e-05 2.25336e-05 1.5986e-05 1.07284e-05 - -7.5239e-05 5.60593e-05 6.97571e-05 0.000667617 0.000960856 - 0.00131749 -0.00759564 -0.0217897 -0.0450321 -0.076646 -0.128569 - -0.186391 -0.202175 -0.206953 -0.2082 -0.208416 -0.208669 - -0.208934 -0.209111 -0.209234 -0.209329 -0.209389 -0.209416 - -0.2094 -0.209329 -0.20926 -0.209204 -0.209208 -0.209285 - -0.209454 -0.209641 -0.20977 -0.209811 -0.209833 -0.209887 - -0.209653 -0.209127 -0.208893 -0.208811 -0.208777 -0.208758 - -0.208747 -0.20874 -0.208726 -0.208697 -0.208657 -0.208611 - -0.208565 -0.208524 -0.208488 -0.208451 -0.208412 -0.208373 - -0.208333 -0.208294 -0.208256 -0.208219 -0.208183 -0.208145 - -0.208107 -0.208066 -0.208029 -0.207993 -0.207959 -0.207923 - -0.207883 -0.207838 -0.207789 -0.207747 -0.20771 -0.207675 - -0.207642 -0.207605 -0.207568 -0.207531 -0.207494 -0.207457 - -0.20742 -0.207383 -0.207346 -0.207308 -0.207271 -0.207233 - -0.207196 -0.207158 -0.207121 -0.207084 -0.207046 -0.207009 - -0.206972 -0.206935 -0.206898 -0.206861 -0.206823 -0.206786 - -0.206749 -0.206712 -0.206675 -0.206638 -0.2066 -0.206563 - -0.206526 -0.206489 -0.206452 -0.206415 -0.203384 -0.20015 - -0.196872 -0.205024 -0.210727 -0.206779 -0.0685263 0.586138 - 1.4665 2.22945 2.77554 3.076 3.24926 3.34515 3.40164 3.43006 - 3.43713 3.43075 3.42886 3.4384 3.46567 3.49025 3.51287 3.53821 - 3.57841 3.39846 2.80753 2.22947 1.7549 1.30429 0.707786 - 0.303206 0.131352 0.0671706 0.0429955 0.032461 0.0257161 - 0.0239521 0.0217397 0.0179705 0.0138745 0.0102813 0.00749643 - 0.0054328 0.00386817 0.0027004 0.00189442 0.00135552 0.000954715 - 0.000659981 0.000453435 0.000313993 0.000231347 0.000159665 - 0.000108122 7.10528e-05 4.50233e-05 2.77892e-05 1.62765e-05 - 8.9893e-06 4.5471e-06 1.54614e-06 -1.6542e-07 -8.68508e-07 - -1.04369e-06 -9.63086e-07 -8.44294e-07 -6.57339e-07 -7.35885e-07 - -9.80056e-07 -1.39772e-06 -2.10199e-06 -1.37474e-06 6.13269e-07 - 3.3028e-06 4.60941e-06 4.91053e-06 4.14186e-06 2.45258e-06 - -8.7388e-09 -3.59647e-07 -7.10554e-07 -1.06146e-06 -1.41237e-06 - -1.76328e-06 -1.63073e-06 -1.34534e-06 -1.05995e-06 -7.74561e-07 - -4.8917e-07 -2.95733e-07 -2.16326e-07 -1.3692e-07 -5.75135e-08 - 2.18929e-08 1.01299e-07 1.80706e-07 2.60112e-07 3.39519e-07 - 4.18925e-07 4.98332e-07 4.83984e-07 4.4901e-07 4.14035e-07 - 3.79061e-07 3.44087e-07 3.09112e-07 2.74138e-07 2.39163e-07 - 2.04189e-07 1.69215e-07 1.26002e-07 4.83213e-08 -2.9359e-08 - -1.07039e-07 -1.8472e-07 -2.624e-07 -3.4008e-07 -4.1776e-07 - -4.95441e-07 + 1.34824 1.35838 1.36465 1.34675 1.29167 1.23161 1.2201 1.2185 + 1.2181 1.21798 1.21793 1.21788 1.21785 1.21782 1.21779 1.21776 + 1.21655 1.21656 1.21669 1.21871 1.22421 1.22247 1.21858 + 1.2228 1.23803 1.27737 1.10647 0.395248 0.0600669 0.027687 + 0.0192374 0.015425 0.0130881 0.00977445 0.00696598 0.00491122 + 0.00341952 0.00237078 0.00162339 0.00109178 0.000726647 + 0.000478886 0.00031568 0.000207902 0.000143494 0.000109768 + 8.62987e-05 5.69775e-05 3.36547e-05 2.30356e-05 1.86108e-05 + 1.41861e-05 1.08293e-05 7.68835e-06 4.79593e-06 4.51019e-06 + 4.22444e-06 3.9387e-06 3.65295e-06 3.36721e-06 3.04559e-06 + 2.69981e-06 2.35403e-06 2.00825e-06 1.66247e-06 1.34508e-06 + 1.26225e-06 1.17941e-06 1.09657e-06 1.01373e-06 9.30893e-07 + 8.48054e-07 7.65216e-07 6.82378e-07 5.9954e-07 5.16702e-07 + 4.37489e-07 3.82774e-07 3.2806e-07 2.73346e-07 2.18632e-07 + 1.63917e-07 1.09203e-07 5.4489e-08 -2.2523e-10 -5.49395e-08 + -1.09654e-07 -1.52862e-07 -1.3079e-07 -1.08718e-07 -8.6646e-08 + -6.45739e-08 -4.25019e-08 -2.04298e-08 1.64229e-09 2.37144e-08 + 4.57864e-08 6.78585e-08 8.71693e-08 9.30725e-08 9.89758e-08 + 1.04879e-07 1.10782e-07 1.16685e-07 1.22589e-07 1.28492e-07 + 1.34395e-07 1.40298e-07 1.46201e-07 1.52105e-07 1.58008e-07 + 1.63911e-07 1.69814e-07 1.75718e-07 1.81621e-07 1.87524e-07 + 1.93427e-07 1.9933e-07 2.05234e-07 2.11137e-07 2.19788e-07 + 0.000393944 -0.000218983 -0.00105784 0.00172403 -0.00027134 + -0.000204147 8.79968e-06 5.93762e-05 5.83554e-05 4.13815e-05 + 3.71369e-05 3.03372e-05 2.25336e-05 1.5986e-05 1.07284e-05 + -7.5239e-05 5.60593e-05 6.97571e-05 0.000667617 0.000960856 + 0.00131749 -0.00759564 -0.0217897 -0.0450321 -0.076646 -0.128569 + -0.186391 -0.202175 -0.206953 -0.2082 -0.208416 -0.208669 + -0.208934 -0.209111 -0.209234 -0.209329 -0.209389 -0.209416 + -0.2094 -0.209329 -0.20926 -0.209204 -0.209208 -0.209285 + -0.209454 -0.209641 -0.20977 -0.209811 -0.209833 -0.209887 + -0.209653 -0.209127 -0.208893 -0.208811 -0.208777 -0.208758 + -0.208747 -0.20874 -0.208726 -0.208697 -0.208657 -0.208611 + -0.208565 -0.208524 -0.208488 -0.208451 -0.208412 -0.208373 + -0.208333 -0.208294 -0.208256 -0.208219 -0.208183 -0.208145 + -0.208107 -0.208066 -0.208029 -0.207993 -0.207959 -0.207923 + -0.207883 -0.207838 -0.207789 -0.207747 -0.20771 -0.207675 + -0.207642 -0.207605 -0.207568 -0.207531 -0.207494 -0.207457 + -0.20742 -0.207383 -0.207346 -0.207308 -0.207271 -0.207233 + -0.207196 -0.207158 -0.207121 -0.207084 -0.207046 -0.207009 + -0.206972 -0.206935 -0.206898 -0.206861 -0.206823 -0.206786 + -0.206749 -0.206712 -0.206675 -0.206638 -0.2066 -0.206563 + -0.206526 -0.206489 -0.206452 -0.206415 -0.203384 -0.20015 + -0.196872 -0.205024 -0.210727 -0.206779 -0.0685263 0.586138 + 1.4665 2.22945 2.77554 3.076 3.24926 3.34515 3.40164 3.43006 + 3.43713 3.43075 3.42886 3.4384 3.46567 3.49025 3.51287 3.53821 + 3.57841 3.39846 2.80753 2.22947 1.7549 1.30429 0.707786 + 0.303206 0.131352 0.0671706 0.0429955 0.032461 0.0257161 + 0.0239521 0.0217397 0.0179705 0.0138745 0.0102813 0.00749643 + 0.0054328 0.00386817 0.0027004 0.00189442 0.00135552 0.000954715 + 0.000659981 0.000453435 0.000313993 0.000231347 0.000159665 + 0.000108122 7.10528e-05 4.50233e-05 2.77892e-05 1.62765e-05 + 8.9893e-06 4.5471e-06 1.54614e-06 -1.6542e-07 -8.68508e-07 + -1.04369e-06 -9.63086e-07 -8.44294e-07 -6.57339e-07 -7.35885e-07 + -9.80056e-07 -1.39772e-06 -2.10199e-06 -1.37474e-06 6.13269e-07 + 3.3028e-06 4.60941e-06 4.91053e-06 4.14186e-06 2.45258e-06 + -8.7388e-09 -3.59647e-07 -7.10554e-07 -1.06146e-06 -1.41237e-06 + -1.76328e-06 -1.63073e-06 -1.34534e-06 -1.05995e-06 -7.74561e-07 + -4.8917e-07 -2.95733e-07 -2.16326e-07 -1.3692e-07 -5.75135e-08 + 2.18929e-08 1.01299e-07 1.80706e-07 2.60112e-07 3.39519e-07 + 4.18925e-07 4.98332e-07 4.83984e-07 4.4901e-07 4.14035e-07 + 3.79061e-07 3.44087e-07 3.09112e-07 2.74138e-07 2.39163e-07 + 2.04189e-07 1.69215e-07 1.26002e-07 4.83213e-08 -2.9359e-08 + -1.07039e-07 -1.8472e-07 -2.624e-07 -3.4008e-07 -4.1776e-07 + -4.95441e-07 EOD @v[26].set(<<-'EOD') - 7.10441e-10 0.000309731 -0.000308186 -0.001694 -0.00360784 - 8.40909e-05 0.00203175 0.0012896 0.000596548 0.000277191 - 0.000161134 0.000120439 8.4915e-05 9.49929e-05 6.18812e-05 - 1.65433e-05 1.89682e-05 3.97578e-05 4.95446e-05 0.000225325 - 0.000214579 -0.00230134 -0.000451102 0.00997237 0.0341443 - 0.0449314 0.0424411 0.0341996 0.0315315 0.0308892 0.0291614 - 0.024365 0.0190282 0.0188976 0.017238 0.0138526 0.0105645 - 0.00778548 0.00561753 0.0039871 0.00279554 0.00194075 0.0013468 - 0.000934775 0.000664723 0.000498911 0.000377384 0.000254183 - 0.000163421 0.000120773 9.65058e-05 7.22384e-05 5.60316e-05 - 4.14549e-05 2.79516e-05 2.57096e-05 2.34677e-05 2.12257e-05 - 1.89837e-05 1.67417e-05 1.46737e-05 1.27228e-05 1.07719e-05 - 8.82099e-06 6.87009e-06 5.0896e-06 4.71705e-06 4.34451e-06 - 3.97196e-06 3.59941e-06 3.22686e-06 2.85431e-06 2.48176e-06 - 2.10921e-06 1.73666e-06 1.36411e-06 1.02855e-06 9.42931e-07 - 8.57316e-07 7.71701e-07 6.86086e-07 6.00471e-07 5.14856e-07 - 4.29241e-07 3.43626e-07 2.58011e-07 1.72396e-07 9.85409e-08 - 9.14091e-08 8.42773e-08 7.71456e-08 7.00138e-08 6.2882e-08 - 5.57503e-08 4.86185e-08 4.14867e-08 3.4355e-08 2.72232e-08 - 2.05821e-08 1.63235e-08 1.2065e-08 7.80643e-09 3.54786e-09 - -7.10696e-10 -4.96926e-09 -9.22782e-09 -1.34864e-08 -1.77449e-08 - -2.20035e-08 -2.62621e-08 -3.05206e-08 -3.47792e-08 -3.90378e-08 - -4.32963e-08 -4.75549e-08 -5.18134e-08 -5.6072e-08 -6.03306e-08 - -6.45891e-08 -6.88477e-08 -8.76373e-06 0.000131607 -0.00021685 - -0.000433027 0.00047234 0.000211593 -0.000189601 3.2492e-05 - 0.000575955 7.72235e-05 -0.000285172 -0.000242061 -0.000135112 - -3.50117e-05 -2.75868e-05 5.48974e-05 1.80604e-07 5.48911e-05 - 3.97478e-05 0.000192909 0.000297932 0.00402253 -0.0122366 - -0.047853 -0.0963082 -0.108071 -0.0567275 -0.0239271 -0.0178628 - -0.0233027 -0.031853 -0.0400843 -0.0482725 -0.0576154 -0.0627218 - -0.0511236 -0.0279524 -0.0150986 -0.00931091 -0.00652876 - -0.00479286 -0.00344346 -0.00249578 -0.0019532 -0.00157977 - -0.00131848 -0.00111251 -0.000939229 -0.000797445 -0.000708384 - -0.000630452 -0.000539722 -0.000508862 -0.000480596 -0.000439484 - -0.000407217 -0.000363866 -0.000329506 -0.000318642 -0.000307362 - -0.000286511 -0.000266253 -0.000242943 -0.000218107 -0.000204661 - -0.00020241 -0.000194435 -0.000185062 -0.000173042 -0.000160549 - -0.000151407 -0.000145626 -0.000145976 -0.000147342 -0.000145288 - -0.000137979 -0.000124481 -0.000123218 -0.000127453 -0.000139006 - -0.000145486 -0.000129764 -9.82749e-05 -4.72596e-05 -3.08671e-05 - -3.28834e-05 -4.52254e-05 -6.25389e-05 -6.32516e-05 -6.39643e-05 - -6.4677e-05 -6.53897e-05 -6.61023e-05 -6.6815e-05 -6.75277e-05 - -6.61005e-05 -6.45173e-05 -6.29341e-05 -6.13509e-05 -5.97676e-05 - -5.81844e-05 -5.66012e-05 -5.54231e-05 -5.4455e-05 -5.3487e-05 - -5.25189e-05 -5.15508e-05 -5.05828e-05 -4.96147e-05 -4.86466e-05 - -4.76785e-05 -4.67105e-05 -4.57424e-05 -4.47743e-05 -4.38063e-05 - -4.28382e-05 -4.18821e-05 -4.10211e-05 -4.016e-05 -3.9299e-05 - -3.8438e-05 4.29885e-05 5.14113e-05 -0.000127986 -0.000611463 - -0.000149428 0.000882394 0.00297059 -0.00405825 -0.00591067 - -0.00546997 -0.00158744 0.00190677 0.00298403 0.00268595 - 0.00196161 0.00130289 0.000783347 0.000520683 0.000565306 - 0.00053419 -0.00224696 -0.000920818 0.0132755 0.0322504 - 0.0442808 0.0638615 0.0701007 0.0539356 0.0247771 0.056244 - 0.294266 0.831368 1.45424 2.02898 2.54559 2.9937 3.35333 - 3.72609 4.06363 4.32789 4.52413 4.66504 4.7652 4.83637 4.88631 - 4.92109 4.94464 4.96046 4.97218 4.98079 4.98679 4.99076 - 4.99361 4.99555 4.99686 4.99783 4.99853 4.99902 4.99936 - 4.99959 4.99973 4.99983 4.9999 4.99993 4.99996 4.99998 5 - 5.00001 5 4.99999 4.99997 4.99994 4.99993 4.99994 4.99996 - 4.99999 5.00004 5.00006 5.00005 5.00003 5.00002 5.00001 - 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998 + 7.10441e-10 0.000309731 -0.000308186 -0.001694 -0.00360784 + 8.40909e-05 0.00203175 0.0012896 0.000596548 0.000277191 + 0.000161134 0.000120439 8.4915e-05 9.49929e-05 6.18812e-05 + 1.65433e-05 1.89682e-05 3.97578e-05 4.95446e-05 0.000225325 + 0.000214579 -0.00230134 -0.000451102 0.00997237 0.0341443 + 0.0449314 0.0424411 0.0341996 0.0315315 0.0308892 0.0291614 + 0.024365 0.0190282 0.0188976 0.017238 0.0138526 0.0105645 + 0.00778548 0.00561753 0.0039871 0.00279554 0.00194075 0.0013468 + 0.000934775 0.000664723 0.000498911 0.000377384 0.000254183 + 0.000163421 0.000120773 9.65058e-05 7.22384e-05 5.60316e-05 + 4.14549e-05 2.79516e-05 2.57096e-05 2.34677e-05 2.12257e-05 + 1.89837e-05 1.67417e-05 1.46737e-05 1.27228e-05 1.07719e-05 + 8.82099e-06 6.87009e-06 5.0896e-06 4.71705e-06 4.34451e-06 + 3.97196e-06 3.59941e-06 3.22686e-06 2.85431e-06 2.48176e-06 + 2.10921e-06 1.73666e-06 1.36411e-06 1.02855e-06 9.42931e-07 + 8.57316e-07 7.71701e-07 6.86086e-07 6.00471e-07 5.14856e-07 + 4.29241e-07 3.43626e-07 2.58011e-07 1.72396e-07 9.85409e-08 + 9.14091e-08 8.42773e-08 7.71456e-08 7.00138e-08 6.2882e-08 + 5.57503e-08 4.86185e-08 4.14867e-08 3.4355e-08 2.72232e-08 + 2.05821e-08 1.63235e-08 1.2065e-08 7.80643e-09 3.54786e-09 + -7.10696e-10 -4.96926e-09 -9.22782e-09 -1.34864e-08 -1.77449e-08 + -2.20035e-08 -2.62621e-08 -3.05206e-08 -3.47792e-08 -3.90378e-08 + -4.32963e-08 -4.75549e-08 -5.18134e-08 -5.6072e-08 -6.03306e-08 + -6.45891e-08 -6.88477e-08 -8.76373e-06 0.000131607 -0.00021685 + -0.000433027 0.00047234 0.000211593 -0.000189601 3.2492e-05 + 0.000575955 7.72235e-05 -0.000285172 -0.000242061 -0.000135112 + -3.50117e-05 -2.75868e-05 5.48974e-05 1.80604e-07 5.48911e-05 + 3.97478e-05 0.000192909 0.000297932 0.00402253 -0.0122366 + -0.047853 -0.0963082 -0.108071 -0.0567275 -0.0239271 -0.0178628 + -0.0233027 -0.031853 -0.0400843 -0.0482725 -0.0576154 -0.0627218 + -0.0511236 -0.0279524 -0.0150986 -0.00931091 -0.00652876 + -0.00479286 -0.00344346 -0.00249578 -0.0019532 -0.00157977 + -0.00131848 -0.00111251 -0.000939229 -0.000797445 -0.000708384 + -0.000630452 -0.000539722 -0.000508862 -0.000480596 -0.000439484 + -0.000407217 -0.000363866 -0.000329506 -0.000318642 -0.000307362 + -0.000286511 -0.000266253 -0.000242943 -0.000218107 -0.000204661 + -0.00020241 -0.000194435 -0.000185062 -0.000173042 -0.000160549 + -0.000151407 -0.000145626 -0.000145976 -0.000147342 -0.000145288 + -0.000137979 -0.000124481 -0.000123218 -0.000127453 -0.000139006 + -0.000145486 -0.000129764 -9.82749e-05 -4.72596e-05 -3.08671e-05 + -3.28834e-05 -4.52254e-05 -6.25389e-05 -6.32516e-05 -6.39643e-05 + -6.4677e-05 -6.53897e-05 -6.61023e-05 -6.6815e-05 -6.75277e-05 + -6.61005e-05 -6.45173e-05 -6.29341e-05 -6.13509e-05 -5.97676e-05 + -5.81844e-05 -5.66012e-05 -5.54231e-05 -5.4455e-05 -5.3487e-05 + -5.25189e-05 -5.15508e-05 -5.05828e-05 -4.96147e-05 -4.86466e-05 + -4.76785e-05 -4.67105e-05 -4.57424e-05 -4.47743e-05 -4.38063e-05 + -4.28382e-05 -4.18821e-05 -4.10211e-05 -4.016e-05 -3.9299e-05 + -3.8438e-05 4.29885e-05 5.14113e-05 -0.000127986 -0.000611463 + -0.000149428 0.000882394 0.00297059 -0.00405825 -0.00591067 + -0.00546997 -0.00158744 0.00190677 0.00298403 0.00268595 + 0.00196161 0.00130289 0.000783347 0.000520683 0.000565306 + 0.00053419 -0.00224696 -0.000920818 0.0132755 0.0322504 + 0.0442808 0.0638615 0.0701007 0.0539356 0.0247771 0.056244 + 0.294266 0.831368 1.45424 2.02898 2.54559 2.9937 3.35333 + 3.72609 4.06363 4.32789 4.52413 4.66504 4.7652 4.83637 4.88631 + 4.92109 4.94464 4.96046 4.97218 4.98079 4.98679 4.99076 + 4.99361 4.99555 4.99686 4.99783 4.99853 4.99902 4.99936 + 4.99959 4.99973 4.99983 4.9999 4.99993 4.99996 4.99998 5 + 5.00001 5 4.99999 4.99997 4.99994 4.99993 4.99994 4.99996 + 4.99999 5.00004 5.00006 5.00005 5.00003 5.00002 5.00001 + 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998 EOD @v[27].set(<<-'EOD') - 5 4.99984 4.99796 4.99478 4.9889 4.98738 4.98896 4.99087 - 4.99262 4.99419 4.99552 4.99659 4.99743 4.99807 4.99855 - 4.9989 4.99894 4.99908 4.99935 5.00001 5.0007 5.00132 5.00032 - 4.99976 5.00134 5.00339 5.00315 5.00157 5.00091 5.00058 - 5.00012 4.99944 4.99886 4.9994 4.99934 4.99899 4.99876 4.99868 - 4.99872 4.99883 4.99898 4.99914 4.9993 4.99944 4.99956 4.99967 - 4.99976 4.99982 4.99986 4.9999 4.99993 4.99997 4.99997 4.99998 - 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 - 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00009 5.00028 5.00015 4.99983 - 5.00036 4.99996 4.99834 4.99783 5.00383 5.00734 5.00387 - 5.00058 4.99893 4.99836 4.99832 4.99854 4.99873 4.99905 - 4.99927 4.99952 4.99969 4.99834 4.99536 4.99163 4.99073 - 5.0053 5.03631 5.03103 4.9008 4.62503 4.21887 3.70902 3.09967 - 2.35791 1.41912 0.519675 0.210458 0.131362 0.0980819 0.0708209 - 0.0471701 0.0323272 0.0253535 0.0199144 0.0152615 0.0117228 - 0.00917696 0.00738117 0.00609292 0.00512664 0.00436184 0.0037961 - 0.00331639 0.00289006 0.0025477 0.00226529 0.00202925 0.00182793 - 0.00165474 0.00150531 0.00137529 0.00125983 0.00115603 0.00106455 - 0.000982977 0.000911255 0.000846819 0.000790092 0.000738698 - 0.000692816 0.00065107 0.000613595 0.000579642 0.000548935 - 0.00052106 0.000495598 0.000472174 0.000450849 0.000431118 - 0.000412667 0.000395868 0.000381319 0.000368487 0.000357327 - 0.000344212 0.000330334 0.00031622 0.000303298 0.000295809 - 0.00028832 0.000280831 0.000273342 0.000265853 0.000258364 - 0.000250875 0.000245118 0.000239488 0.000233857 0.000228227 - 0.000222596 0.000216966 0.000211336 0.000207047 0.000203455 - 0.000199863 0.00019627 0.000192678 0.000189085 0.000185493 - 0.0001819 0.000178308 0.000174716 0.000171123 0.000167531 - 0.000163938 0.000160346 0.000156835 0.000153973 0.00015111 - 0.000148248 0.000145385 0.000296579 -3.96718e-05 -0.000449085 - 0.000323433 0.000750086 0.000268264 0.000149028 -0.000100249 - 7.00956e-05 0.00012605 0.00022592 0.000193036 0.000120453 - 8.07865e-05 7.65771e-05 -3.27828e-05 0.000116759 0.000169498 - 0.000409804 0.000414965 0.00092323 -0.00590633 -0.0175477 - -0.032433 -0.0559842 -0.0820373 0.0688484 0.626629 1.32929 - 2.01657 2.60925 3.12329 3.38952 3.14128 2.38463 1.23802 - 0.316019 0.107832 0.0694707 0.051837 0.035247 0.0209999 - 0.0116618 0.00967674 0.00789182 0.00574566 0.00386872 0.00258612 - 0.00167126 0.00104169 0.000641093 0.000401246 0.000277928 - 0.000171775 0.000102266 5.89376e-05 3.29258e-05 1.80463e-05 - 1.0057e-05 6.4571e-06 5.10093e-06 4.06791e-06 3.62716e-06 - 3.63321e-06 3.99625e-06 4.64368e-06 5.20886e-06 4.77728e-06 - 3.23919e-06 1.14113e-06 -1.29416e-06 -4.15607e-06 -1.88532e-06 - 5.24411e-06 1.38678e-05 1.28823e-05 3.6758e-06 -2.52285e-06 - -3.97133e-06 -4.03071e-06 -3.37154e-06 -2.71238e-06 -2.05321e-06 - -1.39404e-06 -7.34872e-07 -3.73325e-07 -1.05873e-07 1.61578e-07 - 4.2903e-07 6.96482e-07 8.18468e-07 7.60065e-07 7.01662e-07 - 6.43258e-07 5.84855e-07 5.26452e-07 4.68049e-07 4.09646e-07 - 3.51243e-07 2.9284e-07 2.34437e-07 1.71213e-07 1.06928e-07 - 4.2644e-08 -2.16403e-08 -8.59247e-08 -1.50209e-07 -2.14493e-07 - -2.78778e-07 -3.43062e-07 -4.07346e-07 -4.55065e-07 -4.3348e-07 - -4.11896e-07 -3.90311e-07 -3.68726e-07 -3.47141e-07 -3.25556e-07 - -3.03971e-07 -2.82386e-07 + 5 4.99984 4.99796 4.99478 4.9889 4.98738 4.98896 4.99087 + 4.99262 4.99419 4.99552 4.99659 4.99743 4.99807 4.99855 + 4.9989 4.99894 4.99908 4.99935 5.00001 5.0007 5.00132 5.00032 + 4.99976 5.00134 5.00339 5.00315 5.00157 5.00091 5.00058 + 5.00012 4.99944 4.99886 4.9994 4.99934 4.99899 4.99876 4.99868 + 4.99872 4.99883 4.99898 4.99914 4.9993 4.99944 4.99956 4.99967 + 4.99976 4.99982 4.99986 4.9999 4.99993 4.99997 4.99997 4.99998 + 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 + 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00009 5.00028 5.00015 4.99983 + 5.00036 4.99996 4.99834 4.99783 5.00383 5.00734 5.00387 + 5.00058 4.99893 4.99836 4.99832 4.99854 4.99873 4.99905 + 4.99927 4.99952 4.99969 4.99834 4.99536 4.99163 4.99073 + 5.0053 5.03631 5.03103 4.9008 4.62503 4.21887 3.70902 3.09967 + 2.35791 1.41912 0.519675 0.210458 0.131362 0.0980819 0.0708209 + 0.0471701 0.0323272 0.0253535 0.0199144 0.0152615 0.0117228 + 0.00917696 0.00738117 0.00609292 0.00512664 0.00436184 0.0037961 + 0.00331639 0.00289006 0.0025477 0.00226529 0.00202925 0.00182793 + 0.00165474 0.00150531 0.00137529 0.00125983 0.00115603 0.00106455 + 0.000982977 0.000911255 0.000846819 0.000790092 0.000738698 + 0.000692816 0.00065107 0.000613595 0.000579642 0.000548935 + 0.00052106 0.000495598 0.000472174 0.000450849 0.000431118 + 0.000412667 0.000395868 0.000381319 0.000368487 0.000357327 + 0.000344212 0.000330334 0.00031622 0.000303298 0.000295809 + 0.00028832 0.000280831 0.000273342 0.000265853 0.000258364 + 0.000250875 0.000245118 0.000239488 0.000233857 0.000228227 + 0.000222596 0.000216966 0.000211336 0.000207047 0.000203455 + 0.000199863 0.00019627 0.000192678 0.000189085 0.000185493 + 0.0001819 0.000178308 0.000174716 0.000171123 0.000167531 + 0.000163938 0.000160346 0.000156835 0.000153973 0.00015111 + 0.000148248 0.000145385 0.000296579 -3.96718e-05 -0.000449085 + 0.000323433 0.000750086 0.000268264 0.000149028 -0.000100249 + 7.00956e-05 0.00012605 0.00022592 0.000193036 0.000120453 + 8.07865e-05 7.65771e-05 -3.27828e-05 0.000116759 0.000169498 + 0.000409804 0.000414965 0.00092323 -0.00590633 -0.0175477 + -0.032433 -0.0559842 -0.0820373 0.0688484 0.626629 1.32929 + 2.01657 2.60925 3.12329 3.38952 3.14128 2.38463 1.23802 + 0.316019 0.107832 0.0694707 0.051837 0.035247 0.0209999 + 0.0116618 0.00967674 0.00789182 0.00574566 0.00386872 0.00258612 + 0.00167126 0.00104169 0.000641093 0.000401246 0.000277928 + 0.000171775 0.000102266 5.89376e-05 3.29258e-05 1.80463e-05 + 1.0057e-05 6.4571e-06 5.10093e-06 4.06791e-06 3.62716e-06 + 3.63321e-06 3.99625e-06 4.64368e-06 5.20886e-06 4.77728e-06 + 3.23919e-06 1.14113e-06 -1.29416e-06 -4.15607e-06 -1.88532e-06 + 5.24411e-06 1.38678e-05 1.28823e-05 3.6758e-06 -2.52285e-06 + -3.97133e-06 -4.03071e-06 -3.37154e-06 -2.71238e-06 -2.05321e-06 + -1.39404e-06 -7.34872e-07 -3.73325e-07 -1.05873e-07 1.61578e-07 + 4.2903e-07 6.96482e-07 8.18468e-07 7.60065e-07 7.01662e-07 + 6.43258e-07 5.84855e-07 5.26452e-07 4.68049e-07 4.09646e-07 + 3.51243e-07 2.9284e-07 2.34437e-07 1.71213e-07 1.06928e-07 + 4.2644e-08 -2.16403e-08 -8.59247e-08 -1.50209e-07 -2.14493e-07 + -2.78778e-07 -3.43062e-07 -4.07346e-07 -4.55065e-07 -4.3348e-07 + -4.11896e-07 -3.90311e-07 -3.68726e-07 -3.47141e-07 -3.25556e-07 + -3.03971e-07 -2.82386e-07 EOD @v[28].set(<<-'EOD') - 0.368163 0.361756 0.327463 0.269513 0.149476 0.0805716 0.0501146 - 0.03403 0.0230886 0.0160474 0.0116071 0.00870013 0.00679614 - 0.00542384 0.00432512 0.00340653 -0.00129719 -0.00399429 - -0.00318719 0.00443085 0.0150156 0.0334147 0.0132288 -0.0189751 - -0.0508377 -0.0252174 -0.0142489 -0.00675908 -0.0038653 - -0.00243423 -0.00168891 -0.00120901 -0.000900426 -0.000685575 - -0.000557595 -0.000457268 -0.000377427 -0.000315269 -0.000266613 - -0.000228397 -0.000198283 -0.000174248 -0.000154886 -0.00013892 - -0.000125864 -0.000115189 -0.000105841 -9.66611e-05 -8.84262e-05 - -8.23872e-05 -7.74668e-05 -7.25463e-05 -6.79992e-05 -6.35276e-05 - -5.92413e-05 -5.68994e-05 -5.45574e-05 -5.22154e-05 -4.98735e-05 - -4.75315e-05 -4.54981e-05 -4.36726e-05 -4.18471e-05 -4.00216e-05 - -3.81961e-05 -3.64559e-05 -3.54209e-05 -3.43858e-05 -3.33508e-05 - -3.23157e-05 -3.12807e-05 -3.02456e-05 -2.92105e-05 -2.81755e-05 - -2.71404e-05 -2.61054e-05 -2.51232e-05 -2.44984e-05 -2.38736e-05 - -2.32487e-05 -2.26239e-05 -2.19991e-05 -2.13742e-05 -2.07494e-05 - -2.01246e-05 -1.94998e-05 -1.88749e-05 -1.82865e-05 -1.79044e-05 - -1.75224e-05 -1.71403e-05 -1.67582e-05 -1.63762e-05 -1.59941e-05 - -1.56121e-05 -1.523e-05 -1.4848e-05 -1.44659e-05 -1.41138e-05 - -1.39075e-05 -1.37011e-05 -1.34947e-05 -1.32883e-05 -1.30819e-05 - -1.28755e-05 -1.26691e-05 -1.24627e-05 -1.22563e-05 -1.205e-05 - -1.18436e-05 -1.16372e-05 -1.14308e-05 -1.12244e-05 -1.1018e-05 - -1.08116e-05 -1.06052e-05 -1.03988e-05 -1.01924e-05 -9.98605e-06 - -9.77966e-06 -2.85319e-05 0.00281092 0.00180106 -0.000981083 - 0.00551926 -0.00119763 -0.0295069 -0.0367677 0.064749 0.119022 - 0.0882007 0.0552062 0.03418 0.0223243 0.015545 0.011949 - 0.00757134 0.00667655 0.00583243 0.00644443 0.00650959 -0.0302575 - -0.0437806 -0.0355466 0.0381776 0.282109 0.674178 1.07582 - 1.45189 1.789 2.08649 2.34663 2.57245 2.81211 3.04778 3.2523 - 3.45877 3.65593 3.83396 3.9923 4.13368 4.25864 4.36719 4.46064 - 4.54086 4.60962 4.66835 4.71838 4.76094 4.79716 4.82796 - 4.85413 4.87634 4.89518 4.91116 4.92476 4.93631 4.94608 - 4.95434 4.9613 4.96715 4.97211 4.97638 4.98001 4.98312 4.98571 - 4.98795 4.98979 4.99138 4.99269 4.99381 4.99474 4.99551 - 4.99615 4.99668 4.99713 4.99752 4.99783 4.99811 4.99836 - 4.99858 4.99873 4.99884 4.99892 4.999 4.99907 4.99912 4.99916 - 4.99921 4.99926 4.99932 4.99937 4.99942 4.99948 4.99953 - 4.99956 4.99958 4.99961 4.99963 4.99966 4.99968 4.99971 - 4.99972 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978 - 4.99979 4.9998 4.9998 4.99981 4.99982 4.99983 4.99984 4.99985 - 4.99986 4.99986 4.99987 4.99987 5.00498 5.00354 4.99359 - 4.98981 5.00498 5.00099 5.00041 5.00022 5.00015 5.00012 - 5.0001 5.00008 5.00005 5.00003 5 4.99431 4.99459 4.99591 - 5.00087 5.01029 5.03935 4.92784 4.51643 3.78356 2.68745 - 1.43417 0.583128 0.205094 0.0777337 0.0391566 0.02723 0.023883 - 0.018808 0.010165 0.00254623 -0.00377463 -0.0038097 0.00144145 - 0.00267231 0.00193045 0.00144538 0.00121758 0.00112893 0.00109424 - 0.0010226 0.000948072 0.000882573 0.000826996 0.000776391 - 0.000729719 0.000686499 0.000647333 0.000610108 0.000575631 - 0.000545069 0.000515485 0.000488514 0.000465316 0.000443215 - 0.000422454 0.00040292 0.00038488 0.000368472 0.000353628 - 0.000339643 0.000326197 0.000313483 0.000302884 0.000294038 - 0.000284003 0.000270941 0.000254925 0.000246511 0.000244089 - 0.000245538 0.000242099 0.000235728 0.000227482 0.000218001 - 0.000207257 0.000202127 0.000196997 0.000191868 0.000186738 - 0.000181608 0.00017758 0.000173899 0.000170219 0.000166538 - 0.000162857 0.000159576 0.00015679 0.000154005 0.000151219 - 0.000148433 0.000145647 0.000142861 0.000140076 0.00013729 - 0.000134504 0.000131718 0.000129603 0.000127635 0.000125668 - 0.0001237 0.000121732 0.000119765 0.000117797 0.000115829 - 0.000113862 0.000111894 0.000109993 0.000108372 0.000106751 - 0.00010513 0.000103509 0.000101887 0.000100266 9.86449e-05 - 9.70237e-05 + 0.368163 0.361756 0.327463 0.269513 0.149476 0.0805716 0.0501146 + 0.03403 0.0230886 0.0160474 0.0116071 0.00870013 0.00679614 + 0.00542384 0.00432512 0.00340653 -0.00129719 -0.00399429 + -0.00318719 0.00443085 0.0150156 0.0334147 0.0132288 -0.0189751 + -0.0508377 -0.0252174 -0.0142489 -0.00675908 -0.0038653 + -0.00243423 -0.00168891 -0.00120901 -0.000900426 -0.000685575 + -0.000557595 -0.000457268 -0.000377427 -0.000315269 -0.000266613 + -0.000228397 -0.000198283 -0.000174248 -0.000154886 -0.00013892 + -0.000125864 -0.000115189 -0.000105841 -9.66611e-05 -8.84262e-05 + -8.23872e-05 -7.74668e-05 -7.25463e-05 -6.79992e-05 -6.35276e-05 + -5.92413e-05 -5.68994e-05 -5.45574e-05 -5.22154e-05 -4.98735e-05 + -4.75315e-05 -4.54981e-05 -4.36726e-05 -4.18471e-05 -4.00216e-05 + -3.81961e-05 -3.64559e-05 -3.54209e-05 -3.43858e-05 -3.33508e-05 + -3.23157e-05 -3.12807e-05 -3.02456e-05 -2.92105e-05 -2.81755e-05 + -2.71404e-05 -2.61054e-05 -2.51232e-05 -2.44984e-05 -2.38736e-05 + -2.32487e-05 -2.26239e-05 -2.19991e-05 -2.13742e-05 -2.07494e-05 + -2.01246e-05 -1.94998e-05 -1.88749e-05 -1.82865e-05 -1.79044e-05 + -1.75224e-05 -1.71403e-05 -1.67582e-05 -1.63762e-05 -1.59941e-05 + -1.56121e-05 -1.523e-05 -1.4848e-05 -1.44659e-05 -1.41138e-05 + -1.39075e-05 -1.37011e-05 -1.34947e-05 -1.32883e-05 -1.30819e-05 + -1.28755e-05 -1.26691e-05 -1.24627e-05 -1.22563e-05 -1.205e-05 + -1.18436e-05 -1.16372e-05 -1.14308e-05 -1.12244e-05 -1.1018e-05 + -1.08116e-05 -1.06052e-05 -1.03988e-05 -1.01924e-05 -9.98605e-06 + -9.77966e-06 -2.85319e-05 0.00281092 0.00180106 -0.000981083 + 0.00551926 -0.00119763 -0.0295069 -0.0367677 0.064749 0.119022 + 0.0882007 0.0552062 0.03418 0.0223243 0.015545 0.011949 + 0.00757134 0.00667655 0.00583243 0.00644443 0.00650959 -0.0302575 + -0.0437806 -0.0355466 0.0381776 0.282109 0.674178 1.07582 + 1.45189 1.789 2.08649 2.34663 2.57245 2.81211 3.04778 3.2523 + 3.45877 3.65593 3.83396 3.9923 4.13368 4.25864 4.36719 4.46064 + 4.54086 4.60962 4.66835 4.71838 4.76094 4.79716 4.82796 + 4.85413 4.87634 4.89518 4.91116 4.92476 4.93631 4.94608 + 4.95434 4.9613 4.96715 4.97211 4.97638 4.98001 4.98312 4.98571 + 4.98795 4.98979 4.99138 4.99269 4.99381 4.99474 4.99551 + 4.99615 4.99668 4.99713 4.99752 4.99783 4.99811 4.99836 + 4.99858 4.99873 4.99884 4.99892 4.999 4.99907 4.99912 4.99916 + 4.99921 4.99926 4.99932 4.99937 4.99942 4.99948 4.99953 + 4.99956 4.99958 4.99961 4.99963 4.99966 4.99968 4.99971 + 4.99972 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978 + 4.99979 4.9998 4.9998 4.99981 4.99982 4.99983 4.99984 4.99985 + 4.99986 4.99986 4.99987 4.99987 5.00498 5.00354 4.99359 + 4.98981 5.00498 5.00099 5.00041 5.00022 5.00015 5.00012 + 5.0001 5.00008 5.00005 5.00003 5 4.99431 4.99459 4.99591 + 5.00087 5.01029 5.03935 4.92784 4.51643 3.78356 2.68745 + 1.43417 0.583128 0.205094 0.0777337 0.0391566 0.02723 0.023883 + 0.018808 0.010165 0.00254623 -0.00377463 -0.0038097 0.00144145 + 0.00267231 0.00193045 0.00144538 0.00121758 0.00112893 0.00109424 + 0.0010226 0.000948072 0.000882573 0.000826996 0.000776391 + 0.000729719 0.000686499 0.000647333 0.000610108 0.000575631 + 0.000545069 0.000515485 0.000488514 0.000465316 0.000443215 + 0.000422454 0.00040292 0.00038488 0.000368472 0.000353628 + 0.000339643 0.000326197 0.000313483 0.000302884 0.000294038 + 0.000284003 0.000270941 0.000254925 0.000246511 0.000244089 + 0.000245538 0.000242099 0.000235728 0.000227482 0.000218001 + 0.000207257 0.000202127 0.000196997 0.000191868 0.000186738 + 0.000181608 0.00017758 0.000173899 0.000170219 0.000166538 + 0.000162857 0.000159576 0.00015679 0.000154005 0.000151219 + 0.000148433 0.000145647 0.000142861 0.000140076 0.00013729 + 0.000134504 0.000131718 0.000129603 0.000127635 0.000125668 + 0.0001237 0.000121732 0.000119765 0.000117797 0.000115829 + 0.000113862 0.000111894 0.000109993 0.000108372 0.000106751 + 0.00010513 0.000103509 0.000101887 0.000100266 9.86449e-05 + 9.70237e-05 EOD @v[29].set(<<-'EOD') - 5 4.99899 4.99654 4.99327 4.9863 4.98954 4.99212 4.99378 - 4.9951 4.99624 4.99715 4.99786 4.99839 4.99879 4.99909 4.99931 - 4.99922 4.99933 4.99971 5.00064 5.00084 5.00123 4.99865 - 4.99853 4.99983 5.00457 5.00242 5.00105 5.00062 5.00042 - 4.99971 4.9994 4.9992 4.9996 4.99955 4.99932 4.99918 4.99915 - 4.99919 4.99927 4.99937 4.99948 4.99957 4.99966 4.99974 - 4.9998 4.99985 4.99989 4.99992 4.99993 4.99994 4.99994 4.99996 - 4.99998 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001 - 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99998 4.99998 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 - 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5 5 5 5 5 5 4.9997 4.99998 4.99954 4.99963 - 5.00059 4.99945 4.99732 4.99957 5.00919 5.00558 5.00033 - 4.99851 4.9983 4.99854 4.99871 4.99928 4.99914 4.99939 4.99952 - 4.9998 4.99976 4.99744 4.99598 4.99478 4.99806 5.01911 5.04602 - 5.05469 5.01317 4.89484 4.69655 4.42036 4.06069 3.60793 - 3.12531 2.72975 2.45187 2.25081 2.09841 1.98509 1.90211 - 1.84084 1.79411 1.7574 1.72763 1.70283 1.68188 1.66389 1.64823 - 1.63438 1.62201 1.61088 1.60081 1.59163 1.58323 1.57549 - 1.56835 1.56173 1.55558 1.54985 1.54451 1.53951 1.53479 - 1.53035 1.52615 1.5222 1.51845 1.5149 1.51153 1.50834 1.50529 - 1.5024 1.49964 1.497 1.49449 1.49208 1.48977 1.48755 1.48542 - 1.48336 1.48138 1.47948 1.47765 1.4759 1.47419 1.47255 1.47096 - 1.46949 1.46823 1.46696 1.4657 1.46444 1.46317 1.46191 1.46065 - 1.45956 1.4585 1.45743 1.45636 1.45529 1.45422 1.45315 1.45226 - 1.45145 1.45064 1.44983 1.44902 1.44821 1.4474 1.44659 1.44579 - 1.44498 1.44417 1.44336 1.44255 1.44174 1.44094 1.44019 - 1.43944 1.43868 1.43793 1.43765 1.43679 1.43515 1.43405 - 1.43478 1.43387 1.43345 1.43184 1.43086 1.43021 1.43003 - 1.42988 1.42944 1.42883 1.42818 1.42702 1.42642 1.42595 - 1.42586 1.42616 1.42783 1.41733 1.38106 1.30738 1.3877 2.09819 - 3.05285 3.58059 3.77601 3.87609 4.02557 4.24887 4.4608 4.60411 - 4.72109 4.8255 4.90465 4.97379 5.01253 5.01532 5.01239 5.0092 - 5.00665 5.00474 5.00333 5.00232 5.00163 5.00117 5.00082 - 5.00057 5.00039 5.00027 5.00019 5.00013 5.00009 5.00006 - 5.00004 5.00003 5.00002 5.00001 5.00001 5 5 5 4.99998 4.99995 - 4.99992 4.99996 5.00005 5.00012 5.00008 4.99996 4.9999 4.99985 - 4.99986 4.99997 5.00021 5.0003 5.00024 5.00009 5.00007 5.00005 - 5.00003 5.00001 4.99998 4.99998 4.99998 4.99999 4.99999 - 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998 - 4.99998 4.99998 + 5 4.99899 4.99654 4.99327 4.9863 4.98954 4.99212 4.99378 + 4.9951 4.99624 4.99715 4.99786 4.99839 4.99879 4.99909 4.99931 + 4.99922 4.99933 4.99971 5.00064 5.00084 5.00123 4.99865 + 4.99853 4.99983 5.00457 5.00242 5.00105 5.00062 5.00042 + 4.99971 4.9994 4.9992 4.9996 4.99955 4.99932 4.99918 4.99915 + 4.99919 4.99927 4.99937 4.99948 4.99957 4.99966 4.99974 + 4.9998 4.99985 4.99989 4.99992 4.99993 4.99994 4.99994 4.99996 + 4.99998 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001 + 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99998 4.99998 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 + 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5 5 5 5 5 5 4.9997 4.99998 4.99954 4.99963 + 5.00059 4.99945 4.99732 4.99957 5.00919 5.00558 5.00033 + 4.99851 4.9983 4.99854 4.99871 4.99928 4.99914 4.99939 4.99952 + 4.9998 4.99976 4.99744 4.99598 4.99478 4.99806 5.01911 5.04602 + 5.05469 5.01317 4.89484 4.69655 4.42036 4.06069 3.60793 + 3.12531 2.72975 2.45187 2.25081 2.09841 1.98509 1.90211 + 1.84084 1.79411 1.7574 1.72763 1.70283 1.68188 1.66389 1.64823 + 1.63438 1.62201 1.61088 1.60081 1.59163 1.58323 1.57549 + 1.56835 1.56173 1.55558 1.54985 1.54451 1.53951 1.53479 + 1.53035 1.52615 1.5222 1.51845 1.5149 1.51153 1.50834 1.50529 + 1.5024 1.49964 1.497 1.49449 1.49208 1.48977 1.48755 1.48542 + 1.48336 1.48138 1.47948 1.47765 1.4759 1.47419 1.47255 1.47096 + 1.46949 1.46823 1.46696 1.4657 1.46444 1.46317 1.46191 1.46065 + 1.45956 1.4585 1.45743 1.45636 1.45529 1.45422 1.45315 1.45226 + 1.45145 1.45064 1.44983 1.44902 1.44821 1.4474 1.44659 1.44579 + 1.44498 1.44417 1.44336 1.44255 1.44174 1.44094 1.44019 + 1.43944 1.43868 1.43793 1.43765 1.43679 1.43515 1.43405 + 1.43478 1.43387 1.43345 1.43184 1.43086 1.43021 1.43003 + 1.42988 1.42944 1.42883 1.42818 1.42702 1.42642 1.42595 + 1.42586 1.42616 1.42783 1.41733 1.38106 1.30738 1.3877 2.09819 + 3.05285 3.58059 3.77601 3.87609 4.02557 4.24887 4.4608 4.60411 + 4.72109 4.8255 4.90465 4.97379 5.01253 5.01532 5.01239 5.0092 + 5.00665 5.00474 5.00333 5.00232 5.00163 5.00117 5.00082 + 5.00057 5.00039 5.00027 5.00019 5.00013 5.00009 5.00006 + 5.00004 5.00003 5.00002 5.00001 5.00001 5 5 5 4.99998 4.99995 + 4.99992 4.99996 5.00005 5.00012 5.00008 4.99996 4.9999 4.99985 + 4.99986 4.99997 5.00021 5.0003 5.00024 5.00009 5.00007 5.00005 + 5.00003 5.00001 4.99998 4.99998 4.99998 4.99999 4.99999 + 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998 + 4.99998 4.99998 EOD @v[30].set(<<-'EOD') - 7.10441e-10 5.70385e-05 0.000226143 0.000131916 -0.000887764 - -8.01837e-05 -3.49653e-05 9.40039e-05 0.000118663 0.000108025 - 8.6059e-05 6.33268e-05 4.99295e-05 3.16843e-05 3.60692e-05 - 2.07572e-05 -8.6375e-05 3.44583e-05 8.07397e-05 0.000196296 - 0.000115615 -7.12768e-05 -0.000129812 -4.18679e-05 7.94364e-05 - 0.000182034 -5.41226e-05 -0.000451819 -0.000713937 -0.00129863 - -0.00262186 -0.00213417 -0.00133767 0.000775698 0.000969902 - 0.000549281 0.000280946 0.000140321 8.6919e-05 7.22446e-05 - 6.5631e-05 6.45263e-05 6.63087e-05 7.17391e-05 7.59042e-05 - 7.59172e-05 7.03353e-05 6.33558e-05 5.31136e-05 4.64278e-05 - 4.40594e-05 4.16909e-05 4.05674e-05 3.96957e-05 3.87875e-05 - 3.74977e-05 3.62079e-05 3.49181e-05 3.36283e-05 3.23385e-05 - 3.12427e-05 3.02775e-05 2.93124e-05 2.83472e-05 2.7382e-05 - 2.64613e-05 2.59077e-05 2.5354e-05 2.48004e-05 2.42468e-05 - 2.36931e-05 2.31395e-05 2.25859e-05 2.20322e-05 2.14786e-05 - 2.0925e-05 2.03916e-05 1.9995e-05 1.95984e-05 1.92019e-05 - 1.88053e-05 1.84087e-05 1.80122e-05 1.76156e-05 1.7219e-05 - 1.68225e-05 1.64259e-05 1.6051e-05 1.57991e-05 1.55471e-05 - 1.52952e-05 1.50433e-05 1.47913e-05 1.45394e-05 1.42875e-05 - 1.40356e-05 1.37836e-05 1.35317e-05 1.32978e-05 1.31513e-05 - 1.30048e-05 1.28583e-05 1.27118e-05 1.25653e-05 1.24188e-05 - 1.22724e-05 1.21259e-05 1.19794e-05 1.18329e-05 1.16864e-05 - 1.15399e-05 1.13934e-05 1.12469e-05 1.11005e-05 1.0954e-05 - 1.08075e-05 1.0661e-05 1.05145e-05 1.0368e-05 1.02215e-05 - 1.76447e-05 7.21516e-05 -3.59786e-05 -0.000159618 0.000156236 - 0.000135106 -0.000336402 -0.000302283 0.000699323 0.000473866 - -0.000156146 -0.000225625 -0.000123592 -3.78116e-05 8.47472e-06 - 2.43387e-06 -7.44762e-05 7.80111e-05 9.43608e-05 0.000170159 - 8.83919e-05 -0.00018802 -0.000373512 -0.000390597 0.000156875 - 0.0032343 0.00776304 -0.000566905 -0.00760695 -0.0159226 - -0.0245989 -0.0331402 -0.0100902 0.067837 0.266702 0.910818 - 1.82282 2.69714 3.43247 3.98325 4.32893 4.51529 4.67087 - 4.79288 4.87574 4.92797 4.95902 4.97655 4.98622 4.99195 - 4.99526 4.99735 4.9991 4.99974 4.99982 4.99974 4.99961 4.9995 - 4.99943 4.9994 4.9994 4.99942 4.99944 4.99948 4.99952 4.99956 - 4.99961 4.99965 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986 - 4.99988 4.9999 4.99991 4.99992 4.99993 4.99994 4.99995 4.99995 - 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999 - 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5 - 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 5 5.00019 4.99888 4.99663 4.99457 4.99902 - 5.00229 5.00323 5.00302 5.0023 5.0015 5.00085 5.00041 5.00013 - 4.99993 4.99979 4.99948 4.99954 4.99983 5.00055 5.00109 - 5.00009 4.9987 4.998 4.99755 4.99676 4.99618 5.01091 5.05272 - 5.04156 4.80112 4.27692 3.42343 2.23953 0.967179 0.429813 - 0.540757 1.32991 2.32147 3.14903 3.78143 4.22325 4.47978 - 4.59448 4.69875 4.79798 4.87419 4.92339 4.95249 4.97174 - 4.98408 4.99124 4.99478 4.99729 4.99868 4.9992 4.99941 4.99947 - 4.99946 4.99943 4.9994 4.99939 4.9994 4.99942 4.99946 4.99951 - 4.99956 4.99961 4.99967 4.99973 4.99977 4.9998 4.99981 4.99983 - 4.99984 4.99987 4.99992 5.00001 5.00005 5.00001 4.99994 - 4.99995 4.99995 4.99996 4.99996 4.99996 4.99997 4.99997 - 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 - 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 - 4.99998 4.99998 4.99998 + 7.10441e-10 5.70385e-05 0.000226143 0.000131916 -0.000887764 + -8.01837e-05 -3.49653e-05 9.40039e-05 0.000118663 0.000108025 + 8.6059e-05 6.33268e-05 4.99295e-05 3.16843e-05 3.60692e-05 + 2.07572e-05 -8.6375e-05 3.44583e-05 8.07397e-05 0.000196296 + 0.000115615 -7.12768e-05 -0.000129812 -4.18679e-05 7.94364e-05 + 0.000182034 -5.41226e-05 -0.000451819 -0.000713937 -0.00129863 + -0.00262186 -0.00213417 -0.00133767 0.000775698 0.000969902 + 0.000549281 0.000280946 0.000140321 8.6919e-05 7.22446e-05 + 6.5631e-05 6.45263e-05 6.63087e-05 7.17391e-05 7.59042e-05 + 7.59172e-05 7.03353e-05 6.33558e-05 5.31136e-05 4.64278e-05 + 4.40594e-05 4.16909e-05 4.05674e-05 3.96957e-05 3.87875e-05 + 3.74977e-05 3.62079e-05 3.49181e-05 3.36283e-05 3.23385e-05 + 3.12427e-05 3.02775e-05 2.93124e-05 2.83472e-05 2.7382e-05 + 2.64613e-05 2.59077e-05 2.5354e-05 2.48004e-05 2.42468e-05 + 2.36931e-05 2.31395e-05 2.25859e-05 2.20322e-05 2.14786e-05 + 2.0925e-05 2.03916e-05 1.9995e-05 1.95984e-05 1.92019e-05 + 1.88053e-05 1.84087e-05 1.80122e-05 1.76156e-05 1.7219e-05 + 1.68225e-05 1.64259e-05 1.6051e-05 1.57991e-05 1.55471e-05 + 1.52952e-05 1.50433e-05 1.47913e-05 1.45394e-05 1.42875e-05 + 1.40356e-05 1.37836e-05 1.35317e-05 1.32978e-05 1.31513e-05 + 1.30048e-05 1.28583e-05 1.27118e-05 1.25653e-05 1.24188e-05 + 1.22724e-05 1.21259e-05 1.19794e-05 1.18329e-05 1.16864e-05 + 1.15399e-05 1.13934e-05 1.12469e-05 1.11005e-05 1.0954e-05 + 1.08075e-05 1.0661e-05 1.05145e-05 1.0368e-05 1.02215e-05 + 1.76447e-05 7.21516e-05 -3.59786e-05 -0.000159618 0.000156236 + 0.000135106 -0.000336402 -0.000302283 0.000699323 0.000473866 + -0.000156146 -0.000225625 -0.000123592 -3.78116e-05 8.47472e-06 + 2.43387e-06 -7.44762e-05 7.80111e-05 9.43608e-05 0.000170159 + 8.83919e-05 -0.00018802 -0.000373512 -0.000390597 0.000156875 + 0.0032343 0.00776304 -0.000566905 -0.00760695 -0.0159226 + -0.0245989 -0.0331402 -0.0100902 0.067837 0.266702 0.910818 + 1.82282 2.69714 3.43247 3.98325 4.32893 4.51529 4.67087 + 4.79288 4.87574 4.92797 4.95902 4.97655 4.98622 4.99195 + 4.99526 4.99735 4.9991 4.99974 4.99982 4.99974 4.99961 4.9995 + 4.99943 4.9994 4.9994 4.99942 4.99944 4.99948 4.99952 4.99956 + 4.99961 4.99965 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986 + 4.99988 4.9999 4.99991 4.99992 4.99993 4.99994 4.99995 4.99995 + 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999 + 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5 + 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 5 5.00019 4.99888 4.99663 4.99457 4.99902 + 5.00229 5.00323 5.00302 5.0023 5.0015 5.00085 5.00041 5.00013 + 4.99993 4.99979 4.99948 4.99954 4.99983 5.00055 5.00109 + 5.00009 4.9987 4.998 4.99755 4.99676 4.99618 5.01091 5.05272 + 5.04156 4.80112 4.27692 3.42343 2.23953 0.967179 0.429813 + 0.540757 1.32991 2.32147 3.14903 3.78143 4.22325 4.47978 + 4.59448 4.69875 4.79798 4.87419 4.92339 4.95249 4.97174 + 4.98408 4.99124 4.99478 4.99729 4.99868 4.9992 4.99941 4.99947 + 4.99946 4.99943 4.9994 4.99939 4.9994 4.99942 4.99946 4.99951 + 4.99956 4.99961 4.99967 4.99973 4.99977 4.9998 4.99981 4.99983 + 4.99984 4.99987 4.99992 5.00001 5.00005 5.00001 4.99994 + 4.99995 4.99995 4.99996 4.99996 4.99996 4.99997 4.99997 + 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 + 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 + 4.99998 4.99998 4.99998 EOD @v[31].set(<<-'EOD') - 1.8179e-09 -5.28841e-06 -1.44913e-05 -3.62932e-05 -9.75719e-05 - 0.000141781 3.73396e-05 -1.65603e-05 -1.5271e-05 -6.73884e-06 - 4.40157e-06 -4.85345e-06 -1.02964e-05 2.03126e-05 -1.89457e-05 - -8.75564e-06 7.67422e-06 4.71103e-06 1.29798e-05 6.13469e-06 - -1.14363e-05 -0.0394563 -0.0477298 -0.0622012 -0.0519225 - 0.262499 0.943611 1.67052 2.31017 2.84028 3.28467 3.61582 - 3.85887 4.13011 4.36511 4.54063 4.67013 4.76408 4.83263 - 4.8825 4.91837 4.94373 4.96117 4.97318 4.98093 4.98562 4.98906 - 4.99267 4.99539 4.99666 4.99731 4.99797 4.99844 4.99887 - 4.99927 4.99933 4.99938 4.99944 4.99949 4.99955 4.9996 4.99965 - 4.9997 4.99975 4.9998 4.99985 4.99986 4.99987 4.99989 4.9999 - 4.99991 4.99992 4.99993 4.99995 4.99996 4.99997 4.99998 - 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001 - 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99997 5.00002 5.00004 5.0001 5.0001 4.99987 5.00009 - 5.00021 5.00002 5.00004 4.99988 5.00013 4.99993 5.00026 - 4.99973 5 5.00006 5.00009 5.00004 5.00004 5.04854 4.82711 - 4.04208 2.64155 0.838902 0.19014 0.0982549 0.0723197 0.0576863 - 0.0427644 0.0301979 0.020146 0.0135728 0.00980358 0.00774482 - 0.00586604 0.0036687 0.00211511 0.00121906 0.000647581 0.000828436 - 0.00190938 0.00224254 0.00199956 0.00165488 0.00135612 0.00113715 - 0.000984181 0.000877175 0.000789973 0.000741139 0.000689338 - 0.000625676 0.000586082 0.000550152 0.000529573 0.000505606 - 0.000482117 0.000460574 0.000441649 0.000424674 0.000408398 - 0.000391914 0.000376272 0.000361487 0.000348181 0.000336045 - 0.000324466 0.000313545 0.000303046 0.000293056 0.00028356 - 0.000274586 0.000266155 0.000258279 0.000250938 0.000243789 - 0.000236912 0.000230244 0.000224186 0.000219291 0.000215346 - 0.000212468 0.000207291 0.000200862 0.00019368 0.000186767 - 0.000183515 0.000180263 0.00017701 0.000173758 0.000170506 - 0.000167253 0.000164001 0.000161164 0.000158357 0.00015555 - 0.000152743 0.000149936 0.000147129 0.000144322 0.000142066 - 0.000140096 0.000138127 0.000136157 0.000134187 0.000132218 - 0.000130248 0.000128278 0.000126308 0.000124339 0.000122369 - 0.000120399 0.000118429 0.00011646 0.000114527 0.000112892 - 0.000111258 0.000109623 0.000107988 0.000103598 6.86052e-05 - 3.337e-05 7.00783e-05 0.000218764 0.000221318 0.000118593 - -0.000113962 5.78552e-05 9.42068e-05 0.000237037 0.000171302 - 0.0001033 6.16066e-05 5.52908e-05 6.30233e-05 7.01897e-05 - 8.48573e-05 0.000106859 8.37213e-05 -0.0391541 -0.047722 - -0.0618454 -0.0169804 0.345725 1.03426 1.74825 2.37152 2.88737 - 3.32173 3.66761 3.9707 4.17762 3.98832 3.30483 2.09737 0.710892 - 0.148159 0.0707463 0.0555808 0.045618 0.0319116 0.0199589 - 0.0133357 0.00898528 0.00586075 0.00375478 0.00245443 0.00156038 - 0.000962344 0.000590953 0.000375107 0.000250243 0.00015882 - 0.000100203 6.18122e-05 3.7372e-05 2.23009e-05 1.32569e-05 - 8.29437e-06 5.72457e-06 3.96832e-06 2.98935e-06 2.59699e-06 - 2.75024e-06 3.38689e-06 4.0453e-06 3.50095e-06 1.64988e-06 - -3.84371e-07 -2.03828e-06 -3.46401e-06 -1.24301e-06 4.63458e-06 - 1.14104e-05 1.02619e-05 2.15487e-06 -2.98487e-06 -3.67221e-06 - -2.94279e-06 -2.58649e-06 -2.23019e-06 -1.87389e-06 -1.5176e-06 - -1.1613e-06 -7.92127e-07 -4.18889e-07 -4.56502e-08 3.27588e-07 - 7.00827e-07 8.79539e-07 8.17025e-07 7.5451e-07 6.91996e-07 - 6.29481e-07 5.66966e-07 5.04452e-07 4.41937e-07 3.79422e-07 - 3.16908e-07 2.54393e-07 1.90078e-07 1.25366e-07 6.0654e-08 - -4.05776e-09 -6.87696e-08 -1.33481e-07 -1.98193e-07 -2.62905e-07 - -3.27617e-07 -3.92329e-07 -4.40392e-07 -4.18802e-07 -3.97213e-07 - -3.75624e-07 -3.54035e-07 -3.32446e-07 -3.10856e-07 -2.89267e-07 - -2.67678e-07 + 1.8179e-09 -5.28841e-06 -1.44913e-05 -3.62932e-05 -9.75719e-05 + 0.000141781 3.73396e-05 -1.65603e-05 -1.5271e-05 -6.73884e-06 + 4.40157e-06 -4.85345e-06 -1.02964e-05 2.03126e-05 -1.89457e-05 + -8.75564e-06 7.67422e-06 4.71103e-06 1.29798e-05 6.13469e-06 + -1.14363e-05 -0.0394563 -0.0477298 -0.0622012 -0.0519225 + 0.262499 0.943611 1.67052 2.31017 2.84028 3.28467 3.61582 + 3.85887 4.13011 4.36511 4.54063 4.67013 4.76408 4.83263 + 4.8825 4.91837 4.94373 4.96117 4.97318 4.98093 4.98562 4.98906 + 4.99267 4.99539 4.99666 4.99731 4.99797 4.99844 4.99887 + 4.99927 4.99933 4.99938 4.99944 4.99949 4.99955 4.9996 4.99965 + 4.9997 4.99975 4.9998 4.99985 4.99986 4.99987 4.99989 4.9999 + 4.99991 4.99992 4.99993 4.99995 4.99996 4.99997 4.99998 + 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001 + 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99997 5.00002 5.00004 5.0001 5.0001 4.99987 5.00009 + 5.00021 5.00002 5.00004 4.99988 5.00013 4.99993 5.00026 + 4.99973 5 5.00006 5.00009 5.00004 5.00004 5.04854 4.82711 + 4.04208 2.64155 0.838902 0.19014 0.0982549 0.0723197 0.0576863 + 0.0427644 0.0301979 0.020146 0.0135728 0.00980358 0.00774482 + 0.00586604 0.0036687 0.00211511 0.00121906 0.000647581 0.000828436 + 0.00190938 0.00224254 0.00199956 0.00165488 0.00135612 0.00113715 + 0.000984181 0.000877175 0.000789973 0.000741139 0.000689338 + 0.000625676 0.000586082 0.000550152 0.000529573 0.000505606 + 0.000482117 0.000460574 0.000441649 0.000424674 0.000408398 + 0.000391914 0.000376272 0.000361487 0.000348181 0.000336045 + 0.000324466 0.000313545 0.000303046 0.000293056 0.00028356 + 0.000274586 0.000266155 0.000258279 0.000250938 0.000243789 + 0.000236912 0.000230244 0.000224186 0.000219291 0.000215346 + 0.000212468 0.000207291 0.000200862 0.00019368 0.000186767 + 0.000183515 0.000180263 0.00017701 0.000173758 0.000170506 + 0.000167253 0.000164001 0.000161164 0.000158357 0.00015555 + 0.000152743 0.000149936 0.000147129 0.000144322 0.000142066 + 0.000140096 0.000138127 0.000136157 0.000134187 0.000132218 + 0.000130248 0.000128278 0.000126308 0.000124339 0.000122369 + 0.000120399 0.000118429 0.00011646 0.000114527 0.000112892 + 0.000111258 0.000109623 0.000107988 0.000103598 6.86052e-05 + 3.337e-05 7.00783e-05 0.000218764 0.000221318 0.000118593 + -0.000113962 5.78552e-05 9.42068e-05 0.000237037 0.000171302 + 0.0001033 6.16066e-05 5.52908e-05 6.30233e-05 7.01897e-05 + 8.48573e-05 0.000106859 8.37213e-05 -0.0391541 -0.047722 + -0.0618454 -0.0169804 0.345725 1.03426 1.74825 2.37152 2.88737 + 3.32173 3.66761 3.9707 4.17762 3.98832 3.30483 2.09737 0.710892 + 0.148159 0.0707463 0.0555808 0.045618 0.0319116 0.0199589 + 0.0133357 0.00898528 0.00586075 0.00375478 0.00245443 0.00156038 + 0.000962344 0.000590953 0.000375107 0.000250243 0.00015882 + 0.000100203 6.18122e-05 3.7372e-05 2.23009e-05 1.32569e-05 + 8.29437e-06 5.72457e-06 3.96832e-06 2.98935e-06 2.59699e-06 + 2.75024e-06 3.38689e-06 4.0453e-06 3.50095e-06 1.64988e-06 + -3.84371e-07 -2.03828e-06 -3.46401e-06 -1.24301e-06 4.63458e-06 + 1.14104e-05 1.02619e-05 2.15487e-06 -2.98487e-06 -3.67221e-06 + -2.94279e-06 -2.58649e-06 -2.23019e-06 -1.87389e-06 -1.5176e-06 + -1.1613e-06 -7.92127e-07 -4.18889e-07 -4.56502e-08 3.27588e-07 + 7.00827e-07 8.79539e-07 8.17025e-07 7.5451e-07 6.91996e-07 + 6.29481e-07 5.66966e-07 5.04452e-07 4.41937e-07 3.79422e-07 + 3.16908e-07 2.54393e-07 1.90078e-07 1.25366e-07 6.0654e-08 + -4.05776e-09 -6.87696e-08 -1.33481e-07 -1.98193e-07 -2.62905e-07 + -3.27617e-07 -3.92329e-07 -4.40392e-07 -4.18802e-07 -3.97213e-07 + -3.75624e-07 -3.54035e-07 -3.32446e-07 -3.10856e-07 -2.89267e-07 + -2.67678e-07 EOD @v[32].set(<<-'EOD') - 1.10294 1.10297 1.10291 1.10277 1.10259 1.10294 1.10313 - 1.10306 1.10299 1.10296 1.10295 1.10295 1.10294 1.10294 - 1.10294 1.10294 1.10294 1.10294 1.10294 1.10296 1.10296 - 1.00547 0.998599 1.5201 2.49297 3.31258 3.73162 3.84757 - 3.92505 4.02965 4.16599 4.30294 4.41541 4.52886 4.64414 - 4.73865 4.81065 4.86391 4.90315 4.93188 4.95258 4.96726 - 4.97738 4.98436 4.98888 4.99162 4.99363 4.99573 4.99731 - 4.99804 4.99843 4.99881 4.99909 4.99934 4.99957 4.9996 4.99964 - 4.99967 4.9997 4.99973 4.99977 4.9998 4.99983 4.99986 4.99988 - 4.99991 4.99992 4.99992 4.99993 4.99994 4.99994 4.99995 - 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 - 4.99999 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 5.00028 4.99988 4.99968 - 5.00019 4.99987 5.00021 4.99973 4.99977 4.99996 4.99997 - 5.0002 4.99957 5.00026 4.99947 5.00074 5.00003 4.99987 4.99979 - 5.00008 4.99997 5.08794 5.05993 4.76875 3.99197 3.10174 - 2.5197 2.21771 2.04 1.92235 1.83874 1.77592 1.72665 1.686 - 1.65276 1.6286 1.61299 1.60039 1.58934 1.57954 1.57083 1.56306 - 1.55604 1.54963 1.54375 1.53832 1.53331 1.52865 1.52432 - 1.52026 1.51645 1.51287 1.50949 1.50629 1.50327 1.50039 - 1.49766 1.49505 1.49257 1.49019 1.48792 1.48574 1.48365 - 1.48164 1.47971 1.47784 1.47604 1.47431 1.47264 1.47102 - 1.46945 1.46794 1.46647 1.46505 1.46367 1.46233 1.46103 - 1.45976 1.45853 1.45733 1.45616 1.45502 1.45392 1.45284 - 1.45179 1.45076 1.44975 1.4488 1.44795 1.44711 1.44626 1.44541 - 1.44457 1.44372 1.44287 1.44212 1.44138 1.44063 1.43989 - 1.43914 1.4384 1.43766 1.43701 1.43641 1.43581 1.43522 1.43462 - 1.43402 1.43342 1.43282 1.43223 1.43163 1.43103 1.43043 - 1.42984 1.42924 1.42865 1.42808 1.42752 1.42695 1.42639 - 1.42584 1.42529 1.42472 1.42412 1.42365 1.42326 1.42304 - 1.42162 1.42082 1.42032 1.42029 1.42026 1.41995 1.41947 - 1.41894 1.41841 1.4179 1.41742 1.41699 1.41656 1.32097 1.30963 - 1.78765 2.64656 3.35764 3.747 3.86589 3.94217 4.04185 4.18453 - 4.3561 4.53439 4.68621 4.74905 4.77848 4.84629 4.91261 4.97541 - 5.01284 5.01548 5.01248 5.00924 5.00666 5.00475 5.00334 - 5.00234 5.00164 5.00118 5.00083 5.00058 5.0004 5.00028 5.00019 - 5.00013 5.00009 5.00007 5.00004 5.00003 5.00002 5.00001 - 5.00001 5.00001 5 5 4.99999 4.99995 4.99992 4.99996 5.00006 - 5.00012 5.00009 4.99997 4.9999 4.99985 4.99986 4.99997 5.00021 - 5.00031 5.00024 5.0001 5.00007 5.00005 5.00003 5.00001 4.99998 - 4.99998 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 - 5 4.99999 4.99999 4.99999 4.99998 4.99998 4.99998 + 1.10294 1.10297 1.10291 1.10277 1.10259 1.10294 1.10313 + 1.10306 1.10299 1.10296 1.10295 1.10295 1.10294 1.10294 + 1.10294 1.10294 1.10294 1.10294 1.10294 1.10296 1.10296 + 1.00547 0.998599 1.5201 2.49297 3.31258 3.73162 3.84757 + 3.92505 4.02965 4.16599 4.30294 4.41541 4.52886 4.64414 + 4.73865 4.81065 4.86391 4.90315 4.93188 4.95258 4.96726 + 4.97738 4.98436 4.98888 4.99162 4.99363 4.99573 4.99731 + 4.99804 4.99843 4.99881 4.99909 4.99934 4.99957 4.9996 4.99964 + 4.99967 4.9997 4.99973 4.99977 4.9998 4.99983 4.99986 4.99988 + 4.99991 4.99992 4.99992 4.99993 4.99994 4.99994 4.99995 + 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 + 4.99999 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 5.00028 4.99988 4.99968 + 5.00019 4.99987 5.00021 4.99973 4.99977 4.99996 4.99997 + 5.0002 4.99957 5.00026 4.99947 5.00074 5.00003 4.99987 4.99979 + 5.00008 4.99997 5.08794 5.05993 4.76875 3.99197 3.10174 + 2.5197 2.21771 2.04 1.92235 1.83874 1.77592 1.72665 1.686 + 1.65276 1.6286 1.61299 1.60039 1.58934 1.57954 1.57083 1.56306 + 1.55604 1.54963 1.54375 1.53832 1.53331 1.52865 1.52432 + 1.52026 1.51645 1.51287 1.50949 1.50629 1.50327 1.50039 + 1.49766 1.49505 1.49257 1.49019 1.48792 1.48574 1.48365 + 1.48164 1.47971 1.47784 1.47604 1.47431 1.47264 1.47102 + 1.46945 1.46794 1.46647 1.46505 1.46367 1.46233 1.46103 + 1.45976 1.45853 1.45733 1.45616 1.45502 1.45392 1.45284 + 1.45179 1.45076 1.44975 1.4488 1.44795 1.44711 1.44626 1.44541 + 1.44457 1.44372 1.44287 1.44212 1.44138 1.44063 1.43989 + 1.43914 1.4384 1.43766 1.43701 1.43641 1.43581 1.43522 1.43462 + 1.43402 1.43342 1.43282 1.43223 1.43163 1.43103 1.43043 + 1.42984 1.42924 1.42865 1.42808 1.42752 1.42695 1.42639 + 1.42584 1.42529 1.42472 1.42412 1.42365 1.42326 1.42304 + 1.42162 1.42082 1.42032 1.42029 1.42026 1.41995 1.41947 + 1.41894 1.41841 1.4179 1.41742 1.41699 1.41656 1.32097 1.30963 + 1.78765 2.64656 3.35764 3.747 3.86589 3.94217 4.04185 4.18453 + 4.3561 4.53439 4.68621 4.74905 4.77848 4.84629 4.91261 4.97541 + 5.01284 5.01548 5.01248 5.00924 5.00666 5.00475 5.00334 + 5.00234 5.00164 5.00118 5.00083 5.00058 5.0004 5.00028 5.00019 + 5.00013 5.00009 5.00007 5.00004 5.00003 5.00002 5.00001 + 5.00001 5.00001 5 5 4.99999 4.99995 4.99992 4.99996 5.00006 + 5.00012 5.00009 4.99997 4.9999 4.99985 4.99986 4.99997 5.00021 + 5.00031 5.00024 5.0001 5.00007 5.00005 5.00003 5.00001 4.99998 + 4.99998 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 + 5 4.99999 4.99999 4.99999 4.99998 4.99998 4.99998 EOD @v[33].set(<<-'EOD') - 5 5.00012 5.00023 5.0003 4.99972 4.99988 4.99984 4.99991 - 4.99996 4.99999 5.00008 5.00009 4.99986 5.00003 5.00007 - 4.99995 4.9999 4.99997 5.00013 5.00014 5.00013 4.99701 4.99763 - 4.99742 4.99998 5.02836 5.07262 4.96856 4.57267 3.85637 - 2.79544 1.45942 0.408016 0.084885 0.0271375 0.0119294 0.00707546 - 0.0051087 0.00373035 0.00264737 0.00186477 0.00130379 0.000915857 - 0.000653121 0.000483893 0.000380852 0.000302362 0.000219498 - 0.000154435 0.000121928 0.000104026 8.61242e-05 7.48526e-05 - 6.49216e-05 5.56238e-05 5.29689e-05 5.03139e-05 4.7659e-05 - 4.5004e-05 4.23491e-05 4.00356e-05 3.79522e-05 3.58687e-05 - 3.37852e-05 3.17018e-05 2.97592e-05 2.89804e-05 2.82016e-05 - 2.74228e-05 2.66441e-05 2.58653e-05 2.50865e-05 2.43077e-05 - 2.35289e-05 2.27501e-05 2.19714e-05 2.12346e-05 2.07821e-05 - 2.03295e-05 1.98769e-05 1.94244e-05 1.89718e-05 1.85192e-05 - 1.80667e-05 1.76141e-05 1.71615e-05 1.6709e-05 1.62828e-05 - 1.60061e-05 1.57294e-05 1.54527e-05 1.5176e-05 1.48993e-05 - 1.46226e-05 1.43459e-05 1.40692e-05 1.37925e-05 1.35158e-05 - 1.3262e-05 1.31191e-05 1.29761e-05 1.28332e-05 1.26903e-05 - 1.25474e-05 1.24045e-05 1.22615e-05 1.21186e-05 1.19757e-05 - 1.18328e-05 1.16898e-05 1.15469e-05 1.1404e-05 1.12611e-05 - 1.11182e-05 1.09752e-05 1.08323e-05 1.06894e-05 1.05465e-05 - 1.04036e-05 1.02606e-05 1.00185e-05 3.8343e-05 -3.06781e-05 - -0.000111758 0.000111673 0.000130815 -0.000210491 -0.000231304 - 0.000310226 0.000265303 3.0878e-05 -4.48405e-05 -1.2852e-05 - -7.84469e-06 3.29986e-05 -1.23286e-05 -6.07871e-05 5.35082e-05 - 7.69194e-05 0.000126221 6.57178e-05 0.00223349 -0.0148854 - -0.0476636 -0.0491447 0.220125 1.11174 2.03988 2.90209 3.61069 - 4.13554 4.50679 4.71501 4.83916 4.91027 4.95284 4.98086 - 4.99151 4.98651 4.97113 4.95075 4.93102 4.93683 4.95457 - 4.97071 4.98212 4.98948 4.99386 4.99636 4.99785 4.9987 4.99927 - 4.99989 5.00014 5.00007 4.99988 4.99982 4.99976 4.99973 - 4.99972 4.99972 4.99973 4.99974 4.99975 4.99977 4.99979 - 4.99981 4.99984 4.99986 4.99988 4.99989 4.99991 4.99992 - 4.99993 4.99994 4.99995 4.99996 4.99996 4.99997 4.99997 - 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999 - 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00001 5.00001 - 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 - 4.99999 4.99999 4.99999 5 5.00012 4.99946 4.99839 4.99733 - 4.99948 5.00114 5.00158 5.00147 5.00113 5.00073 5.00043 - 5.0002 5.00006 4.99995 4.99986 4.99973 4.99976 4.9999 5.00029 - 5.00055 4.99704 4.99734 4.9972 5.00278 5.03354 5.07184 4.94057 - 4.51936 3.75638 2.60982 1.23803 0.315016 0.0796102 0.0252894 - 0.0165723 0.0827785 0.491298 1.40686 2.33436 3.1251 3.7691 - 4.22201 4.49976 4.68115 4.80513 4.88509 4.93208 4.95861 - 4.97579 4.98655 4.99268 4.99571 4.99771 4.99881 4.99929 - 4.99954 4.99965 4.9997 4.99971 4.99971 4.99971 4.99971 4.99972 - 4.99974 4.99976 4.99978 4.99981 4.99984 4.99987 4.99989 - 4.99991 4.99991 4.99992 4.99992 4.99993 4.99997 5.00003 - 5.00006 5.00004 5.00001 5 4.99999 4.99998 4.99998 4.99997 - 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999 - 4.99999 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 4.99999 - 4.99999 4.99999 4.99999 4.99998 4.99998 + 5 5.00012 5.00023 5.0003 4.99972 4.99988 4.99984 4.99991 + 4.99996 4.99999 5.00008 5.00009 4.99986 5.00003 5.00007 + 4.99995 4.9999 4.99997 5.00013 5.00014 5.00013 4.99701 4.99763 + 4.99742 4.99998 5.02836 5.07262 4.96856 4.57267 3.85637 + 2.79544 1.45942 0.408016 0.084885 0.0271375 0.0119294 0.00707546 + 0.0051087 0.00373035 0.00264737 0.00186477 0.00130379 0.000915857 + 0.000653121 0.000483893 0.000380852 0.000302362 0.000219498 + 0.000154435 0.000121928 0.000104026 8.61242e-05 7.48526e-05 + 6.49216e-05 5.56238e-05 5.29689e-05 5.03139e-05 4.7659e-05 + 4.5004e-05 4.23491e-05 4.00356e-05 3.79522e-05 3.58687e-05 + 3.37852e-05 3.17018e-05 2.97592e-05 2.89804e-05 2.82016e-05 + 2.74228e-05 2.66441e-05 2.58653e-05 2.50865e-05 2.43077e-05 + 2.35289e-05 2.27501e-05 2.19714e-05 2.12346e-05 2.07821e-05 + 2.03295e-05 1.98769e-05 1.94244e-05 1.89718e-05 1.85192e-05 + 1.80667e-05 1.76141e-05 1.71615e-05 1.6709e-05 1.62828e-05 + 1.60061e-05 1.57294e-05 1.54527e-05 1.5176e-05 1.48993e-05 + 1.46226e-05 1.43459e-05 1.40692e-05 1.37925e-05 1.35158e-05 + 1.3262e-05 1.31191e-05 1.29761e-05 1.28332e-05 1.26903e-05 + 1.25474e-05 1.24045e-05 1.22615e-05 1.21186e-05 1.19757e-05 + 1.18328e-05 1.16898e-05 1.15469e-05 1.1404e-05 1.12611e-05 + 1.11182e-05 1.09752e-05 1.08323e-05 1.06894e-05 1.05465e-05 + 1.04036e-05 1.02606e-05 1.00185e-05 3.8343e-05 -3.06781e-05 + -0.000111758 0.000111673 0.000130815 -0.000210491 -0.000231304 + 0.000310226 0.000265303 3.0878e-05 -4.48405e-05 -1.2852e-05 + -7.84469e-06 3.29986e-05 -1.23286e-05 -6.07871e-05 5.35082e-05 + 7.69194e-05 0.000126221 6.57178e-05 0.00223349 -0.0148854 + -0.0476636 -0.0491447 0.220125 1.11174 2.03988 2.90209 3.61069 + 4.13554 4.50679 4.71501 4.83916 4.91027 4.95284 4.98086 + 4.99151 4.98651 4.97113 4.95075 4.93102 4.93683 4.95457 + 4.97071 4.98212 4.98948 4.99386 4.99636 4.99785 4.9987 4.99927 + 4.99989 5.00014 5.00007 4.99988 4.99982 4.99976 4.99973 + 4.99972 4.99972 4.99973 4.99974 4.99975 4.99977 4.99979 + 4.99981 4.99984 4.99986 4.99988 4.99989 4.99991 4.99992 + 4.99993 4.99994 4.99995 4.99996 4.99996 4.99997 4.99997 + 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999 + 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00001 5.00001 + 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 + 4.99999 4.99999 4.99999 5 5.00012 4.99946 4.99839 4.99733 + 4.99948 5.00114 5.00158 5.00147 5.00113 5.00073 5.00043 + 5.0002 5.00006 4.99995 4.99986 4.99973 4.99976 4.9999 5.00029 + 5.00055 4.99704 4.99734 4.9972 5.00278 5.03354 5.07184 4.94057 + 4.51936 3.75638 2.60982 1.23803 0.315016 0.0796102 0.0252894 + 0.0165723 0.0827785 0.491298 1.40686 2.33436 3.1251 3.7691 + 4.22201 4.49976 4.68115 4.80513 4.88509 4.93208 4.95861 + 4.97579 4.98655 4.99268 4.99571 4.99771 4.99881 4.99929 + 4.99954 4.99965 4.9997 4.99971 4.99971 4.99971 4.99971 4.99972 + 4.99974 4.99976 4.99978 4.99981 4.99984 4.99987 4.99989 + 4.99991 4.99991 4.99992 4.99992 4.99993 4.99997 5.00003 + 5.00006 5.00004 5.00001 5 4.99999 4.99998 4.99998 4.99997 + 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999 + 4.99999 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 4.99999 + 4.99999 4.99999 4.99999 4.99998 4.99998 EOD @v[34].set(<<-'EOD') - 5 5.00207 5.00813 5.01486 5.00156 5.0018 4.99861 4.99844 - 4.99888 4.9993 4.99956 4.99971 4.99979 4.99983 4.99987 4.99989 - 4.99671 4.9974 4.99864 5.00131 5.00377 5.0021 5.00039 4.99993 - 5.00004 5.0009 5.00109 4.99636 4.98617 4.96778 4.92047 4.89528 - 4.91112 4.9559 4.98286 4.99369 4.99812 4.99951 4.99994 5.00014 - 5.00008 4.99994 4.99984 4.99989 4.99998 5.00004 5.00004 - 5.00006 5.00005 5.00001 4.99997 4.99992 4.99993 4.99994 - 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 - 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 - 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 - 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 - 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 - 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 - 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 - 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 - 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 - 4.99998 4.99998 4.99998 4.99998 5.00131 5.00072 4.9977 4.99811 - 5.00325 4.99647 4.98948 4.99459 5.00262 5.00276 5.00156 - 5.00072 5.0003 5.00013 4.99995 4.99668 4.99775 4.99917 5.00173 - 5.00386 5.00188 4.99888 4.99757 4.99951 5.01712 5.0557 5.07088 - 5.07704 5.07758 5.06958 5.04223 5.03331 5.0279 5.03408 5.07611 - 5.01911 4.68594 3.99152 2.92195 1.69878 0.809 0.344091 0.154663 - 0.0788717 0.0467212 0.0336168 0.0280514 0.0254947 0.024173 - 0.0223567 0.0220555 0.0271514 0.0295872 0.0296052 0.0283971 - 0.0264726 0.0241813 0.0218244 0.0195349 0.017368 0.0152495 - 0.013295 0.0115444 0.00996982 0.00857091 0.00733891 0.00627261 - 0.0053494 0.00456316 0.00388373 0.00331073 0.00282181 0.00240991 - 0.00206389 0.00177187 0.00152283 0.00131167 0.00112558 0.000954373 - 0.000805726 0.00069326 0.000600991 0.000525743 0.00047355 - 0.00044359 0.000434815 0.000436053 0.000402511 0.000368969 - 0.000335427 0.000301886 0.000268344 0.000234802 0.00020126 - 0.000184967 0.000169932 0.000154896 0.000139861 0.000124825 - 0.00010979 9.47546e-05 8.67896e-05 8.24901e-05 7.81906e-05 - 7.38911e-05 6.95915e-05 6.5292e-05 6.09925e-05 5.66929e-05 - 5.23934e-05 4.80939e-05 4.37943e-05 3.94948e-05 3.51953e-05 - 3.08957e-05 2.67968e-05 2.42936e-05 2.17904e-05 1.92872e-05 - 1.6784e-05 0.00125927 -0.00794344 -0.0305499 -0.0621697 - -0.0463796 -0.0224608 -0.00538381 0.00546086 0.0108675 0.012883 - 0.0131787 0.0127271 0.0119702 0.0110398 0.0100635 0.00649617 - 0.00489388 0.00545863 0.0098351 0.0167428 0.0126563 0.00697542 - 0.00427027 0.00330002 0.00390774 0.00408999 -0.00259143 - -0.0160578 -0.0451849 -0.0409651 0.1301 0.597429 1.3848 - 2.63426 3.81272 4.51373 4.8412 4.98731 4.88165 4.37165 3.40034 - 2.17681 1.12217 0.505129 0.219703 0.104992 0.0622333 0.0448317 - 0.0355782 0.0311867 0.0293529 0.0274615 0.0288739 0.0307845 - 0.0304909 0.029245 0.0273602 0.0251006 0.022697 0.0202765 - 0.0179357 0.0157106 0.0136562 0.0117951 0.0101273 0.00865784 - 0.00739394 0.00634364 0.00551356 0.00480538 0.00415747 0.00356084 - 0.00297585 0.00236711 0.00181853 0.00160713 0.00169822 0.00166542 - 0.00145504 0.00120252 0.00109259 0.000982658 0.00087273 - 0.000762802 0.000652874 0.000584068 0.000528263 0.000472458 - 0.000416653 0.000360848 0.000321155 0.000301442 0.000281729 - 0.000262016 0.000242303 0.00022259 0.000202877 0.000183164 - 0.000163451 0.000143738 0.000124025 0.000114582 0.000107399 - 0.000100216 9.30332e-05 8.58502e-05 7.86672e-05 7.14841e-05 - 6.43011e-05 5.7118e-05 4.9935e-05 4.35378e-05 4.04281e-05 - 3.73184e-05 3.42088e-05 3.10991e-05 2.79894e-05 2.48798e-05 - 2.17701e-05 1.86604e-05 + 5 5.00207 5.00813 5.01486 5.00156 5.0018 4.99861 4.99844 + 4.99888 4.9993 4.99956 4.99971 4.99979 4.99983 4.99987 4.99989 + 4.99671 4.9974 4.99864 5.00131 5.00377 5.0021 5.00039 4.99993 + 5.00004 5.0009 5.00109 4.99636 4.98617 4.96778 4.92047 4.89528 + 4.91112 4.9559 4.98286 4.99369 4.99812 4.99951 4.99994 5.00014 + 5.00008 4.99994 4.99984 4.99989 4.99998 5.00004 5.00004 + 5.00006 5.00005 5.00001 4.99997 4.99992 4.99993 4.99994 + 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 + 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 + 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 + 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 + 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 + 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 + 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 + 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 + 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 + 4.99998 4.99998 4.99998 4.99998 5.00131 5.00072 4.9977 4.99811 + 5.00325 4.99647 4.98948 4.99459 5.00262 5.00276 5.00156 + 5.00072 5.0003 5.00013 4.99995 4.99668 4.99775 4.99917 5.00173 + 5.00386 5.00188 4.99888 4.99757 4.99951 5.01712 5.0557 5.07088 + 5.07704 5.07758 5.06958 5.04223 5.03331 5.0279 5.03408 5.07611 + 5.01911 4.68594 3.99152 2.92195 1.69878 0.809 0.344091 0.154663 + 0.0788717 0.0467212 0.0336168 0.0280514 0.0254947 0.024173 + 0.0223567 0.0220555 0.0271514 0.0295872 0.0296052 0.0283971 + 0.0264726 0.0241813 0.0218244 0.0195349 0.017368 0.0152495 + 0.013295 0.0115444 0.00996982 0.00857091 0.00733891 0.00627261 + 0.0053494 0.00456316 0.00388373 0.00331073 0.00282181 0.00240991 + 0.00206389 0.00177187 0.00152283 0.00131167 0.00112558 0.000954373 + 0.000805726 0.00069326 0.000600991 0.000525743 0.00047355 + 0.00044359 0.000434815 0.000436053 0.000402511 0.000368969 + 0.000335427 0.000301886 0.000268344 0.000234802 0.00020126 + 0.000184967 0.000169932 0.000154896 0.000139861 0.000124825 + 0.00010979 9.47546e-05 8.67896e-05 8.24901e-05 7.81906e-05 + 7.38911e-05 6.95915e-05 6.5292e-05 6.09925e-05 5.66929e-05 + 5.23934e-05 4.80939e-05 4.37943e-05 3.94948e-05 3.51953e-05 + 3.08957e-05 2.67968e-05 2.42936e-05 2.17904e-05 1.92872e-05 + 1.6784e-05 0.00125927 -0.00794344 -0.0305499 -0.0621697 + -0.0463796 -0.0224608 -0.00538381 0.00546086 0.0108675 0.012883 + 0.0131787 0.0127271 0.0119702 0.0110398 0.0100635 0.00649617 + 0.00489388 0.00545863 0.0098351 0.0167428 0.0126563 0.00697542 + 0.00427027 0.00330002 0.00390774 0.00408999 -0.00259143 + -0.0160578 -0.0451849 -0.0409651 0.1301 0.597429 1.3848 + 2.63426 3.81272 4.51373 4.8412 4.98731 4.88165 4.37165 3.40034 + 2.17681 1.12217 0.505129 0.219703 0.104992 0.0622333 0.0448317 + 0.0355782 0.0311867 0.0293529 0.0274615 0.0288739 0.0307845 + 0.0304909 0.029245 0.0273602 0.0251006 0.022697 0.0202765 + 0.0179357 0.0157106 0.0136562 0.0117951 0.0101273 0.00865784 + 0.00739394 0.00634364 0.00551356 0.00480538 0.00415747 0.00356084 + 0.00297585 0.00236711 0.00181853 0.00160713 0.00169822 0.00166542 + 0.00145504 0.00120252 0.00109259 0.000982658 0.00087273 + 0.000762802 0.000652874 0.000584068 0.000528263 0.000472458 + 0.000416653 0.000360848 0.000321155 0.000301442 0.000281729 + 0.000262016 0.000242303 0.00022259 0.000202877 0.000183164 + 0.000163451 0.000143738 0.000124025 0.000114582 0.000107399 + 0.000100216 9.30332e-05 8.58502e-05 7.86672e-05 7.14841e-05 + 6.43011e-05 5.7118e-05 4.9935e-05 4.35378e-05 4.04281e-05 + 3.73184e-05 3.42088e-05 3.10991e-05 2.79894e-05 2.48798e-05 + 2.17701e-05 1.86604e-05 EOD @v[35].set(<<-'EOD') - 7.24585e-12 2.21843e-05 3.20014e-05 1.25076e-05 -2.44947e-05 - 1.8425e-05 5.50546e-06 3.53025e-05 -1.07551e-05 -3.94383e-06 - -2.27848e-06 -9.04789e-05 7.44215e-05 -2.7662e-05 0.000200038 - -2.11998e-05 -2.09011e-05 2.37098e-05 2.18751e-05 -2.28422e-05 - -6.23659e-05 3.58241e-05 1.76386e-05 -4.28311e-05 0.000355626 - 0.00156903 0.00100999 -0.0085304 -0.02067 -0.0389485 -0.0651568 - -0.128475 -0.314362 -0.406837 -0.421558 -0.421277 -0.418176 - -0.414481 -0.410845 -0.407348 -0.403971 -0.400716 -0.397582 - -0.394563 -0.391658 -0.388866 -0.386178 -0.383585 -0.381094 - -0.378789 -0.376569 -0.37435 -0.372256 -0.370188 -0.36815 - -0.366422 -0.364694 -0.362967 -0.361239 -0.359511 -0.357888 - -0.356334 -0.354781 -0.353227 -0.351674 -0.350152 -0.348888 - -0.347625 -0.346361 -0.345098 -0.343834 -0.342571 -0.341307 - -0.340044 -0.33878 -0.337517 -0.336279 -0.335215 -0.334152 - -0.333088 -0.332024 -0.330961 -0.329897 -0.328833 -0.32777 - -0.326706 -0.325642 -0.324601 -0.323683 -0.322766 -0.321849 - -0.320932 -0.320014 -0.319097 -0.31818 -0.317263 -0.316345 - -0.315428 -0.314545 -0.313825 -0.313106 -0.312387 -0.311667 - -0.310948 -0.310228 -0.309509 -0.308789 -0.30807 -0.307351 - -0.306631 -0.305912 -0.305192 -0.304473 -0.303754 -0.303034 - -0.302315 -0.301595 -0.300876 -0.300157 -0.299437 -0.298716 - -0.29798 -0.297329 -0.296691 -0.295837 -0.29516 -0.294725 - -0.294044 -0.292917 -0.292351 -0.291965 -0.291365 -0.290687 - -0.290027 -0.289376 -0.288772 -0.288193 -0.287505 -0.286892 - -0.28626 -0.285714 -0.284545 -0.289246 -0.298717 -0.298492 - -0.214163 0.181451 0.0749974 0.0454707 0.0292987 0.0196837 - 0.0124119 0.00884715 0.00527181 0.00585821 0.0296361 0.169856 - 0.361207 0.538856 0.67469 0.685933 0.392802 0.17772 0.0813085 - 0.0424601 0.0246654 0.0175258 0.0144256 0.0129859 0.012205 - 0.0112846 0.010933 0.0134813 0.0147254 0.0147981 0.0142156 - 0.0132732 0.0121355 0.0109587 0.00981238 0.00872731 0.00767007 - 0.00669346 0.00581341 0.00502167 0.00431819 0.00369842 0.00316168 - 0.00269663 0.00230035 0.00195801 0.00166928 0.00142286 0.00121522 - 0.00104072 0.000893384 0.000767675 0.000661268 0.000567659 - 0.000481766 0.000407101 0.000350044 0.000302721 0.000263424 - 0.000236813 0.00022199 0.000218182 0.000219548 0.0002027 - 0.000185853 0.000169006 0.000152158 0.000135311 0.000118463 - 0.000101616 9.33782e-05 8.57685e-05 7.81588e-05 7.0549e-05 - 6.29393e-05 5.53296e-05 4.77199e-05 4.36954e-05 4.15296e-05 - 3.93637e-05 3.71978e-05 3.50319e-05 3.28661e-05 3.07002e-05 - 2.85343e-05 2.63685e-05 2.42026e-05 2.20367e-05 1.98709e-05 - 1.7705e-05 1.55391e-05 1.34772e-05 1.22416e-05 1.10061e-05 - 9.77055e-06 8.535e-06 0.000631271 -0.00362586 -0.0146235 - -0.0308486 -0.0237466 -0.0117522 -0.00304171 0.00251033 - 0.00531986 0.0063897 0.00657351 0.00636494 0.00599705 0.00553442 - 0.00505994 0.00330925 0.00246671 0.0027006 0.00473161 0.00830333 - 0.00649147 0.00356815 0.00217448 0.00187579 0.00270447 0.00219543 - -0.00546118 -0.0179576 -0.0445306 -0.0649309 0.0197935 0.473629 - 0.87268 0.269542 0.0086094 0.0844602 0.606456 1.04929 0.906014 - 0.916205 0.919425 0.872867 0.556244 0.262457 0.11838 0.0571226 - 0.0333451 0.0237133 0.0185096 0.0159617 0.0148663 0.0138683 - 0.0144081 0.0153797 0.0152551 0.0146487 0.0137192 0.0125973 - 0.0113996 0.0101903 0.00901851 0.00790495 0.00687502 0.00593994 - 0.00510092 0.00436111 0.00372439 0.0031945 0.00277537 0.00241888 - 0.002095 0.00179943 0.00150419 0.00119264 0.00090934 0.000802394 - 0.000852816 0.000838368 0.000730842 0.000601028 0.000546616 - 0.000492205 0.000437793 0.000383381 0.000328969 0.00029454 - 0.000266428 0.000238317 0.000210205 0.000182093 0.000162091 - 0.000152145 0.000142198 0.000132252 0.000122306 0.000112359 - 0.000102413 9.24665e-05 8.25201e-05 7.25738e-05 6.26274e-05 - 5.78553e-05 5.42216e-05 5.05878e-05 4.69541e-05 4.33204e-05 - 3.96867e-05 3.60529e-05 3.24192e-05 2.87855e-05 2.51518e-05 - 2.19153e-05 2.03406e-05 1.8766e-05 1.71913e-05 1.56167e-05 - 1.4042e-05 1.24674e-05 1.08927e-05 9.31806e-06 + 7.24585e-12 2.21843e-05 3.20014e-05 1.25076e-05 -2.44947e-05 + 1.8425e-05 5.50546e-06 3.53025e-05 -1.07551e-05 -3.94383e-06 + -2.27848e-06 -9.04789e-05 7.44215e-05 -2.7662e-05 0.000200038 + -2.11998e-05 -2.09011e-05 2.37098e-05 2.18751e-05 -2.28422e-05 + -6.23659e-05 3.58241e-05 1.76386e-05 -4.28311e-05 0.000355626 + 0.00156903 0.00100999 -0.0085304 -0.02067 -0.0389485 -0.0651568 + -0.128475 -0.314362 -0.406837 -0.421558 -0.421277 -0.418176 + -0.414481 -0.410845 -0.407348 -0.403971 -0.400716 -0.397582 + -0.394563 -0.391658 -0.388866 -0.386178 -0.383585 -0.381094 + -0.378789 -0.376569 -0.37435 -0.372256 -0.370188 -0.36815 + -0.366422 -0.364694 -0.362967 -0.361239 -0.359511 -0.357888 + -0.356334 -0.354781 -0.353227 -0.351674 -0.350152 -0.348888 + -0.347625 -0.346361 -0.345098 -0.343834 -0.342571 -0.341307 + -0.340044 -0.33878 -0.337517 -0.336279 -0.335215 -0.334152 + -0.333088 -0.332024 -0.330961 -0.329897 -0.328833 -0.32777 + -0.326706 -0.325642 -0.324601 -0.323683 -0.322766 -0.321849 + -0.320932 -0.320014 -0.319097 -0.31818 -0.317263 -0.316345 + -0.315428 -0.314545 -0.313825 -0.313106 -0.312387 -0.311667 + -0.310948 -0.310228 -0.309509 -0.308789 -0.30807 -0.307351 + -0.306631 -0.305912 -0.305192 -0.304473 -0.303754 -0.303034 + -0.302315 -0.301595 -0.300876 -0.300157 -0.299437 -0.298716 + -0.29798 -0.297329 -0.296691 -0.295837 -0.29516 -0.294725 + -0.294044 -0.292917 -0.292351 -0.291965 -0.291365 -0.290687 + -0.290027 -0.289376 -0.288772 -0.288193 -0.287505 -0.286892 + -0.28626 -0.285714 -0.284545 -0.289246 -0.298717 -0.298492 + -0.214163 0.181451 0.0749974 0.0454707 0.0292987 0.0196837 + 0.0124119 0.00884715 0.00527181 0.00585821 0.0296361 0.169856 + 0.361207 0.538856 0.67469 0.685933 0.392802 0.17772 0.0813085 + 0.0424601 0.0246654 0.0175258 0.0144256 0.0129859 0.012205 + 0.0112846 0.010933 0.0134813 0.0147254 0.0147981 0.0142156 + 0.0132732 0.0121355 0.0109587 0.00981238 0.00872731 0.00767007 + 0.00669346 0.00581341 0.00502167 0.00431819 0.00369842 0.00316168 + 0.00269663 0.00230035 0.00195801 0.00166928 0.00142286 0.00121522 + 0.00104072 0.000893384 0.000767675 0.000661268 0.000567659 + 0.000481766 0.000407101 0.000350044 0.000302721 0.000263424 + 0.000236813 0.00022199 0.000218182 0.000219548 0.0002027 + 0.000185853 0.000169006 0.000152158 0.000135311 0.000118463 + 0.000101616 9.33782e-05 8.57685e-05 7.81588e-05 7.0549e-05 + 6.29393e-05 5.53296e-05 4.77199e-05 4.36954e-05 4.15296e-05 + 3.93637e-05 3.71978e-05 3.50319e-05 3.28661e-05 3.07002e-05 + 2.85343e-05 2.63685e-05 2.42026e-05 2.20367e-05 1.98709e-05 + 1.7705e-05 1.55391e-05 1.34772e-05 1.22416e-05 1.10061e-05 + 9.77055e-06 8.535e-06 0.000631271 -0.00362586 -0.0146235 + -0.0308486 -0.0237466 -0.0117522 -0.00304171 0.00251033 + 0.00531986 0.0063897 0.00657351 0.00636494 0.00599705 0.00553442 + 0.00505994 0.00330925 0.00246671 0.0027006 0.00473161 0.00830333 + 0.00649147 0.00356815 0.00217448 0.00187579 0.00270447 0.00219543 + -0.00546118 -0.0179576 -0.0445306 -0.0649309 0.0197935 0.473629 + 0.87268 0.269542 0.0086094 0.0844602 0.606456 1.04929 0.906014 + 0.916205 0.919425 0.872867 0.556244 0.262457 0.11838 0.0571226 + 0.0333451 0.0237133 0.0185096 0.0159617 0.0148663 0.0138683 + 0.0144081 0.0153797 0.0152551 0.0146487 0.0137192 0.0125973 + 0.0113996 0.0101903 0.00901851 0.00790495 0.00687502 0.00593994 + 0.00510092 0.00436111 0.00372439 0.0031945 0.00277537 0.00241888 + 0.002095 0.00179943 0.00150419 0.00119264 0.00090934 0.000802394 + 0.000852816 0.000838368 0.000730842 0.000601028 0.000546616 + 0.000492205 0.000437793 0.000383381 0.000328969 0.00029454 + 0.000266428 0.000238317 0.000210205 0.000182093 0.000162091 + 0.000152145 0.000142198 0.000132252 0.000122306 0.000112359 + 0.000102413 9.24665e-05 8.25201e-05 7.25738e-05 6.26274e-05 + 5.78553e-05 5.42216e-05 5.05878e-05 4.69541e-05 4.33204e-05 + 3.96867e-05 3.60529e-05 3.24192e-05 2.87855e-05 2.51518e-05 + 2.19153e-05 2.03406e-05 1.8766e-05 1.71913e-05 1.56167e-05 + 1.4042e-05 1.24674e-05 1.08927e-05 9.31806e-06 EOD @v[36].set(<<-'EOD') - 5 5.01426 5.02852 5.01923 4.77685 4.56471 4.52338 4.56813 - 4.63122 4.693 4.74776 4.79385 4.83258 4.86358 4.88918 4.91021 - 4.90553 4.89733 4.89554 4.91953 5.00757 5.07101 5.06318 - 5.05241 5.05535 5.08042 5.07251 4.90973 4.56136 3.98637 - 3.237 2.67216 2.33678 2.13529 2.00544 1.91429 1.84638 1.79461 - 1.75338 1.71958 1.69175 1.6686 1.64918 1.63258 1.61836 1.60607 - 1.59506 1.58483 1.57575 1.56847 1.56193 1.55538 1.54968 - 1.54416 1.5388 1.53523 1.53165 1.52807 1.52449 1.52091 1.51771 - 1.51477 1.51182 1.50888 1.50593 1.50309 1.50113 1.49917 - 1.4972 1.49524 1.49328 1.49132 1.48935 1.48739 1.48543 1.48346 - 1.48157 1.48012 1.47868 1.47724 1.47579 1.47435 1.47291 - 1.47146 1.47002 1.46857 1.46713 1.46574 1.46462 1.4635 1.46238 - 1.46126 1.46014 1.45902 1.4579 1.45678 1.45567 1.45455 1.45349 - 1.45275 1.45201 1.45127 1.45053 1.44979 1.44905 1.44831 - 1.44757 1.44683 1.44609 1.44535 1.44461 1.44387 1.44313 - 1.44239 1.44165 1.44091 1.44017 1.43943 1.43869 1.43795 - 1.43721 1.43874 1.43976 1.43619 1.43182 1.43726 1.43084 - 1.42587 1.42383 1.42642 1.42728 1.42736 1.4271 1.42669 1.42621 - 1.42569 1.41703 1.41244 1.41019 1.41199 1.41833 1.42502 - 1.41504 1.37535 1.28381 1.44779 2.33713 3.25835 3.67554 - 3.84975 4.01125 4.2253 4.45433 4.62215 4.74478 4.82998 4.8868 - 4.92396 4.94768 4.96498 4.98537 5.0128 5.04467 5.06722 5.06535 - 5.01475 4.91956 4.80647 4.7242 4.7059 4.73552 4.76379 4.81684 - 4.87376 4.92276 4.96112 4.9884 5.0045 5.00999 5.00933 5.00619 - 5.00384 5.00342 5.00373 5.00362 5.00309 5.00272 5.00239 - 5.00204 5.00172 5.00146 5.00124 5.00105 5.00089 5.00076 - 5.00065 5.00057 5.00048 5.00041 5.00034 5.00028 5.00023 - 5.00019 5.00015 5.00015 5.00016 5.0002 5.00023 5.00021 5.00019 - 5.00017 5.00015 5.00012 5.0001 5.00008 5.00007 5.00006 5.00005 - 5.00004 5.00003 5.00002 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002 - 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001 - 5.00001 5.00001 5.00062 4.99506 4.9835 4.96726 4.9728 4.97877 - 4.98675 4.9966 5.00406 5.00679 5.00629 5.00561 5.00487 5.00429 - 5.00384 5.002 5.00164 5.00229 5.00484 5.00769 5.00019 5.00242 - 5.01319 5.0335 5.07265 5.10129 5.11485 5.12551 5.13953 5.16048 - 5.18862 5.22811 5.25656 5.25627 5.19975 4.9139 4.24745 3.43732 - 2.8202 2.43224 2.17409 2.01333 1.93951 1.94622 1.98861 2.02217 - 2.05383 2.08376 2.11184 2.13793 2.16191 2.18267 2.20502 - 2.22837 2.24958 2.26901 2.28648 2.302 2.31582 2.32802 2.33869 - 2.34795 2.35596 2.36282 2.3687 2.37371 2.37797 2.38161 2.38476 - 2.38743 2.3897 2.39168 2.39329 2.39463 2.39575 2.39671 2.39756 - 2.39835 2.39907 2.39968 2.39999 2.4003 2.40061 2.40091 2.40122 - 2.40142 2.40159 2.40176 2.40193 2.4021 2.40222 2.40228 2.40234 - 2.4024 2.40247 2.40253 2.40259 2.40265 2.40271 2.40277 2.40284 - 2.40287 2.40289 2.40291 2.40294 2.40296 2.40298 2.40301 - 2.40303 2.40305 2.40308 2.4031 2.40311 2.40312 2.40313 2.40314 - 2.40315 2.40316 2.40317 2.40318 + 5 5.01426 5.02852 5.01923 4.77685 4.56471 4.52338 4.56813 + 4.63122 4.693 4.74776 4.79385 4.83258 4.86358 4.88918 4.91021 + 4.90553 4.89733 4.89554 4.91953 5.00757 5.07101 5.06318 + 5.05241 5.05535 5.08042 5.07251 4.90973 4.56136 3.98637 + 3.237 2.67216 2.33678 2.13529 2.00544 1.91429 1.84638 1.79461 + 1.75338 1.71958 1.69175 1.6686 1.64918 1.63258 1.61836 1.60607 + 1.59506 1.58483 1.57575 1.56847 1.56193 1.55538 1.54968 + 1.54416 1.5388 1.53523 1.53165 1.52807 1.52449 1.52091 1.51771 + 1.51477 1.51182 1.50888 1.50593 1.50309 1.50113 1.49917 + 1.4972 1.49524 1.49328 1.49132 1.48935 1.48739 1.48543 1.48346 + 1.48157 1.48012 1.47868 1.47724 1.47579 1.47435 1.47291 + 1.47146 1.47002 1.46857 1.46713 1.46574 1.46462 1.4635 1.46238 + 1.46126 1.46014 1.45902 1.4579 1.45678 1.45567 1.45455 1.45349 + 1.45275 1.45201 1.45127 1.45053 1.44979 1.44905 1.44831 + 1.44757 1.44683 1.44609 1.44535 1.44461 1.44387 1.44313 + 1.44239 1.44165 1.44091 1.44017 1.43943 1.43869 1.43795 + 1.43721 1.43874 1.43976 1.43619 1.43182 1.43726 1.43084 + 1.42587 1.42383 1.42642 1.42728 1.42736 1.4271 1.42669 1.42621 + 1.42569 1.41703 1.41244 1.41019 1.41199 1.41833 1.42502 + 1.41504 1.37535 1.28381 1.44779 2.33713 3.25835 3.67554 + 3.84975 4.01125 4.2253 4.45433 4.62215 4.74478 4.82998 4.8868 + 4.92396 4.94768 4.96498 4.98537 5.0128 5.04467 5.06722 5.06535 + 5.01475 4.91956 4.80647 4.7242 4.7059 4.73552 4.76379 4.81684 + 4.87376 4.92276 4.96112 4.9884 5.0045 5.00999 5.00933 5.00619 + 5.00384 5.00342 5.00373 5.00362 5.00309 5.00272 5.00239 + 5.00204 5.00172 5.00146 5.00124 5.00105 5.00089 5.00076 + 5.00065 5.00057 5.00048 5.00041 5.00034 5.00028 5.00023 + 5.00019 5.00015 5.00015 5.00016 5.0002 5.00023 5.00021 5.00019 + 5.00017 5.00015 5.00012 5.0001 5.00008 5.00007 5.00006 5.00005 + 5.00004 5.00003 5.00002 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002 + 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001 + 5.00001 5.00001 5.00062 4.99506 4.9835 4.96726 4.9728 4.97877 + 4.98675 4.9966 5.00406 5.00679 5.00629 5.00561 5.00487 5.00429 + 5.00384 5.002 5.00164 5.00229 5.00484 5.00769 5.00019 5.00242 + 5.01319 5.0335 5.07265 5.10129 5.11485 5.12551 5.13953 5.16048 + 5.18862 5.22811 5.25656 5.25627 5.19975 4.9139 4.24745 3.43732 + 2.8202 2.43224 2.17409 2.01333 1.93951 1.94622 1.98861 2.02217 + 2.05383 2.08376 2.11184 2.13793 2.16191 2.18267 2.20502 + 2.22837 2.24958 2.26901 2.28648 2.302 2.31582 2.32802 2.33869 + 2.34795 2.35596 2.36282 2.3687 2.37371 2.37797 2.38161 2.38476 + 2.38743 2.3897 2.39168 2.39329 2.39463 2.39575 2.39671 2.39756 + 2.39835 2.39907 2.39968 2.39999 2.4003 2.40061 2.40091 2.40122 + 2.40142 2.40159 2.40176 2.40193 2.4021 2.40222 2.40228 2.40234 + 2.4024 2.40247 2.40253 2.40259 2.40265 2.40271 2.40277 2.40284 + 2.40287 2.40289 2.40291 2.40294 2.40296 2.40298 2.40301 + 2.40303 2.40305 2.40308 2.4031 2.40311 2.40312 2.40313 2.40314 + 2.40315 2.40316 2.40317 2.40318 EOD @v[37].set(<<-'EOD') - 5 5.01732 5.03181 5.05944 5.12686 5.20725 5.28103 5.31254 - 5.32901 5.33709 5.3408 5.34257 5.34311 5.34347 5.34386 5.34411 - 5.3406 5.33484 5.32942 5.32904 5.33644 5.34869 5.35001 5.34882 - 5.34758 5.34672 5.34599 5.34496 5.34364 5.34165 5.33712 - 5.33502 5.3366 5.34067 5.34306 5.34398 5.34434 5.34442 5.34443 - 5.34443 5.34441 5.34439 5.34437 5.34437 5.34438 5.34438 - 5.34438 5.34438 5.34438 5.34437 5.34437 5.34436 5.34436 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 - 5.34437 5.34437 5.34437 5.34437 5.34437 5.35377 5.35451 - 5.34265 5.34488 5.35861 5.28622 4.90033 4.75027 4.89731 - 4.97098 4.99293 4.99832 4.99909 4.99956 4.99858 4.99829 - 4.9998 5.00035 5.0038 5.00989 5.00251 4.99438 4.9953 4.99761 - 4.99985 5.00152 5.0011 5.00046 4.99996 4.99925 4.99862 4.99919 - 4.99961 5.00048 5.00234 4.99654 4.98235 4.95936 4.83738 - 4.53021 4.21004 4.00593 3.91207 3.88059 3.87822 3.89117 - 3.91278 3.94044 3.97376 4.01152 4.05052 4.10679 4.17908 - 4.25673 4.33414 4.40875 4.47879 4.54342 4.60258 4.65595 - 4.70291 4.74414 4.78018 4.81185 4.83915 4.86291 4.88301 - 4.90048 4.91528 4.92802 4.9387 4.94777 4.95539 4.9618 4.96725 - 4.97195 4.97588 4.97932 4.98247 4.98512 4.98697 4.98831 - 4.98919 4.99015 4.99101 4.99169 4.99222 4.99282 4.99341 - 4.994 4.9946 4.99519 4.99578 4.99638 4.99667 4.99693 4.9972 - 4.99747 4.99773 4.998 4.99827 4.99841 4.99849 4.99856 4.99864 - 4.99872 4.9988 4.99888 4.99896 4.99904 4.99911 4.99919 4.99927 - 4.99935 4.99943 4.9995 4.99955 4.9996 4.99965 4.9997 5.00736 - 4.98252 4.87516 4.66727 4.49142 4.43103 4.4301 4.4571 4.49729 - 4.5407 4.5835 4.62363 4.66114 4.69577 4.72738 4.74632 4.75971 - 4.77576 4.80671 4.87073 4.91665 4.93252 4.94418 4.95331 - 4.96094 4.96727 4.97148 4.97471 4.97612 4.98276 5.00247 - 5.04086 5.08628 5.10673 5.08887 5.0564 5.02767 5.01336 4.99685 - 4.97422 4.90866 4.67035 4.33117 4.07888 3.94432 3.89105 - 3.88174 3.89292 3.91442 3.94564 3.98708 4.0355 4.09134 4.16315 - 4.24088 4.31918 4.39527 4.46693 4.53337 4.59405 4.6486 4.69693 - 4.73938 4.77617 4.80809 4.83551 4.85895 4.87894 4.89596 - 4.91081 4.92417 4.93651 4.94552 4.95198 4.9565 4.96096 4.96523 - 4.96972 4.97428 4.97868 4.98064 4.9826 4.98455 4.98651 4.98847 - 4.98967 4.99064 4.9916 4.99257 4.99353 4.99422 4.99457 4.99493 - 4.99528 4.99563 4.99598 4.99633 4.99668 4.99703 4.99738 - 4.99773 4.9979 4.99804 4.99817 4.9983 4.99843 4.99856 4.99869 - 4.99883 4.99896 4.99909 4.99921 4.99926 4.99931 4.99937 - 4.99942 4.99948 4.99953 4.99959 4.99964 + 5 5.01732 5.03181 5.05944 5.12686 5.20725 5.28103 5.31254 + 5.32901 5.33709 5.3408 5.34257 5.34311 5.34347 5.34386 5.34411 + 5.3406 5.33484 5.32942 5.32904 5.33644 5.34869 5.35001 5.34882 + 5.34758 5.34672 5.34599 5.34496 5.34364 5.34165 5.33712 + 5.33502 5.3366 5.34067 5.34306 5.34398 5.34434 5.34442 5.34443 + 5.34443 5.34441 5.34439 5.34437 5.34437 5.34438 5.34438 + 5.34438 5.34438 5.34438 5.34437 5.34437 5.34436 5.34436 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 + 5.34437 5.34437 5.34437 5.34437 5.34437 5.35377 5.35451 + 5.34265 5.34488 5.35861 5.28622 4.90033 4.75027 4.89731 + 4.97098 4.99293 4.99832 4.99909 4.99956 4.99858 4.99829 + 4.9998 5.00035 5.0038 5.00989 5.00251 4.99438 4.9953 4.99761 + 4.99985 5.00152 5.0011 5.00046 4.99996 4.99925 4.99862 4.99919 + 4.99961 5.00048 5.00234 4.99654 4.98235 4.95936 4.83738 + 4.53021 4.21004 4.00593 3.91207 3.88059 3.87822 3.89117 + 3.91278 3.94044 3.97376 4.01152 4.05052 4.10679 4.17908 + 4.25673 4.33414 4.40875 4.47879 4.54342 4.60258 4.65595 + 4.70291 4.74414 4.78018 4.81185 4.83915 4.86291 4.88301 + 4.90048 4.91528 4.92802 4.9387 4.94777 4.95539 4.9618 4.96725 + 4.97195 4.97588 4.97932 4.98247 4.98512 4.98697 4.98831 + 4.98919 4.99015 4.99101 4.99169 4.99222 4.99282 4.99341 + 4.994 4.9946 4.99519 4.99578 4.99638 4.99667 4.99693 4.9972 + 4.99747 4.99773 4.998 4.99827 4.99841 4.99849 4.99856 4.99864 + 4.99872 4.9988 4.99888 4.99896 4.99904 4.99911 4.99919 4.99927 + 4.99935 4.99943 4.9995 4.99955 4.9996 4.99965 4.9997 5.00736 + 4.98252 4.87516 4.66727 4.49142 4.43103 4.4301 4.4571 4.49729 + 4.5407 4.5835 4.62363 4.66114 4.69577 4.72738 4.74632 4.75971 + 4.77576 4.80671 4.87073 4.91665 4.93252 4.94418 4.95331 + 4.96094 4.96727 4.97148 4.97471 4.97612 4.98276 5.00247 + 5.04086 5.08628 5.10673 5.08887 5.0564 5.02767 5.01336 4.99685 + 4.97422 4.90866 4.67035 4.33117 4.07888 3.94432 3.89105 + 3.88174 3.89292 3.91442 3.94564 3.98708 4.0355 4.09134 4.16315 + 4.24088 4.31918 4.39527 4.46693 4.53337 4.59405 4.6486 4.69693 + 4.73938 4.77617 4.80809 4.83551 4.85895 4.87894 4.89596 + 4.91081 4.92417 4.93651 4.94552 4.95198 4.9565 4.96096 4.96523 + 4.96972 4.97428 4.97868 4.98064 4.9826 4.98455 4.98651 4.98847 + 4.98967 4.99064 4.9916 4.99257 4.99353 4.99422 4.99457 4.99493 + 4.99528 4.99563 4.99598 4.99633 4.99668 4.99703 4.99738 + 4.99773 4.9979 4.99804 4.99817 4.9983 4.99843 4.99856 4.99869 + 4.99883 4.99896 4.99909 4.99921 4.99926 4.99931 4.99937 + 4.99942 4.99948 4.99953 4.99959 4.99964 EOD @v[38].set(<<-'EOD') - 4.49849 4.53282 4.58329 4.66625 4.83345 4.97823 5.0207 5.01816 - 5.01116 5.00595 5.00296 5.00148 5.00073 5.00062 5.00033 - 5.0003 4.99864 4.99661 4.99652 4.99928 5.00361 5.12573 5.17251 - 5.22612 5.33479 5.44503 5.44432 5.44379 5.44334 5.443 5.44276 - 5.44258 5.44246 5.44238 5.44232 5.44228 5.44225 5.44223 - 5.44221 5.4422 5.44219 5.44219 5.44218 5.44218 5.44218 5.44218 - 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 - 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 - 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44216 - 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 - 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 - 5.44216 5.44216 5.44216 5.44216 5.44215 5.44215 5.44215 - 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 - 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 - 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 - 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214 - 5.44214 5.44214 5.44214 5.44214 5.44212 5.45159 5.45236 - 5.44064 5.44307 5.45616 5.38122 4.77163 3.53297 2.74466 - 2.34448 2.11802 1.9783 1.88656 1.82001 1.77389 1.72955 1.69632 - 1.66971 1.6526 1.65236 1.56034 1.53764 1.97139 2.75096 3.39212 - 3.74042 3.82345 3.85696 3.88547 3.91862 3.9585 4.00467 4.05903 - 4.1254 4.19533 4.26791 4.34517 4.42112 4.49238 4.55807 4.6179 - 4.6713 4.71815 4.75889 4.79418 4.82456 4.85062 4.87291 4.89196 - 4.90823 4.92209 4.93388 4.9439 4.95242 4.95968 4.96585 4.97108 - 4.9755 4.97923 4.98237 4.98503 4.98732 4.98927 4.99094 4.99233 - 4.99353 4.99452 4.99538 4.99608 4.99668 4.99718 4.9976 4.99794 - 4.99822 4.99847 4.99867 4.99884 4.99899 4.99913 4.99924 - 4.99932 4.99938 4.99943 4.99947 4.99951 4.99953 4.99955 - 4.99958 4.99961 4.99964 4.99967 4.99969 4.99972 4.99975 - 4.99977 4.99978 4.99979 4.99981 4.99982 4.99983 4.99985 - 4.99986 4.99986 4.99987 4.99987 4.99988 4.99988 4.99988 - 4.99989 4.99989 4.9999 4.9999 4.99991 4.99991 4.99992 4.99992 - 4.99993 4.99993 4.99993 4.99994 5.00381 5.00064 4.99246 - 4.99823 5.00349 5.00076 5.00033 5.00015 5.00009 5.00007 - 5.00005 5.00004 5.00003 5.00002 4.99988 4.99732 4.99728 - 4.9978 5.00187 5.00927 5.08712 5.07654 4.92855 4.4863 3.76162 - 3.00049 2.49834 2.20883 2.03492 1.92384 1.84676 1.79021 - 1.74716 1.7132 1.68576 1.66309 1.64406 1.62785 1.61383 1.60162 - 1.59081 1.58117 1.57253 1.56473 1.55765 1.55117 1.54527 - 1.53988 1.53485 1.53012 1.5257 1.5216 1.51773 1.51411 1.51071 - 1.50746 1.50438 1.50146 1.49868 1.49603 1.4935 1.49109 1.48878 - 1.48657 1.48445 1.48242 1.48046 1.47858 1.47677 1.47502 - 1.47333 1.4717 1.47012 1.46859 1.46711 1.46568 1.46428 1.46292 - 1.4616 1.46034 1.45923 1.45812 1.45701 1.4559 1.45479 1.45378 - 1.45279 1.45181 1.45082 1.44983 1.44893 1.44813 1.44732 - 1.44652 1.44571 1.44491 1.4441 1.4433 1.44249 1.44169 1.44089 - 1.44019 1.43951 1.43883 1.43815 1.43747 1.4368 1.43612 1.43544 - 1.43476 1.43408 1.43342 1.43283 1.43223 1.43163 1.43104 - 1.43044 1.42984 1.42924 1.42865 + 4.49849 4.53282 4.58329 4.66625 4.83345 4.97823 5.0207 5.01816 + 5.01116 5.00595 5.00296 5.00148 5.00073 5.00062 5.00033 + 5.0003 4.99864 4.99661 4.99652 4.99928 5.00361 5.12573 5.17251 + 5.22612 5.33479 5.44503 5.44432 5.44379 5.44334 5.443 5.44276 + 5.44258 5.44246 5.44238 5.44232 5.44228 5.44225 5.44223 + 5.44221 5.4422 5.44219 5.44219 5.44218 5.44218 5.44218 5.44218 + 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 + 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 + 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44216 + 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 + 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 + 5.44216 5.44216 5.44216 5.44216 5.44215 5.44215 5.44215 + 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 + 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 + 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 + 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214 + 5.44214 5.44214 5.44214 5.44214 5.44212 5.45159 5.45236 + 5.44064 5.44307 5.45616 5.38122 4.77163 3.53297 2.74466 + 2.34448 2.11802 1.9783 1.88656 1.82001 1.77389 1.72955 1.69632 + 1.66971 1.6526 1.65236 1.56034 1.53764 1.97139 2.75096 3.39212 + 3.74042 3.82345 3.85696 3.88547 3.91862 3.9585 4.00467 4.05903 + 4.1254 4.19533 4.26791 4.34517 4.42112 4.49238 4.55807 4.6179 + 4.6713 4.71815 4.75889 4.79418 4.82456 4.85062 4.87291 4.89196 + 4.90823 4.92209 4.93388 4.9439 4.95242 4.95968 4.96585 4.97108 + 4.9755 4.97923 4.98237 4.98503 4.98732 4.98927 4.99094 4.99233 + 4.99353 4.99452 4.99538 4.99608 4.99668 4.99718 4.9976 4.99794 + 4.99822 4.99847 4.99867 4.99884 4.99899 4.99913 4.99924 + 4.99932 4.99938 4.99943 4.99947 4.99951 4.99953 4.99955 + 4.99958 4.99961 4.99964 4.99967 4.99969 4.99972 4.99975 + 4.99977 4.99978 4.99979 4.99981 4.99982 4.99983 4.99985 + 4.99986 4.99986 4.99987 4.99987 4.99988 4.99988 4.99988 + 4.99989 4.99989 4.9999 4.9999 4.99991 4.99991 4.99992 4.99992 + 4.99993 4.99993 4.99993 4.99994 5.00381 5.00064 4.99246 + 4.99823 5.00349 5.00076 5.00033 5.00015 5.00009 5.00007 + 5.00005 5.00004 5.00003 5.00002 4.99988 4.99732 4.99728 + 4.9978 5.00187 5.00927 5.08712 5.07654 4.92855 4.4863 3.76162 + 3.00049 2.49834 2.20883 2.03492 1.92384 1.84676 1.79021 + 1.74716 1.7132 1.68576 1.66309 1.64406 1.62785 1.61383 1.60162 + 1.59081 1.58117 1.57253 1.56473 1.55765 1.55117 1.54527 + 1.53988 1.53485 1.53012 1.5257 1.5216 1.51773 1.51411 1.51071 + 1.50746 1.50438 1.50146 1.49868 1.49603 1.4935 1.49109 1.48878 + 1.48657 1.48445 1.48242 1.48046 1.47858 1.47677 1.47502 + 1.47333 1.4717 1.47012 1.46859 1.46711 1.46568 1.46428 1.46292 + 1.4616 1.46034 1.45923 1.45812 1.45701 1.4559 1.45479 1.45378 + 1.45279 1.45181 1.45082 1.44983 1.44893 1.44813 1.44732 + 1.44652 1.44571 1.44491 1.4441 1.4433 1.44249 1.44169 1.44089 + 1.44019 1.43951 1.43883 1.43815 1.43747 1.4368 1.43612 1.43544 + 1.43476 1.43408 1.43342 1.43283 1.43223 1.43163 1.43104 + 1.43044 1.42984 1.42924 1.42865 EOD @v[39].set(<<-'EOD') - 5 5.01048 5.01221 4.98887 4.76261 4.54943 4.51564 4.56249 - 4.62621 4.68843 4.74374 4.79044 4.82972 4.86127 4.88724 - 4.90862 4.90791 4.89858 4.89589 4.91767 5.00405 5.16956 - 5.12391 4.7557 3.87953 3.01124 2.48482 2.20424 2.03812 1.92679 - 1.84956 1.79256 1.74907 1.71487 1.68724 1.6644 1.64513 1.6287 - 1.61446 1.60197 1.59095 1.58117 1.57245 1.5646 1.55752 1.55109 - 1.54516 1.53958 1.53444 1.53008 1.52606 1.52205 1.51843 - 1.5149 1.51146 1.50893 1.50639 1.50387 1.50133 1.4988 1.49651 - 1.49436 1.49222 1.49007 1.48793 1.48585 1.48433 1.4828 1.48128 - 1.47975 1.47823 1.4767 1.47518 1.47365 1.47213 1.4706 1.46912 - 1.46795 1.46678 1.46561 1.46444 1.46327 1.4621 1.46093 1.45976 - 1.45859 1.45741 1.45628 1.45534 1.45441 1.45347 1.45254 - 1.4516 1.45067 1.44973 1.4488 1.44786 1.44693 1.44604 1.44539 - 1.44475 1.4441 1.44345 1.44281 1.44216 1.44151 1.44086 1.44022 - 1.43957 1.43892 1.43828 1.43763 1.43698 1.43633 1.43569 - 1.43504 1.43439 1.43375 1.4331 1.43245 1.4318 1.43157 1.43089 - 1.43001 1.43042 1.42899 1.42439 1.42216 1.43447 1.44048 - 1.43705 1.43314 1.43039 1.42861 1.42739 1.42651 1.42548 - 1.42488 1.4243 1.42392 1.4235 1.32443 1.31149 1.78169 2.64844 - 3.43211 3.95252 4.20231 4.3746 4.49948 4.58929 4.65742 4.71183 - 4.77057 4.83196 4.88354 4.92894 4.96625 4.99235 5.00651 - 5.00941 5.00813 5.00689 5.00588 5.00504 5.00431 5.00368 - 5.00314 5.00268 5.00228 5.00194 5.00165 5.0014 5.00118 5.001 - 5.00085 5.00072 5.00061 5.00052 5.00044 5.00037 5.00031 - 5.00027 5.00022 5.00019 5.00016 5.00013 5.00011 5.00009 - 5.00008 5.00007 5.00006 5.00005 5.00004 5.00003 5.00003 - 5.00003 5.00002 5.00002 5.00002 5.00001 5.00001 5.00001 - 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 - 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99998 - 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999 - 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001 - 5.00002 5.00003 5.00004 5.00022 4.99974 4.99942 4.99997 - 5.00063 5.00002 5.00003 4.99994 4.99998 4.99999 5 5 5 5 - 5 4.99981 4.99998 5.00004 5.00036 5.00049 5.12012 5.16315 - 5.19712 5.21835 4.87874 4.10151 3.31555 2.74207 2.38075 - 2.15872 2.01614 1.91886 1.84852 1.79401 1.75052 1.71508 - 1.68672 1.66467 1.64602 1.62985 1.61576 1.60343 1.59256 - 1.58287 1.57418 1.56632 1.55922 1.55282 1.54687 1.54132 - 1.53618 1.53143 1.52698 1.52282 1.51895 1.51527 1.5118 1.50851 - 1.5054 1.50244 1.49963 1.49695 1.4944 1.49196 1.48963 1.4874 - 1.48527 1.48322 1.48124 1.47934 1.47751 1.47574 1.47403 - 1.47239 1.4708 1.46926 1.46777 1.46632 1.46491 1.46355 1.46237 - 1.4612 1.46002 1.45884 1.45766 1.45659 1.45555 1.45451 1.45346 - 1.45242 1.45147 1.45062 1.44978 1.44894 1.44809 1.44725 - 1.4464 1.44556 1.44472 1.44387 1.44303 1.4423 1.44159 1.44088 - 1.44017 1.43947 1.43876 1.43805 1.43734 1.43664 1.43593 - 1.43524 1.43462 1.434 1.43338 1.43276 1.43213 1.43151 1.43089 - 1.43027 + 5 5.01048 5.01221 4.98887 4.76261 4.54943 4.51564 4.56249 + 4.62621 4.68843 4.74374 4.79044 4.82972 4.86127 4.88724 + 4.90862 4.90791 4.89858 4.89589 4.91767 5.00405 5.16956 + 5.12391 4.7557 3.87953 3.01124 2.48482 2.20424 2.03812 1.92679 + 1.84956 1.79256 1.74907 1.71487 1.68724 1.6644 1.64513 1.6287 + 1.61446 1.60197 1.59095 1.58117 1.57245 1.5646 1.55752 1.55109 + 1.54516 1.53958 1.53444 1.53008 1.52606 1.52205 1.51843 + 1.5149 1.51146 1.50893 1.50639 1.50387 1.50133 1.4988 1.49651 + 1.49436 1.49222 1.49007 1.48793 1.48585 1.48433 1.4828 1.48128 + 1.47975 1.47823 1.4767 1.47518 1.47365 1.47213 1.4706 1.46912 + 1.46795 1.46678 1.46561 1.46444 1.46327 1.4621 1.46093 1.45976 + 1.45859 1.45741 1.45628 1.45534 1.45441 1.45347 1.45254 + 1.4516 1.45067 1.44973 1.4488 1.44786 1.44693 1.44604 1.44539 + 1.44475 1.4441 1.44345 1.44281 1.44216 1.44151 1.44086 1.44022 + 1.43957 1.43892 1.43828 1.43763 1.43698 1.43633 1.43569 + 1.43504 1.43439 1.43375 1.4331 1.43245 1.4318 1.43157 1.43089 + 1.43001 1.43042 1.42899 1.42439 1.42216 1.43447 1.44048 + 1.43705 1.43314 1.43039 1.42861 1.42739 1.42651 1.42548 + 1.42488 1.4243 1.42392 1.4235 1.32443 1.31149 1.78169 2.64844 + 3.43211 3.95252 4.20231 4.3746 4.49948 4.58929 4.65742 4.71183 + 4.77057 4.83196 4.88354 4.92894 4.96625 4.99235 5.00651 + 5.00941 5.00813 5.00689 5.00588 5.00504 5.00431 5.00368 + 5.00314 5.00268 5.00228 5.00194 5.00165 5.0014 5.00118 5.001 + 5.00085 5.00072 5.00061 5.00052 5.00044 5.00037 5.00031 + 5.00027 5.00022 5.00019 5.00016 5.00013 5.00011 5.00009 + 5.00008 5.00007 5.00006 5.00005 5.00004 5.00003 5.00003 + 5.00003 5.00002 5.00002 5.00002 5.00001 5.00001 5.00001 + 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 + 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99998 + 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999 + 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001 + 5.00002 5.00003 5.00004 5.00022 4.99974 4.99942 4.99997 + 5.00063 5.00002 5.00003 4.99994 4.99998 4.99999 5 5 5 5 + 5 4.99981 4.99998 5.00004 5.00036 5.00049 5.12012 5.16315 + 5.19712 5.21835 4.87874 4.10151 3.31555 2.74207 2.38075 + 2.15872 2.01614 1.91886 1.84852 1.79401 1.75052 1.71508 + 1.68672 1.66467 1.64602 1.62985 1.61576 1.60343 1.59256 + 1.58287 1.57418 1.56632 1.55922 1.55282 1.54687 1.54132 + 1.53618 1.53143 1.52698 1.52282 1.51895 1.51527 1.5118 1.50851 + 1.5054 1.50244 1.49963 1.49695 1.4944 1.49196 1.48963 1.4874 + 1.48527 1.48322 1.48124 1.47934 1.47751 1.47574 1.47403 + 1.47239 1.4708 1.46926 1.46777 1.46632 1.46491 1.46355 1.46237 + 1.4612 1.46002 1.45884 1.45766 1.45659 1.45555 1.45451 1.45346 + 1.45242 1.45147 1.45062 1.44978 1.44894 1.44809 1.44725 + 1.4464 1.44556 1.44472 1.44387 1.44303 1.4423 1.44159 1.44088 + 1.44017 1.43947 1.43876 1.43805 1.43734 1.43664 1.43593 + 1.43524 1.43462 1.434 1.43338 1.43276 1.43213 1.43151 1.43089 + 1.43027 EOD end Index: ext/tk/sample/tkextlib/blt/graph7.rb =================================================================== --- ext/tk/sample/tkextlib/blt/graph7.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/graph7.rb (working copy) @@ -16,10 +16,10 @@ v_y.expr("random(#{v_y})") v_x.sort(v_y) -plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square, - :color=>'green4', :fill=>'green2', - :linewidth=>0, :outlinewidth=>1, - :pixels=>4, :label=>'plot', +plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square, + :color=>'green4', :fill=>'green2', + :linewidth=>0, :outlinewidth=>1, + :pixels=>4, :label=>'plot', :xdata=>v_x, :ydata=>v_y) Tk.root.minsize(0, 0) Index: ext/tk/sample/tkextlib/blt/graph7a.rb =================================================================== --- ext/tk/sample/tkextlib/blt/graph7a.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/graph7a.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/blt' -file = File.join(File.dirname(File.expand_path(__FILE__)), +file = File.join(File.dirname(File.expand_path(__FILE__)), 'images', 'buckskin.gif') bgTexture = TkPhotoImage.new(:file=>file) @@ -39,10 +39,10 @@ v_y.expr("random(#{v_y})") v_x.sort(v_y) -plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square, - :color=>'green4', :fill=>'green2', - :linewidth=>0, :outlinewidth=>1, - :pixels=>4, :label=>'plot', +plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square, + :color=>'green4', :fill=>'green2', + :linewidth=>0, :outlinewidth=>1, + :pixels=>4, :label=>'plot', :xdata=>v_x, :ydata=>v_y) Tk.root.minsize(0, 0) Index: ext/tk/sample/tkextlib/blt/graph7b.rb =================================================================== --- ext/tk/sample/tkextlib/blt/graph7b.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/graph7b.rb (working copy) @@ -17,10 +17,10 @@ y[i] = rand } -plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square, - :color=>'green4', :fill=>'green2', - :linewidth=>0, :outlinewidth=>1, - :pixels=>4, :label=>'plot', +plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square, + :color=>'green4', :fill=>'green2', + :linewidth=>0, :outlinewidth=>1, + :pixels=>4, :label=>'plot', :xdata=>x, :ydata=>y) Tk.root.minsize(0, 0) Index: ext/tk/sample/tkextlib/blt/pareto.rb =================================================================== --- ext/tk/sample/tkextlib/blt/pareto.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/pareto.rb (working copy) @@ -8,21 +8,21 @@ # The pareto chart mixes line and bar elements in the same graph. # Each processing operating is represented by a bar element. The # total accumulated defects is displayed with a single line element. -b = Tk::BLT::Barchart.new(:title=>'Defects Found During Inspection', - :font=>'Helvetica 12', :plotpady=>[12, 4], +b = Tk::BLT::Barchart.new(:title=>'Defects Found During Inspection', + :font=>'Helvetica 12', :plotpady=>[12, 4], :width=>'6i', :height=>'5i') Tk::BLT::Table.add(Tk.root, b, :fill=>:both) data = [ - ["Spot Weld", 82, 'yellow'], - ["Lathe", 49, 'orange'], - ["Gear Cut", 38, 'green'], - ["Drill", 24, 'blue'], - ["Grind", 17, 'red'], - ["Lapping", 12, 'brown'], - ["Press", 8, 'purple'], - ["De-burr", 4, 'pink'], - ["Packaging", 3, 'cyan'], + ["Spot Weld", 82, 'yellow'], + ["Lathe", 49, 'orange'], + ["Gear Cut", 38, 'green'], + ["Drill", 24, 'blue'], + ["Grind", 17, 'red'], + ["Lapping", 12, 'brown'], + ["Press", 8, 'purple'], + ["De-burr", 4, 'pink'], + ["Packaging", 3, 'cyan'], ["Other", 12, 'magenta'] ] @@ -41,8 +41,8 @@ data.each{|label, value, color| count += 1 - b.element_create(label, :xdata=>count, :ydata=>value, :foreground=>color, - :relief=>:solid, :borderwidth=>1, :stipple=>pattern1, + b.element_create(label, :xdata=>count, :ydata=>value, :foreground=>color, + :relief=>:solid, :borderwidth=>1, :stipple=>pattern1, :background=>'lightblue') labels[count] = label # Get the total number of defects. @@ -51,7 +51,7 @@ xdata << count } -# Configure the coordinates of the accumulated defects, +# Configure the coordinates of the accumulated defects, # now that we know what they are. b.element_configure('accum', :xdata=>xdata, :ydata=>ydata) @@ -63,19 +63,19 @@ else text = '%.1f' % percent end - b.marker_create(:text, :coords=>[x, y], :text=>text, :font=>'Helvetica 10', + b.marker_create(:text, :coords=>[x, y], :text=>text, :font=>'Helvetica 10', :foreground=>'red4', :anchor=>:center, :yoffset=>-5) } # Display an auxillary y-axis for percentages. -b.axis_configure('y2', :hide=>false, :min=>0.0, :max=>100.0, +b.axis_configure('y2', :hide=>false, :min=>0.0, :max=>100.0, :title=>'Percentage') # Title the y-axis b.axis_configure('y', :title=>'Defects') # Configure the x-axis to display the process names, instead of numbers. -b.axis_configure('x', :title=>'Process', :rotate=>90, :subdivisions=>0, +b.axis_configure('x', :title=>'Process', :rotate=>90, :subdivisions=>0, :command=>proc{|w, val| val = val.round labels[val]? labels[val]: val Index: ext/tk/sample/tkextlib/blt/graph7c.rb =================================================================== --- ext/tk/sample/tkextlib/blt/graph7c.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/graph7c.rb (working copy) @@ -21,10 +21,10 @@ v_x.set(x) v_y.set(y) -plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square, - :color=>'green4', :fill=>'green2', - :linewidth=>0, :outlinewidth=>1, - :pixels=>4, :label=>'plot', +plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square, + :color=>'green4', :fill=>'green2', + :linewidth=>0, :outlinewidth=>1, + :pixels=>4, :label=>'plot', :xdata=>v_x, :ydata=>v_y) Tk.root.minsize(0, 0) Index: ext/tk/sample/tkextlib/blt/plot1b.rb =================================================================== --- ext/tk/sample/tkextlib/blt/plot1b.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/plot1b.rb (working copy) @@ -4,7 +4,7 @@ graph = Tk::BLT::Graph.new.pack plot = graph.element_create -plot.configure(:linewidth=>0, :label=>'foo', +plot.configure(:linewidth=>0, :label=>'foo', :data=>[[1.0, 3.4], [1.1, 2.8], [1.2, 3.1], [1.4, 2.9]].flatten) Tk.mainloop Index: ext/tk/sample/tkextlib/blt/calendar.rb =================================================================== --- ext/tk/sample/tkextlib/blt/calendar.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/calendar.rb (working copy) @@ -31,17 +31,17 @@ class BLT_Calendar_sample @@monthInfo = [ nil, # dummy - ['January', 31], - ['February', 28], - ['March', 31], - ['April', 30], - ['May', 31], - ['June', 30], - ['July', 31], - ['August', 31], - ['Septembar', 30], - ['October', 31], - ['November', 30], + ['January', 31], + ['February', 28], + ['March', 31], + ['April', 30], + ['May', 31], + ['June', 30], + ['July', 31], + ['August', 31], + ['Septembar', 30], + ['October', 31], + ['November', 30], ['December', 31] ] @@ -53,23 +53,23 @@ if TkComm.bool(Tk.info(:commands, '.calendar')) Tk.destroy('.calendar') end - cal = Tk::BLT::Tile::Frame.new(:widgetname=>'.calendar', - :classname=>'Calendar', + cal = Tk::BLT::Tile::Frame.new(:widgetname=>'.calendar', + :classname=>'Calendar', :width=>'3i', :height=>'3i') - mon = Tk::BLT::Tile::Label.new(cal, :font=>'Courier 14 bold', - :text=>"#{@@monthInfo[today.month][0]} " + + mon = Tk::BLT::Tile::Label.new(cal, :font=>'Courier 14 bold', + :text=>"#{@@monthInfo[today.month][0]} " + "#{today.year}") Tk::BLT::Table.add(cal, mon, [1, 0], :cspan=>7, :pady=>10) - week_f = Tk::BLT::Tile::Frame.new(cal, :widgetname=>'weekframe', + week_f = Tk::BLT::Tile::Frame.new(cal, :widgetname=>'weekframe', :relief=>:sunken, :borderwidth=>1) Tk::BLT::Table.add(cal, week_f, [2, 0], :columnspan=>7, :fill=>:both) @@abbrDays.each_with_index{|dayName, idx| - Tk::BLT::Table.add(cal, - Tk::BLT::Tile::Label.new(cal, :text=>dayName, - :font=>'Helvetica 12'), + Tk::BLT::Table.add(cal, + Tk::BLT::Tile::Label.new(cal, :text=>dayName, + :font=>'Helvetica 12'), [2, idx], :pady=>2, :padx=>2) } @@ -83,11 +83,11 @@ wkday += 7 if wkday < 0 while cnt <= numDays - Tk::BLT::Table.add(cal, + Tk::BLT::Table.add(cal, Tk::BLT::Tile::Label.new(cal, :text=>cnt){ - self.configure(:borderwidth=>1, + self.configure(:borderwidth=>1, :relief=>:sunken) if cnt == today.day - }, + }, [week+3, wkday], :fill=>:both, :ipadx=>10, :ipady=>4) cnt += 1 wkday += 1 @@ -98,11 +98,11 @@ end Tk::BLT::Tile::Frame.new(cal, :borderwidth=>1, :relief=>:sunken){|f| - Tk::BLT::Table.add(f, - Tk::BLT::Tile::Button.new(f, :widgetname=>'button', - :command=>proc{exit}, - :borderwidth=>2, - :text=>'Quit'), + Tk::BLT::Table.add(f, + Tk::BLT::Tile::Button.new(f, :widgetname=>'button', + :command=>proc{exit}, + :borderwidth=>2, + :text=>'Quit'), :padx=>4, :pady=>4) Tk::BLT::Table.add(cal, f, [week+4, 5], :cspan=>2, :pady=>4) } Index: ext/tk/sample/tkextlib/blt/barchart5.rb =================================================================== --- ext/tk/sample/tkextlib/blt/barchart5.rb (revision 23917) +++ ext/tk/sample/tkextlib/blt/barchart5.rb (working copy) @@ -2,7 +2,7 @@ require 'tk' require 'tkextlib/blt' -load File.join(File.dirname(File.expand_path(__FILE__)), +load File.join(File.dirname(File.expand_path(__FILE__)), 'scripts', 'stipples.rb') TkOption.add('*graph.x.Title', 'X Axis Label') @@ -23,27 +23,27 @@ end htext = Tk::BLT::Htext.new(:widgetname=>'.htext', :text=><'print', :text=>'Print', + b = TkButton.new(Tk::BLT::Htext::Htext_Widget.window, + :widgetname=>'print', :text=>'Print', :command=>proc{ $graph.postsript(:output=>'bar.ps') }) Tk::BLT::Htext::Htext_Widget.window.append(b) } -%% button. +%% button. %% ruby { - $graph = Tk::BLT::Barchart.new(:widgetname=>'.htext.graph', + $graph = Tk::BLT::Barchart.new(:widgetname=>'.htext.graph', :relief=>:raised, :borderwidth=>2) $graph.xaxis_configure(:rotate=>90, :stepsize=>0) - Tk::BLT::Htext::Htext_Widget.window.append($graph, + Tk::BLT::Htext::Htext_Widget.window.append($graph, :fill=>:both, :padx=>4) } @@ -51,8 +51,8 @@ Hit the %% ruby { - b = TkButton.new(Tk::BLT::Htext::Htext_Widget.window, - :widgetname=>'quit', :text=>'Quit', + b = TkButton.new(Tk::BLT::Htext::Htext_Widget.window, + :widgetname=>'quit', :text=>'Quit', :command=>proc{ exit }) Tk::BLT::Htext::Htext_Widget.window.append(b) } @@ -86,7 +86,7 @@ y.expr("sin(#{x})") barWidth = 0.19 -$graph.element_create('sin', :relief=>:raised, :borderwidth=>1, +$graph.element_create('sin', :relief=>:raised, :borderwidth=>1, :x=>x, :y=>y, :barwidth=>barWidth) Tk::BLT::Table.add(Tk.root, htext, :fill=>:both) Index: ext/tk/sample/tkextlib/tkHTML/hv.rb =================================================================== --- ext/tk/sample/tkextlib/tkHTML/hv.rb (revision 23917) +++ ext/tk/sample/tkextlib/tkHTML/hv.rb (working copy) @@ -5,7 +5,7 @@ # # This application is used for testing the HTML widget. It can # also server as an example of how to use the HTML widget. -# +# require 'tk' require 'tkextlib/tkHTML' @@ -51,11 +51,11 @@ # html[:fontcommand] = pick_font pick_font = proc{|size, attrs| puts "FontCmd: #{size} #{attrs}" - [ ((attrs =~ /fixed/)? 'courier': 'charter'), - (12 * (1.2**(size.to_f - 4.0))).to_i, - ((attrs =~ /italic/)? 'italic': 'roman'), - ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ') -} + [ ((attrs =~ /fixed/)? 'courier': 'charter'), + (12 * (1.2**(size.to_f - 4.0))).to_i, + ((attrs =~ /italic/)? 'italic': 'roman'), + ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ') +} # # This routine is called for each form element @@ -126,7 +126,7 @@ # This routine is called for every markup # -applet_cmd = proc{|w, arglist| +applet_cmd = proc{|w, arglist| # puts "AppletCmd: w=#{w} arglist=#{arglist}" TkLabel.new(w, :text=>"The Applet #{w}", :bd=>2, :relief=>raised) } @@ -134,12 +134,12 @@ # # Construct the main HTML viewer # -html = Tk::HTML_Widget.new(:padx=>5, :pady=>9, - :formcommand=>form_cmd, - :imagecommand=>image_cmd, - :scriptcommand=>script_cmd, - :appletcommand=>applet_cmd, - :underlinehyperlinks=>0, +html = Tk::HTML_Widget.new(:padx=>5, :pady=>9, + :formcommand=>form_cmd, + :imagecommand=>image_cmd, + :scriptcommand=>script_cmd, + :appletcommand=>applet_cmd, + :underlinehyperlinks=>0, :bg=>'white', :tablerelief=>:raised) vscr = html.yscrollbar(TkScrollbar.new) hscr = html.xscrollbar(TkScrollbar.new) @@ -166,7 +166,7 @@ rescue ret = nil fp = nil - Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'", + Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'", :type=>:ok) ensure fp.close if fp @@ -221,7 +221,7 @@ html.clipping_window.bind('B1-Motion', proc{|w, x, y| w.selection_set(priv['mark'], "@#{x},#{y}") TkClipboard.clear - # avoid tkhtml0.0 errors + # avoid tkhtml0.0 errors # anyone can fix this for tkhtml0.0 begin TkClipboard.append(TkSelection.get) @@ -235,7 +235,7 @@ last_dir = Dir.pwd sel_load = proc{ filetypes = [ - ['Html Files', ['.html', '.htm']], + ['Html Files', ['.html', '.htm']], ['All Files', '*'] ] @@ -268,15 +268,15 @@ # Setup menu # menu_spec = [ - [['File', 0], - ['Open', sel_load, 0], - ['Refresh', refresh, 0], + [['File', 0], + ['Open', sel_load, 0], + ['Refresh', refresh, 0], '---', - ['Exit', proc{exit}, 1]], + ['Exit', proc{exit}, 1]], - [['View', 0], - ['Underline Hyperlinks', ul_hyper], - ['Show Table Structure', show_tbl], + [['View', 0], + ['Underline Hyperlinks', ul_hyper], + ['Show Table Structure', show_tbl], ['Show Images', show_img]] ] @@ -285,7 +285,7 @@ # # Setup trace # -ul_hyper.trace('w', proc{ +ul_hyper.trace('w', proc{ html[:underlinehyperlinks] = ul_hyper.value refresh.call }) Index: ext/tk/sample/tkextlib/tkHTML/ss.rb =================================================================== --- ext/tk/sample/tkextlib/tkHTML/ss.rb (revision 23917) +++ ext/tk/sample/tkextlib/tkHTML/ss.rb (working copy) @@ -2,7 +2,7 @@ # # This script implements the "ss" application. "ss" implements # a presentation slide-show based on HTML slides. -# +# require 'tk' require 'tkextlib/tkHTML' @@ -45,18 +45,18 @@ @key_block = false - Tk::HTML_Widget::ClippingWindow.bind('1', - proc{|w, ksym| key_press(w, ksym)}, + Tk::HTML_Widget::ClippingWindow.bind('1', + proc{|w, ksym| key_press(w, ksym)}, '%W Down') - Tk::HTML_Widget::ClippingWindow.bind('3', - proc{|w, ksym| key_press(w, ksym)}, + Tk::HTML_Widget::ClippingWindow.bind('3', + proc{|w, ksym| key_press(w, ksym)}, '%W Up') - Tk::HTML_Widget::ClippingWindow.bind('2', - proc{|w, ksym| key_press(w, ksym)}, + Tk::HTML_Widget::ClippingWindow.bind('2', + proc{|w, ksym| key_press(w, ksym)}, '%W Down') - Tk::HTML_Widget::ClippingWindow.bind('KeyPress', - proc{|w, ksym| key_press(w, ksym)}, + Tk::HTML_Widget::ClippingWindow.bind('KeyPress', + proc{|w, ksym| key_press(w, ksym)}, '%W %K') ############################################ @@ -64,37 +64,37 @@ # Build the half-size view of the page # menu_spec = [ - [['File', 0], - ['Open', proc{sel_load()}, 0], - ['Full Screen', proc{fullscreen()}, 0], - ['Refresh', proc{refresh()}, 0], + [['File', 0], + ['Open', proc{sel_load()}, 0], + ['Full Screen', proc{fullscreen()}, 0], + ['Refresh', proc{refresh()}, 0], '---', ['Exit', proc{exit}, 1]] ] mbar = @root.add_menubar(menu_spec) - @html = Tk::HTML_Widget.new(:width=>512, :height=>384, - :padx=>5, :pady=>9, + @html = Tk::HTML_Widget.new(:width=>512, :height=>384, + :padx=>5, :pady=>9, :formcommand=>proc{|*args| form_cmd(*args)}, :imagecommand=>proc{|*args| image_cmd(1, *args) - }, + }, :scriptcommand=>proc{|*args| script_cmd(*args) - }, + }, :appletcommand=>proc{|*args| applet_cmd(*args) - }, - :hyperlinkcommand=>proc{|*args| + }, + :hyperlinkcommand=>proc{|*args| hyper_cmd(*args) - }, + }, :fontcommand=>proc{|*args| pick_font(*args) - }, + }, :appletcommand=>proc{|*args| run_applet('small', *args) - }, + }, :bg=>'white', :tablerelief=>:raised) @html.token_handler('meta', proc{|*args| meta(@html, *args)}) @@ -127,9 +127,9 @@ # html[:fontcommand] = pick_font def pick_font(size, attrs) # puts "FontCmd: #{size} #{attrs}" - [ ((attrs =~ /fixed/)? 'courier': 'charter'), - (12 * (1.2**(size.to_f - 4.0))).to_i, - ((attrs =~ /italic/)? 'italic': 'roman'), + [ ((attrs =~ /fixed/)? 'courier': 'charter'), + (12 * (1.2**(size.to_f - 4.0))).to_i, + ((attrs =~ /italic/)? 'italic': 'roman'), ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ') end @@ -139,9 +139,9 @@ baseFontSize = 24 # puts "FontCmd: #{size} #{attrs}" - [ ((attrs =~ /fixed/)? 'courier': 'charter'), - (baseFontSize * (1.2**(size.to_f - 4.0))).to_i, - ((attrs =~ /italic/)? 'italic': 'roman'), + [ ((attrs =~ /fixed/)? 'courier': 'charter'), + (baseFontSize * (1.2**(size.to_f - 4.0))).to_i, + ((attrs =~ /italic/)? 'italic': 'roman'), ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ') end @@ -244,7 +244,7 @@ # def sel_load filetypes = [ - ['Html Files', ['.html', '.htm']], + ['Html Files', ['.html', '.htm']], ['All Files', '*'] ] @@ -280,7 +280,7 @@ rescue ret = nil fp = nil - Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'", + Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'", :type=>:ok) ensure fp.close if fp @@ -371,32 +371,32 @@ width = @root.winfo_screenwidth height = @root.winfo_screenheight - @fswin = TkToplevel.new(:overrideredirect=>true, + @fswin = TkToplevel.new(:overrideredirect=>true, :geometry=>"#{width}x#{height}+0+0") - @html_fs = Tk::HTML_Widget.new(@fswin, :padx=>5, :pady=>9, + @html_fs = Tk::HTML_Widget.new(@fswin, :padx=>5, :pady=>9, :formcommand=>proc{|*args| form_cmd(*args) }, - :imagecommand=>proc{|*args| + :imagecommand=>proc{|*args| image_cmd(0, *args) - }, + }, :scriptcommand=>proc{|*args| script_cmd(*args) - }, + }, :appletcommand=>proc{|*args| applet_cmd(*args) - }, - :hyperlinkcommand=>proc{|*args| + }, + :hyperlinkcommand=>proc{|*args| hyper_cmd(*args) - }, + }, :appletcommand=>proc{|*args| run_applet('big', *args) - }, + }, :fontcommand=>proc{|*args| pick_font_fs(*args) - }, - :bg=>'white', :tablerelief=>:raised, + }, + :bg=>'white', :tablerelief=>:raised, :cursor=>:tcross) { pack(:fill=>:both, :expand=>true) token_handler('meta', proc{|*args| meta(self, *args)}) Index: ext/tk/sample/tkextlib/treectrl/layout.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/layout.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/layout.rb (working copy) @@ -2,7 +2,7 @@ # Demo: Layout # def demoLayout(t) - t.configure(:showroot=>false, :showrootbutton=>true, :showbuttons=>true, + t.configure(:showroot=>false, :showrootbutton=>true, :showbuttons=>true, :showlines=>true, :itemheight=>0, :selectmode=>:browse) if $HasColumnCreate @@ -12,10 +12,10 @@ end t.element_create('e1', :rect, :width=>30, :height=>30, :fill=>'gray20') - t.element_create('e2', :rect, :width=>30, :height=>30, :fill=>'gray40', + t.element_create('e2', :rect, :width=>30, :height=>30, :fill=>'gray40', :outline=>'blue', :outlinewidth=>3) t.element_create('e3', :rect, :fill=>'gray60') - t.element_create('e4', :rect, :showfocus=>true, + t.element_create('e4', :rect, :showfocus=>true, :fill=>[ @SystemHighlight, ['selected', 'focus'], 'gray80', [] ]) @@ -31,9 +31,9 @@ t.style_layout(s, 'e3', :union=>['e1', 'e2'], :ipadx=>4, :ipady=>4, :pady=>2) t.style_layout(s, 'e4', :detach=>true, :iexpand=>:es) t.style_layout(s, 'e5', :detach=>true, :padx=>[2,0], :pady=>2, :iexpand=>:s) - t.style_layout(s, 'e6', :detach=>true, :expand=>:ws, + t.style_layout(s, 'e6', :detach=>true, :expand=>:ws, :padx=>[0,2], :pady=>[2,0]) - t.style_layout(s, 'e7', :detach=>true, :expand=>:wn, + t.style_layout(s, 'e7', :detach=>true, :expand=>:wn, :padx=>[0,2], :pady=>[0,2]) if $Version_1_1_OrLater @@ -53,7 +53,7 @@ t.item_style_set(i, 0, s) t.item_lastchild(parent, i) - ### + ### s = t.style_create('s2') t.style_elements(s, ['e4', 'e3', 'e1']) @@ -77,7 +77,7 @@ t.item_style_set(i2, 0, s) t.item_lastchild(i, i2) - ### + ### s = t.style_create('s3') t.style_elements(s, ['e4', 'e3', 'e1', 'e5', 'e6']) @@ -101,10 +101,10 @@ t.item_style_set(i2, 0, s) t.item_lastchild(i, i2) - ### + ### - t.element_create('eb', :border, :background=>@SystemButtonFace, - :relief=>[:sunken, ['selected'], :raised, []], + t.element_create('eb', :border, :background=>@SystemButtonFace, + :relief=>[:sunken, ['selected'], :raised, []], :thickness=>2, :filled=>true) t.element_create('et', :text) @@ -134,11 +134,11 @@ t.item_text(i, 0, text) t.item_lastchild(parent, i) - ### + ### styleNum = 5 - [ - [:horizontal, [:s, :ns, :n]], + [ + [:horizontal, [:s, :ns, :n]], [:vertical, [:e, :we, :w]] ].each{|orient, expandList| expandList.each{|expand| Index: ext/tk/sample/tkextlib/treectrl/www-options.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/www-options.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/www-options.rb (working copy) @@ -3,7 +3,7 @@ height = t.font.metrics(:linespace) + 2 height = 18 if height < 18 - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, :itemheight=>height, :selectmode=>:browse) init_pics('internet-*') @@ -19,14 +19,14 @@ t.state_define('on') t.element_create('e1', :image, :image=>[ - @images['internet-check-on'], ['check', 'on'], - @images['internet-check-off'], ['check'], - @images['internet-radio-on'], ['radio', 'on'], + @images['internet-check-on'], ['check', 'on'], + @images['internet-check-off'], ['check'], + @images['internet-radio-on'], ['radio', 'on'], @images['internet-radio-off'], ['radio'] ]) - t.element_create('e2', :text, + t.element_create('e2', :text, :fill=>[@SystemHighlightText, ['selected', 'focus']]) - t.element_create('e3', :rect, :showfocus=>true, + t.element_create('e3', :rect, :showfocus=>true, :fill=>[@SystemHighlight, ['selected', 'focus']]) s = t.style_create('s1') @@ -38,18 +38,18 @@ parentList = [:root, '', '', '', '', '', ''] parent = :root [ - [0, :print, "Printing", "", ""], - [1, :off, "Print background colors and images", "o1", ""], - [0, :search, "Search from Address bar", "", ""], - [1, :search, "When searching", "", ""], - [2, :off, "Display results, and go to the most likely sites", - "o2", "r1"], - [2, :off, "Do not search from the Address bar", "o3", "r1"], - [2, :off, "Just display the results in the main window", + [0, :print, "Printing", "", ""], + [1, :off, "Print background colors and images", "o1", ""], + [0, :search, "Search from Address bar", "", ""], + [1, :search, "When searching", "", ""], + [2, :off, "Display results, and go to the most likely sites", + "o2", "r1"], + [2, :off, "Do not search from the Address bar", "o3", "r1"], + [2, :off, "Just display the results in the main window", "o4", "r1"], - [2, :on, "Just go to the most likely site", "o5", "r1"], - [0, :security, "Security", "", ""], - [1, :on, "Check for publisher's certificate revocation", "o5", ""], + [2, :on, "Just go to the most likely site", "o5", "r1"], + [0, :security, "Security", "", ""], + [1, :on, "Check for publisher's certificate revocation", "o5", ""], [1, :off, "Check for server certificate revocation (requires restart)", "o6", ""] ].each{|depth, setting, text, option, group| @@ -73,7 +73,7 @@ t.item_state_set(item, 'radio') end else - t.item_element_configure(item, 0, 'e1', + t.item_element_configure(item, 0, 'e1', :image=>@images["internet-#{setting}"]) end t.item_lastchild(parentList[depth], item) @@ -146,7 +146,7 @@ def demoInternetOptions_2(t) height = t.font.metrics(:linespace) + 2 height = 18 if height < 18 - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, :itemheight=>height, :selectmode=>:browse) init_pics('internet-*') @@ -154,9 +154,9 @@ t.column_configure(0, :text=>'Internet Options') t.element_create('e1', :image) - t.element_create('e2', :text, + t.element_create('e2', :text, :fill=>[@SystemHighlightText, ['selected', 'focus']]) - t.element_create('e3', :rect, :showfocus=>true, + t.element_create('e3', :rect, :showfocus=>true, :fill=>[@SystemHighlight, ['selected', 'focus']]) s = t.style_create('s1') @@ -168,18 +168,18 @@ parentList = [:root, '', '', '', '', '', ''] parent = :root [ - [0, :print, "Printing", "", ""], - [1, :off, "Print background colors and images", "o1", ""], - [0, :search, "Search from Address bar", "", ""], - [1, :search, "When searching", "", ""], - [2, :off, "Display results, and go to the most likely sites", - "o2", "r1"], - [2, :off, "Do not search from the Address bar", "o3", "r1"], - [2, :off, "Just display the results in the main window", + [0, :print, "Printing", "", ""], + [1, :off, "Print background colors and images", "o1", ""], + [0, :search, "Search from Address bar", "", ""], + [1, :search, "When searching", "", ""], + [2, :off, "Display results, and go to the most likely sites", + "o2", "r1"], + [2, :off, "Do not search from the Address bar", "o3", "r1"], + [2, :off, "Just display the results in the main window", "o4", "r1"], - [2, :on, "Just go to the most likely site", "o5", "r1"], - [0, :security, "Security", "", ""], - [1, :on, "Check for publisher's certificate revocation", "o5", ""], + [2, :on, "Just go to the most likely site", "o5", "r1"], + [0, :security, "Security", "", ""], + [1, :on, "Check for publisher's certificate revocation", "o5", ""], [1, :off, "Check for server certificate revocation (requires restart)", "o6", ""] ].each{|depth, setting, text, option, group| @@ -201,7 +201,7 @@ t.item_element_configure(item, 0, 'e1', :image=>img) end else - t.item_element_configure(item, 0, 'e1', + t.item_element_configure(item, 0, 'e1', :image=>@images["internet-#{setting}"]) end t.item_lastchild(parentList[depth], item) @@ -256,16 +256,16 @@ else setting = :on end - w.item_element_configure(item, 0, 'e1', + w.item_element_configure(item, 0, 'e1', :image=>@images["internet-check-#{setting}"]) @Option[:setting, item] = setting else # a radiobutton current = @Option[:current, group] return if current == item.to_s - w.item_element_configure(current, 0, 'e1', + w.item_element_configure(current, 0, 'e1', :image=>@images["internet-radio-off"]) - w.item_element_configure(item, 0, 'e1', + w.item_element_configure(item, 0, 'e1', :image=>@images["internet-radio-on"]) @Option[:setting, item] = :on @Option[:current, group] = item Index: ext/tk/sample/tkextlib/treectrl/bitmaps.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/bitmaps.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/bitmaps.rb (working copy) @@ -4,12 +4,12 @@ def demoBitmaps(t) #if $Version_1_1_OrLater if @has_bgimg - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, - :selectmode=>:browse, :orient=>:horizontal, :wrap=>'5 items', + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + :selectmode=>:browse, :orient=>:horizontal, :wrap=>'5 items', :showheader=>false, :backgroundimage=>@images['sky']) else - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, - :selectmode=>:browse, :orient=>:horizontal, :wrap=>'5 items', + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + :selectmode=>:browse, :orient=>:horizontal, :wrap=>'5 items', :showheader=>false) end @@ -19,15 +19,15 @@ t.column_configure(0, :itembackground=>['gray90', []]) end - t.element_create('elemTxt', :text, + t.element_create('elemTxt', :text, :fill=>[@SystemHighlightText, ['selected', 'focus']]) - t.element_create('elemSelTxt', :rect, :showfocus=>true, + t.element_create('elemSelTxt', :rect, :showfocus=>true, :fill=>[@SystemHighlight, ['selected', 'focus']]) - t.element_create('elemSelBmp', :rect, :outlinewidth=>4, + t.element_create('elemSelBmp', :rect, :outlinewidth=>4, :outline=>[@SystemHighlight, ['selected', 'focus']]) - t.element_create('elemBmp', :bitmap, - :foreground=>[@SystemHighlight, ['selected', 'focus']], - :background=>'linen', + t.element_create('elemBmp', :bitmap, + :foreground=>[@SystemHighlight, ['selected', 'focus']], + :background=>'linen', :bitmap=>['question' ['selected']]) s = t.style_create('STYLE', :orient=>:vertical) @@ -42,7 +42,7 @@ t.defaultstyle = [s] end - bitmap_names = %w(error gray75 gray50 gray25 gray12 + bitmap_names = %w(error gray75 gray50 gray25 gray12 hourglass info questhead question warning) bitmap_names.each{|name| @@ -60,15 +60,15 @@ t.item_style_set(i, 0, s) t.item_text(i, 0, name) if true - t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name, - :foreground=>['brown', ''], + t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name, + :foreground=>['brown', ''], :background=>['', '']) else - t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name, + t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name, :foreground=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'brown', [] - ], + ], :background=>['', []]) end t.item_lastchild(:root, i) Index: ext/tk/sample/tkextlib/treectrl/explorer.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/explorer.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/explorer.rb (working copy) @@ -49,44 +49,44 @@ height = t.font.metrics(:linespace) height = 18 if height < 18 - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, - :itemheight=>height, :selectmode=>:extended, - :xscrollincrement=>20, :scrollmargin=>16, + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + :itemheight=>height, :selectmode=>:extended, + :xscrollincrement=>20, :scrollmargin=>16, :xscrolldelay=>[500, 50], :yscrolldelay=>[500, 50]) init_pics('small-*') if $HasColumnCreate - t.column_create(:text=>'Name', :tag=>'name', + t.column_create(:text=>'Name', :tag=>'name', :width=>200, :arrow=>:up, :arrowpad=>6) - t.column_create(:text=>'Size', :tag=>'size', :justify=>:right, + t.column_create(:text=>'Size', :tag=>'size', :justify=>:right, :width=>60, :arrowside=>:left, :arrowgravity=>:right) t.column_create(:text=>'Type', :tag=>'type', :width=>120) t.column_create(:text=>'Modified', :tag=>'modified', :width=>130) else - t.column_configure(0, :text=>'Name', :tag=>'name', + t.column_configure(0, :text=>'Name', :tag=>'name', :width=>200, :arrow=>:up, :arrowpad=>6) - t.column_configure(1, :text=>'Size', :tag=>'size', :justify=>:right, + t.column_configure(1, :text=>'Size', :tag=>'size', :justify=>:right, :width=>60, :arrowside=>:left, :arrowgravity=>:right) t.column_configure(2, :text=>'Type', :tag=>'type', :width=>120) t.column_configure(3, :text=>'Modified', :tag=>'modified', :width=>130) end - t.element_create('e1', :image, + t.element_create('e1', :image, :image=>[ - @sel_images['small-folder'], ['selected'], + @sel_images['small-folder'], ['selected'], @images['small-folder'], [] ]) - t.element_create('e2', :text, :lines=>1, + t.element_create('e2', :text, :lines=>1, :fill=>[@SystemHighlightText, ['selected', 'focus']]) t.element_create('txtType', :text, :lines=>1) - t.element_create('txtSize', :text, :lines=>1, + t.element_create('txtSize', :text, :lines=>1, :datatype=>:integer, :format=>'%dKB') - t.element_create('txtDate', :text, :lines=>1, + t.element_create('txtDate', :text, :lines=>1, :datatype=>:time, :format=>'%d/%m/%y %I:%M %p') t.element_create('e4', :rect, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) @@ -116,23 +116,23 @@ @Priv[:sensitive, t] = [ ['name', 'styName', 'e1', 'e2'] ] @Priv[:dragimage, t] = [ ['name', 'styName', 'e1', 'e2'] ] - t.notify_bind(t, 'Edit-accept', + t.notify_bind(t, 'Edit-accept', proc{|w, i, tt| w.item_text(i, 0, tt)}, '%T %I %t') dir_proc = proc{|file| item = t.item_create t.item_style_set(item, 0, 'styName', 2, 'styType', 3, 'styDate') - t.item_complex(item, - [['e2', {:text=>File.basename(file)}]], - [], - [['txtType', {:text=>'Folder'}]], + t.item_complex(item, + [['e2', {:text=>File.basename(file)}]], + [], + [['txtType', {:text=>'Folder'}]], [['txtDate', {:data=>File.mtime(file).tv_sec}]]) t.item_lastchild(:root, item) } file_proc = proc{|file| item = t.item_create - t.item_style_set(item, 0, 'styName', 1, 'stySize', + t.item_style_set(item, 0, 'styName', 1, 'stySize', 2, 'styType', 3, 'styDate') ext = File.extname(file) @@ -151,14 +151,14 @@ type = type[1..-1] << ' ' unless type.empty? type << 'File' - t.item_complex(item, - [ - ['e1', {:image=>[@sel_images[img], ['selected'], + t.item_complex(item, + [ + ['e1', {:image=>[@sel_images[img], ['selected'], @images[img], []]}], ['e2', {:text=>File.basename(file)}] - ], - [ ['txtSize', {:data=>File.size(file)/1024 + 1}] ], - [ ['txtType', {:text=>type}] ], + ], + [ ['txtSize', {:data=>File.size(file)/1024 + 1}] ], + [ ['txtType', {:text=>type}] ], [ ['txtDate', {:data=>File.mtime(file).tv_sec}] ] ) t.item_lastchild(:root, item) @@ -167,7 +167,7 @@ demoExplorerAux(t, dir_proc, file_proc) @SortColumn = 0 - t.notify_bind(t, 'Header-invoke', + t.notify_bind(t, 'Header-invoke', proc{|w, c| explorerHeaderInvoke(t, w, c)}, '%T %C') t.bindtags = [ t, 'TreeCtrlFileList', Tk::TreeCtrl, t.winfo_toplevel, :all ] @@ -200,37 +200,37 @@ case t.column_cget(c, :tag) when 'name' if dirCount > 0 - t.item_sort(:root, order, {:last=>"root child #{lastDir}"}, + t.item_sort(:root, order, {:last=>"root child #{lastDir}"}, {:column=>c, :dictionary=>true}) end if dirCount < t.numitems - 1 - t.item_sort(:root, order, {:first=>"root child #{dirCount}"}, + t.item_sort(:root, order, {:first=>"root child #{dirCount}"}, {:column=>c, :dictionary=>true}) end when 'size' if dirCount < t.numitems - 1 - t.item_sort(:root, order, {:first=>"root child #{dirCount}"}, - {:column=>c, :integer=>true}, + t.item_sort(:root, order, {:first=>"root child #{dirCount}"}, + {:column=>c, :integer=>true}, {:column=>'name', :dictionary=>true}) end when 'type' if dirCount < t.numitems - 1 - t.item_sort(:root, order, {:first=>"root child #{dirCount}"}, - {:column=>c, :dictionary=>true}, + t.item_sort(:root, order, {:first=>"root child #{dirCount}"}, + {:column=>c, :dictionary=>true}, {:column=>'name', :dictionary=>true}) end when 'modified' if dirCount > 0 - t.item_sort(:root, order, {:last=>"root child #{lastDir}"}, - {:column=>c, :integer=>true}, + t.item_sort(:root, order, {:last=>"root child #{lastDir}"}, + {:column=>c, :integer=>true}, {:column=>'name', :dictionary=>true}) end if dirCount < t.numitems - 1 - t.item_sort(:root, order, {:first=>"root child #{dirCount}"}, - {:column=>c, :integer=>true}, + t.item_sort(:root, order, {:first=>"root child #{dirCount}"}, + {:column=>c, :integer=>true}, {:column=>'name', :dictionary=>true}) end @@ -241,9 +241,9 @@ # Item height is 32 for icon, 4 padding, 3 lines of text itemHeight = 32 + 4 + t.font.metrics(:linespace) * 3 - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, - :selectmode=>:extended, :wrap=>:window, :orient=>:horizontal, - :itemheight=>itemHeight, :showheader=>false, :scrollmargin=>16, + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + :selectmode=>:extended, :wrap=>:window, :orient=>:horizontal, + :itemheight=>itemHeight, :showheader=>false, :scrollmargin=>16, :xscrolldelay=>[500, 50], :yscrolldelay=>[500, 50]) init_pics('big-*') @@ -254,17 +254,17 @@ t.column_configure(0, :width=>75) end - t.element_create('elemImg', :image, + t.element_create('elemImg', :image, :image=>[ - @sel_images['big-folder'], ['selected'], + @sel_images['big-folder'], ['selected'], @images['big-folder'], [] ]) - t.element_create('elemTxt', :text, :justify=>:center, - :lines=>1, :width=>71, :wrap=>:word, + t.element_create('elemTxt', :text, :justify=>:center, + :lines=>1, :width=>71, :wrap=>:word, :fill=>[@SystemHighlightText, ['selected', 'focus']]) - t.element_create('elemSel', :rect, :showfocus=>true, + t.element_create('elemSel', :rect, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected'] ]) @@ -272,7 +272,7 @@ s = t.style_create('STYLE', :orient=>:vertical) t.style_elements(s, ['elemSel', 'elemImg', 'elemTxt']) t.style_layout(s, 'elemImg', :expand=>:we) - t.style_layout(s, 'elemTxt', + t.style_layout(s, 'elemTxt', :pady=>[4,0], :padx=>2, :squeeze=>:x, :expand=>:we) t.style_layout(s, 'elemSel', :union=>['elemTxt']) @@ -280,7 +280,7 @@ @Priv[:sensitive, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ] @Priv[:dragimage, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ] - t.notify_bind(t, 'Edit-accept', + t.notify_bind(t, 'Edit-accept', proc{|w, i, tt| w.item_text(i, 0, tt)}, '%T %I %t') dir_proc = proc{|file| @@ -310,9 +310,9 @@ type = type[1..-1] << ' ' unless type.empty? type << 'File' - t.item_complex(item, - [ - ['elemImg', {:image=>[@sel_images[img], ['selected'], + t.item_complex(item, + [ + ['elemImg', {:image=>[@sel_images[img], ['selected'], @images[img], []]}], ['elemTxt', {:text=>File.basename(file)}] ]) @@ -323,7 +323,7 @@ t.activate(t.index('root firstchild')) - t.notify_bind(t, 'ActiveItem', + t.notify_bind(t, 'ActiveItem', proc{|w, a, c| w.item_element_configure(a, 0, 'elemTxt', :lines=>'') w.item_element_configure(c, 0, 'elemTxt', :lines=>3) @@ -346,9 +346,9 @@ height = t.font.metrics(:linespace) + 2 height = 18 if height < 18 - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, - :itemheight=>height, :selectmode=>:extended, :wrap=>:window, - :showheader=>false, :scrollmargin=>16, + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + :itemheight=>height, :selectmode=>:extended, :wrap=>:window, + :showheader=>false, :scrollmargin=>16, :xscrolldelay=>[500, 50], :yscrolldelay=>[500, 50]) init_pics('small-*') @@ -359,16 +359,16 @@ t.column_configure(0, :widthhack=>true) end - t.element_create('elemImg', :image, + t.element_create('elemImg', :image, :image=>[ - @sel_images['small-folder'], ['selected'], + @sel_images['small-folder'], ['selected'], @images['small-folder'], [] ]) - t.element_create('elemTxt', :text, :lines=>1, + t.element_create('elemTxt', :text, :lines=>1, :fill=>[@SystemHighlightText, ['selected', 'focus']]) - t.element_create('elemSel', :rect, :showfocus=>true, + t.element_create('elemSel', :rect, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) @@ -383,7 +383,7 @@ @Priv[:sensitive, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ] @Priv[:dragimage, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ] - t.notify_bind(t, 'Edit-accept', + t.notify_bind(t, 'Edit-accept', proc{|w, i, tt| w.item_text(i, 0, tt)}, '%T %I %t') dir_proc = proc{|file| @@ -413,9 +413,9 @@ type = type[1..-1] << ' ' unless type.empty? type << 'File' - t.item_complex(item, - [ - ['elemImg', {:image=>[@sel_images[img], ['selected'], + t.item_complex(item, + [ + ['elemImg', {:image=>[@sel_images[img], ['selected'], @images[img], []]}], ['elemTxt', {:text=>File.basename(file)}] ]) Index: ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb (working copy) @@ -6,7 +6,7 @@ height = t.font.metrics(:linespace) height = 18 if height < 18 - t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false, + t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false, :showroot=>false, :showrootbutton=>false, :showbuttons=>true) if $Version_1_1_OrLater @@ -24,7 +24,7 @@ t.column_configure(3, :text=>'Subject', :width=>250, :tag=>'subject') t.column_configure(4, :text=>'From', :width=>150, :tag=>'from') t.column_configure(5, :text=>'Sent', :width=>150, :tag=>'sent') - t.column_configure(6, :text=>'Size', :width=>60, :justify=>:right, + t.column_configure(6, :text=>'Size', :width=>60, :justify=>:right, :tag=>'size') end @@ -37,35 +37,35 @@ # State for a message with unread descendants t.state_define('unread') - t.element_create('elemImg', :image, + t.element_create('elemImg', :image, :image=>[ - @sel_images['outlook-read-2'], - ['selected', 'read', 'unread', '!open'], + @sel_images['outlook-read-2'], + ['selected', 'read', 'unread', '!open'], @images['outlook-read-2'], ['read', 'unread', '!open'], - @sel_images['outlook-read'], ['selected', 'read'], - @images['outlook-read'], ['read'], - @sel_images['outlook-unread'], ['selected'], + @sel_images['outlook-read'], ['selected', 'read'], + @images['outlook-read'], ['read'], + @sel_images['outlook-unread'], ['selected'], @images['outlook-unread'], [] ]) - t.element_create('elemTxt', :text, :lines=>1, - :fill=>[@SystemHighlightText, ['selected', 'focus']], + t.element_create('elemTxt', :text, :lines=>1, + :fill=>[@SystemHighlightText, ['selected', 'focus']], :font=>[ - t.font.dup.weight(:bold), ['read', 'unread', '!open'], + t.font.dup.weight(:bold), ['read', 'unread', '!open'], t.font.dup.weight(:bold), ['!read'] ]) - t.element_create('sel.e', :rect, :open=>:e, :showfocus=>true, + t.element_create('sel.e', :rect, :open=>:e, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) - t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true, + t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) - t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true, + t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) @@ -74,7 +74,7 @@ t.style_elements(s, ['sel.e', 'elemImg', 'elemTxt']) t.style_layout(s, 'elemImg', :expand=>:ns) t.style_layout(s, 'elemTxt', :padx=>[2,6], :squeeze=>:x, :expand=>:ns) - t.style_layout(s, 'sel.e', :union=>['elemTxt'], + t.style_layout(s, 'sel.e', :union=>['elemTxt'], :iexpand=>:nes, :ipadx=>[2,0]) # Text @@ -168,12 +168,12 @@ } # Do something when the selection changes - t.notify_bind(t, 'Selection', + t.notify_bind(t, 'Selection', proc{|w| if w.selection_count == 1 # One item is selected if @Message[:afterId][:id] - Tk.after_cancel(@Message[:afterId][:id]) + Tk.after_cancel(@Message[:afterId][:id]) end @Message[:afterId][:item] = w.selection_get[0] @Message[:afterId][:id] = Tk.after(500, proc{ @@ -208,7 +208,7 @@ height = t.font.metrics(:linespace) height = 18 if height < 18 - t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false, + t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false, :showroot=>false, :showrootbutton=>false, :showbuttons=>true) if $Version_1_1_OrLater @@ -226,7 +226,7 @@ t.column_configure(3, :text=>'Subject', :width=>250, :tag=>'subject') t.column_configure(4, :text=>'From', :width=>150, :tag=>'from') t.column_configure(5, :text=>'Sent', :width=>150, :tag=>'sent') - t.column_configure(6, :text=>'Size', :width=>60, :justify=>:right, + t.column_configure(6, :text=>'Size', :width=>60, :justify=>:right, :tag=>'size') end @@ -235,24 +235,24 @@ t.element_create('image.unread', :image, :image=>@images['outlook-unread']) t.element_create('image.read', :image, :image=>@images['outlook-read']) t.element_create('image.read2', :image, :image=>@images['outlook-read-2']) - t.element_create('text.read', :text, :lines=>1, + t.element_create('text.read', :text, :lines=>1, :fill=>[@SystemHighlightText, ['selected', 'focus']]) - t.element_create('text.unread', :text, :lines=>1, - :fill=>[@SystemHighlightText, ['selected', 'focus']], + t.element_create('text.unread', :text, :lines=>1, + :fill=>[@SystemHighlightText, ['selected', 'focus']], :font=>t.font.dup.weight(:bold)) - t.element_create('sel.e', :rect, :open=>:e, :showfocus=>true, + t.element_create('sel.e', :rect, :open=>:e, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) - t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true, + t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) - t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true, + t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) @@ -261,7 +261,7 @@ t.style_elements(s, ['sel.e', 'image.unread', 'text.unread']) t.style_layout(s, 'image.unread', :expand=>:ns) t.style_layout(s, 'text.unread', :padx=>[2,6], :squeeze=>:x, :expand=>:ns) - t.style_layout(s, 'sel.e', :union=>['text.unread'], + t.style_layout(s, 'sel.e', :union=>['text.unread'], :iexpand=>:nes, :ipadx=>[2,0]) # Image + text @@ -269,7 +269,7 @@ t.style_elements(s, ['sel.e', 'image.read', 'text.read']) t.style_layout(s, 'image.read', :expand=>:ns) t.style_layout(s, 'text.read', :padx=>[2,6], :squeeze=>:x, :expand=>:ns) - t.style_layout(s, 'sel.e', :union=>['text.read'], + t.style_layout(s, 'sel.e', :union=>['text.read'], :iexpand=>:nes, :ipadx=>[2,0]) # Image + text @@ -277,7 +277,7 @@ t.style_elements(s, ['sel.e', 'image.read2', 'text.unread']) t.style_layout(s, 'image.read2', :expand=>:ns) t.style_layout(s, 'text.unread', :padx=>[2,6], :squeeze=>:x, :expand=>:ns) - t.style_layout(s, 'sel.e', :union=>['text.unread'], + t.style_layout(s, 'sel.e', :union=>['text.unread'], :iexpand=>:nes, :ipadx=>[2,0]) # Text @@ -350,7 +350,7 @@ style = 'unread' style2 = 'unread2' end - t.item_style_set(i, 3, style, 4, "#{style2}.we", 5, "#{style2}.we", + t.item_style_set(i, 3, style, 4, "#{style2}.we", 5, "#{style2}.we", 6, "#{style2}.w") t.item_text(i, 3, subject, 4, from, 5, sent, 6, size) if t.item_numchildren(i) > 0 @@ -359,24 +359,24 @@ } # Do something when the selection changes - t.notify_bind(t, 'Selection', + t.notify_bind(t, 'Selection', proc{|w| if w.selection_count == 1 i = t.selection_get[0] unless @Message[:read][i] if t.item_isopen(i) || !anyUnreadDescendants(t, i) # unread -> read - t.item_style_map(i, 'subject', 'read', + t.item_style_map(i, 'subject', 'read', ['text.unread', 'text.read']) - t.item_style_map(i, 'from', 'read.we', + t.item_style_map(i, 'from', 'read.we', ['text.unread', 'text.read']) - t.item_style_map(i, 'sent', 'read.we', + t.item_style_map(i, 'sent', 'read.we', ['text.unread', 'text.read']) - t.item_style_map(i, 'size', 'read.w', + t.item_style_map(i, 'size', 'read.w', ['text.unread', 'text.read']) else # unread -> read2 - t.item_style_map(i, 'subject', 'read2', + t.item_style_map(i, 'subject', 'read2', ['text.unread', 'text.unread']) end @@ -386,34 +386,34 @@ end }, '%T') - t.notify_bind(t, 'Expand-after', + t.notify_bind(t, 'Expand-after', proc{|w, i| if @Messge[:read][i] && anyUnreadDescendants(t, i) # read2 -> read - t.item_style_map(i, 'subject', 'read', + t.item_style_map(i, 'subject', 'read', ['text.unread', 'text.read']) # unread -> read - t.item_style_map(i, 'from', 'read.we', + t.item_style_map(i, 'from', 'read.we', ['text.unread', 'text.read']) - t.item_style_map(i, 'sent', 'read.we', + t.item_style_map(i, 'sent', 'read.we', ['text.unread', 'text.read']) - t.item_style_map(i, 'size', 'read.w', + t.item_style_map(i, 'size', 'read.w', ['text.unread', 'text.read']) end }, '%T %I') - t.notify_bind(t, 'Collapse-after', + t.notify_bind(t, 'Collapse-after', proc{|w, i| if @Messge[:read][i] && anyUnreadDescendants(t, i) # read -> read2 - t.item_style_map(i, 'subject', 'read2', + t.item_style_map(i, 'subject', 'read2', ['text.read', 'text.unread']) # read -> unread - t.item_style_map(i, 'from', 'unread.we', + t.item_style_map(i, 'from', 'unread.we', ['text.read', 'text.unread']) - t.item_style_map(i, 'sent', 'unread.we', + t.item_style_map(i, 'sent', 'unread.we', ['text.read', 'text.unread']) - t.item_style_map(i, 'size', 'unread.w', + t.item_style_map(i, 'size', 'unread.w', ['text.read', 'text.unread']) end }, '%T %I') Index: ext/tk/sample/tkextlib/treectrl/random.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/random.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/random.rb (working copy) @@ -1,4 +1,4 @@ -# +# def random_N @RandomN[0] || 500 end @@ -11,39 +11,39 @@ height = t.font.metrics(:linespace) height = 18 if height < 18 - t.configure(:itemheight=>height, :selectmode=>:extended, - :showroot=>true, :showrootbutton=>true, :showbuttons=>true, - :showlines=>true, :scrollmargin=>16, + t.configure(:itemheight=>height, :selectmode=>:extended, + :showroot=>true, :showrootbutton=>true, :showbuttons=>true, + :showlines=>true, :scrollmargin=>16, :xscrolldelay=>[500, 50], :yscrolldelay=>[500, 50]) if $Version_1_1_OrLater - t.column_create(:expand=>true, :text=>'Item', + t.column_create(:expand=>true, :text=>'Item', :itembackground=>['#e0e8f0', []], :tag=>'item') - t.column_create(:text=>'Parent', :justify=>:center, + t.column_create(:text=>'Parent', :justify=>:center, :itembackground=>['gray90', []], :tag=>'parent') - t.column_create(:text=>'Depth', :justify=>:center, + t.column_create(:text=>'Depth', :justify=>:center, :itembackground=>['linen', []], :tag=>'depth') else # TreeCtrl 1.0 - t.column_configure(0, :expand=>true, :text=>'Item', + t.column_configure(0, :expand=>true, :text=>'Item', :itembackground=>['#e0e8f0', []], :tag=>'item') - t.column_configure(1, :text=>'Parent', :justify=>:center, + t.column_configure(1, :text=>'Parent', :justify=>:center, :itembackground=>['gray90', []], :tag=>'parent') - t.column_configure(2, :text=>'Depth', :justify=>:center, + t.column_configure(2, :text=>'Depth', :justify=>:center, :itembackground=>['linen', []], :tag=>'depth') end t.element_create('e1', :image, :image=>[ - @images['folder-open'], ['open'], + @images['folder-open'], ['open'], @images['folder-closed'], [] ]) t.element_create('e2', :image, :image=>@images['small-file']) - t.element_create('e3', :text, + t.element_create('e3', :text, :fill=>[@SystemHighlightText, ['selected', 'focus']]) t.element_create('e4', :text, :fill=>'blue') t.element_create('e6', :text) - t.element_create('e5', :rect, :showfocus=>true, + t.element_create('e5', :rect, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) @@ -65,11 +65,11 @@ t.style_layout(s, 'e6', :padx=>6, :expand=>:ns) @Priv[:sensitive, t] = [ - [:item, 's1', 'e5', 'e1', 'e3'], + [:item, 's1', 'e5', 'e1', 'e3'], [:item, 's2', 'e5', 'e2', 'e3'] ] @Priv[:dragimage, t] = [ - [:item, 's1', 'e1', 'e3'], + [:item, 's1', 'e1', 'e3'], [:item, 's2', 'e2', 'e3'] ] @@ -108,16 +108,16 @@ t.item_hasbutton(item_i, true) end t.item_style_set(item_i, 0, 's1', 1, 's3', 2, 's3') - t.item_complex(item_i, - [ ['e3', {:text=>"Item #{i}"}], - ['e4', {:text=>"(#{numChildren})"}] ], - [ ['e6', {:text=>"#{t.item_parent(item_i)}"}] ], + t.item_complex(item_i, + [ ['e3', {:text=>"Item #{i}"}], + ['e4', {:text=>"(#{numChildren})"}] ], + [ ['e6', {:text=>"#{t.item_parent(item_i)}"}] ], [ ['e6', {:text=>"#{t.depth(item_i)}"}] ]) else t.item_style_set(item_i, 1, 's3', 2, 's3', 0, 's2') - t.item_complex(item_i, - [ ['e3', {:text=>"Item #{i}"}] ], - [ ['e6', {:text=>"#{t.item_parent(item_i)}"}] ], + t.item_complex(item_i, + [ ['e3', {:text=>"Item #{i}"}] ], + [ ['e6', {:text=>"#{t.item_parent(item_i)}"}] ], [ ['e6', {:text=>"#{t.depth(item_i)}"}] ]) end } @@ -125,46 +125,46 @@ treeCtrlRandom = TkBindTag.new - treeCtrlRandom.bind('Double-ButtonPress-1', + treeCtrlRandom.bind('Double-ButtonPress-1', proc{|w, x, y| Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlRandom.bind('Control-ButtonPress-1', + treeCtrlRandom.bind('Control-ButtonPress-1', proc{|w, x, y| @Priv['selectMode'] = :toggle randomButton1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlRandom.bind('Shift-ButtonPress-1', + treeCtrlRandom.bind('Shift-ButtonPress-1', proc{|w, x, y| @Priv['selectMode'] = :add randomButton1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlRandom.bind('ButtonPress-1', + treeCtrlRandom.bind('ButtonPress-1', proc{|w, x, y| @Priv['selectMode'] = :set randomButton1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlRandom.bind('Button1-Motion', + treeCtrlRandom.bind('Button1-Motion', proc{|w, x, y| randomMotion1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlRandom.bind('Button1-Leave', + treeCtrlRandom.bind('Button1-Leave', proc{|w, x, y| randomLeave1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlRandom.bind('ButtonRelease-1', + treeCtrlRandom.bind('ButtonRelease-1', proc{|w, x, y| randomRelease1(w, x, y) Tk.callback_break @@ -363,7 +363,7 @@ t.selection_modify('', @Priv[:drop]) t[:cursor] = '' if @Priv[:drop] != '' - randomDrop(t, @Priv[:drop], @Priv.list_element(:selection), + randomDrop(t, @Priv[:drop], @Priv.list_element(:selection), @Priv[:drop, :pos]) end end @@ -479,7 +479,7 @@ when 'drag', 'marquee' randomMotion(t, x, y) end - @Priv[:autoscan, :afterId, t] = + @Priv[:autoscan, :afterId, t] = Tk.after(delay, proc{ randomAutoScanCheckAux(t) }) end return @@ -502,7 +502,7 @@ init_pics('mac-*') - t.configure(:openbuttonimage=>@images['mac-collapse'], - :closedbuttonimage=>@images['mac-expand'], + t.configure(:openbuttonimage=>@images['mac-collapse'], + :closedbuttonimage=>@images['mac-expand'], :showlines=>false) end Index: ext/tk/sample/tkextlib/treectrl/demo.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/demo.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/demo.rb (working copy) @@ -76,7 +76,7 @@ #################### - @tree2.bind('ButtonPress-3', + @tree2.bind('ButtonPress-3', proc{|w, x, y, rootx, rooty| show_list_popup(w, x, y, rootx, rooty) }, '%W %x %y %X %Y') @@ -94,7 +94,7 @@ #################### - @tree1.notify_bind(@tree1, 'Selection', + @tree1.notify_bind(@tree1, 'Selection', proc{|c, t| if c == 1 item = t.selection_get[0] @@ -102,10 +102,10 @@ end }, '%c %T') - # When one item is selected in the demo list, display the styles in + # When one item is selected in the demo list, display the styles in # that item. # See DemoClear for why the tag "DontDelete" is used - @tree2.notify_bind('DontDelete', 'Selection', + @tree2.notify_bind('DontDelete', 'Selection', proc{|c, t| display_styles_in_item(t.selection_get[0]) if c == 1 }, '%c %T') @@ -156,15 +156,13 @@ @src_top = TkToplevel.new f = TkFrame.new(@src_top, :borderwidth=>0) case @thisPlatform - when 'macintosh', 'macos' - font = TkFont.new(['Geneva', 9]) when 'unix' font = TkFont.new(['Courier', -12]) else font = TkFont.new(['Courier', 9]) end - @src_txt = TkText.new(f, :font=>font, :tabs=>font.measure('1234'), + @src_txt = TkText.new(f, :font=>font, :tabs=>font.measure('1234'), :wrap=>:none) xscr = @src_txt.xscrollbar(TkScrollbar.new(f)) yscr = @src_txt.yscrollbar(TkScrollbar.new(f)) @@ -198,10 +196,6 @@ def tree_plus_scrollbars_in_a_frame(parent, h, v) f = TkFrame.new(parent, :borderwidth=>1, :relief=>:sunken) case @thisPlatform - when 'macintosh' - font = TkFont.new(['Geneva', 9]) - when 'macos' - font = TkFont.new(['Lucida Grande', 11]) when 'unix' font = TkFont.new(['Helvetica', -12]) else @@ -210,23 +204,23 @@ font = TkFont.new(['MS Sans', 8]) end - tree = Tk::TreeCtrl.new(f, :highlightthickness=>0, + tree = Tk::TreeCtrl.new(f, :highlightthickness=>0, :borderwidth=>0, :font=>font) tree[:xscrollincrement] = 20 tree.debug_configure(:enable=>false, :display=>false) if h - h_scr = TkScrollbar.new(f, :orient=>:horizontal, + h_scr = TkScrollbar.new(f, :orient=>:horizontal, :command=>proc{|*args| tree.xview(*args)}) - tree.notify_bind(h_scr, 'Scroll-x', + tree.notify_bind(h_scr, 'Scroll-x', proc{|w, l, u| w.set(l, u)}, '%W %l %u') h_scr.bind('ButtonPress-1', proc{tree.set_focus}) end if v - v_scr = TkScrollbar.new(f, :orient=>:vertical, + v_scr = TkScrollbar.new(f, :orient=>:vertical, :command=>proc{|*args| tree.yview(*args)}) - tree.notify_bind(v_scr, 'Scroll-y', + tree.notify_bind(v_scr, 'Scroll-y', proc{|w, l, u| w.set(l, u)}, '%W %l %u') v_scr.bind('ButtonPress-1', proc{tree.set_focus}) end @@ -244,7 +238,7 @@ Tk.root.title('Tk::TreeCtrl Demo') case @thisPlatform - when 'macintosh', 'macosx' + when 'macosx' Tk.root.geometry('+40+40') else Tk.root.geometry('+0+30') @@ -255,13 +249,13 @@ # Tree + scrollbar: demos f1, @tree1 = tree_plus_scrollbars_in_a_frame(nil, false, true) - @tree1.configure(:showbuttons=>false, :showlines=>:false, + @tree1.configure(:showbuttons=>false, :showlines=>:false, :showroot=>false, :height=>100) if $HasColumnCreate - @tree1.column_create(:text=>'List of Demos', + @tree1.column_create(:text=>'List of Demos', :expand=>true, :button=>false) else - @tree1.column_configure(0, :text=>'List of Demos', + @tree1.column_configure(0, :text=>'List of Demos', :expand=>true, :button=>false) end @@ -269,10 +263,10 @@ f4, @tree4 = tree_plus_scrollbars_in_a_frame(nil, false, true) @tree4.configure(:showroot=>false, :height=>140) if $HasColumnCreate - @tree4.column_create(:text=>'Elements and Styles', + @tree4.column_create(:text=>'Elements and Styles', :expand=>true, :button=>false) else - @tree4.column_configure(0, :text=>'Elements and Styles', + @tree4.column_configure(0, :text=>'Elements and Styles', :expand=>true, :button=>false) end @@ -280,10 +274,10 @@ f3, @tree3 = tree_plus_scrollbars_in_a_frame(nil, false, true) @tree3.configure(:showroot=>false) if $HasColumnCreate - @tree3.column_create(:text=>'Styles in Item', + @tree3.column_create(:text=>'Styles in Item', :expand=>true, :button=>false) else - @tree3.column_configure(0, :text=>'Styles in Item', + @tree3.column_configure(0, :text=>'Styles in Item', :expand=>true, :button=>false) end @@ -296,7 +290,7 @@ # Tree + scrollbars f2, @tree2 = tree_plus_scrollbars_in_a_frame(f2_base, true, true) @tree2.configure(:indent=>19) - @tree2.debug_configure(:enable=>false, :display=>true, + @tree2.debug_configure(:enable=>false, :display=>true, :erasecolor=>'pink', :displaydelay=>30) # Give it a big border to debug drawing @@ -349,7 +343,7 @@ @popup[:show] = Hash.new{|h, k| h[k] = TkVariable.new} menuspec = [ - [ 'Collapse', [], nil, '', {:menu_config=>{:tearoff=>false}} ], + [ 'Collapse', [], nil, '', {:menu_config=>{:tearoff=>false}} ], [ 'Expand', [], nil, '', {:menu_config=>{:tearoff=>false}} ] ] @@ -357,61 +351,61 @@ # if $Version_1_1_OrLater if @has_bgimg menuspec << \ - [ 'Background Image', + [ 'Background Image', [ - [ 'none', [@popup[:bgimg], 'none'], nil, '', - {:command=>proc{@tree2.backgroundimage = ''}} ], - [ 'sky', [@popup[:bgimg], 'sky'], nil, '', + [ 'none', [@popup[:bgimg], 'none'], nil, '', + {:command=>proc{@tree2.backgroundimage = ''}} ], + [ 'sky', [@popup[:bgimg], 'sky'], nil, '', {:command=>proc{ @tree2.backgroundimage = @images[@popup[:bgimg].value]}} ] - ], + ], nil, '', {:menu_config=>{:tearoff=>false}} ] end menuspec.concat([ - [ 'Background Mode', + [ 'Background Mode', %w(column index row visindex).collect{|val| - [ val, [@popup[:bgmode], val] , nil, '', + [ val, [@popup[:bgmode], val] , nil, '', {:command=>proc{@tree2.backgroundmode = @popup[:bgmode].value}} ] - }, + }, nil, '', {:menu_config=>{:tearoff=>false}} ], - [ 'Debug', + [ 'Debug', [ - [ 'Data', @popup[:debug][:data], nil, '', + [ 'Data', @popup[:debug][:data], nil, '', {:command=>proc{ @tree2.debug_configure(:data=>@popup[:debug][:data].value) } - } ], - [ 'Display', @popup[:debug][:display], nil, '', + } ], + [ 'Display', @popup[:debug][:display], nil, '', {:command=>proc{ @tree2.debug_configure(:display=>@popup[:debug][:display].value) } - } ], - [ 'Enable', @popup[:debug][:enable], nil, '', + } ], + [ 'Enable', @popup[:debug][:enable], nil, '', {:command=>proc{ @tree2.debug_configure(:enable=>@popup[:debug][:enable].value) } } ] - ], + ], nil, '', {:menu_config=>{:tearoff=>false}} ], - [ 'Buffering', + [ 'Buffering', [ - [ 'none', [@popup[:doublebuffer], 'none'], nil, '', + [ 'none', [@popup[:doublebuffer], 'none'], nil, '', {:command=>proc{ @tree2.doublebuffer = @popup[:doublebuffer].value } - } ], - [ 'item', [@popup[:doublebuffer], 'item'], nil, '', + } ], + [ 'item', [@popup[:doublebuffer], 'item'], nil, '', {:command=>proc{ @tree2.doublebuffer = @popup[:doublebuffer].value } - } ], - [ 'window', [@popup[:doublebuffer], 'window'], nil, '', + } ], + [ 'window', [@popup[:doublebuffer], 'window'], nil, '', {:command=>proc{ @tree2.doublebuffer = @popup[:doublebuffer].value } @@ -420,62 +414,62 @@ nil, '', {:menu_config=>{:tearoff=>false}} ], - [ 'Line style', + [ 'Line style', [ - [ 'dot', [@popup[:linestyle], 'dot'], nil, '', - {:command=>proc{@tree2.linestyle = @popup[:linestyle].value}} ], - [ 'solid', [@popup[:linestyle], 'solid'], nil, '', + [ 'dot', [@popup[:linestyle], 'dot'], nil, '', + {:command=>proc{@tree2.linestyle = @popup[:linestyle].value}} ], + [ 'solid', [@popup[:linestyle], 'solid'], nil, '', {:command=>proc{@tree2.linestyle = @popup[:linestyle].value}} ] - ], + ], nil, '', {:menu_config=>{:tearoff=>false}} ], - [ 'Orient', + [ 'Orient', [ - [ 'Horizontal', [@popup[:orient], 'horizontal'], nil, '', - {:command=>proc{@tree2.orient = @popup[:orient].value}} ], - [ 'Vertical', [@popup[:orient], 'vertical'], nil, '', + [ 'Horizontal', [@popup[:orient], 'horizontal'], nil, '', + {:command=>proc{@tree2.orient = @popup[:orient].value}} ], + [ 'Vertical', [@popup[:orient], 'vertical'], nil, '', {:command=>proc{@tree2.orient = @popup[:orient].value}} ] - ], + ], nil, '', {:menu_config=>{:tearoff=>false}} ], - [ 'Selectmode', + [ 'Selectmode', %w(list browse extended multiple single).collect{|val| - [ val, [@popup[:selectmode], val] , nil, '', + [ val, [@popup[:selectmode], val] , nil, '', {:command=>proc{@tree2.selectmode = @popup[:selectmode].value}} ] - }, + }, nil, '', {:menu_config=>{:tearoff=>false}} ], - [ 'Show', + [ 'Show', [ - [ 'Buttons', @popup[:show][:buttons], nil, '', + [ 'Buttons', @popup[:show][:buttons], nil, '', {:command=>proc{ @tree2.showbuttons = @popup[:show][:buttons].value } - } ], - [ 'Header', @popup[:show][:header], nil, '', + } ], + [ 'Header', @popup[:show][:header], nil, '', {:command=>proc{ @tree2.showheader = @popup[:show][:header].value } - } ], - [ 'Lines', @popup[:show][:lines], nil, '', + } ], + [ 'Lines', @popup[:show][:lines], nil, '', {:command=>proc{ @tree2.showlines = @popup[:show][:lines].value } - } ], - [ 'Root', @popup[:show][:root], nil, '', + } ], + [ 'Root', @popup[:show][:root], nil, '', {:command=>proc{ @tree2.showroot = @popup[:show][:root].value } - } ], - [ 'Root Button', @popup[:show][:rootbutton], nil, '', + } ], + [ 'Root Button', @popup[:show][:rootbutton], nil, '', {:command=>proc{ @tree2.showrootbutton = @popup[:show][:rootbutton].value } } ] - ], + ], nil, '', {:menu_config=>{:tearoff=>false}} ], @@ -515,14 +509,14 @@ if id[0] == 'item' item = id[1] if $Version_1_1_OrLater - m.add_command(:label=>"Item #{item}", + m.add_command(:label=>"Item #{item}", :command=>proc{w.item_collapse(item)}) - m.add_command(:label=>"Item #{item} (recurse)", + m.add_command(:label=>"Item #{item} (recurse)", :command=>proc{w.item_collapse_recurse(item)}) else - m.add_command(:label=>"Item #{item}", + m.add_command(:label=>"Item #{item}", :command=>proc{w.collapse(item)}) - m.add_command(:label=>"Item #{item} (recurse)", + m.add_command(:label=>"Item #{item} (recurse)", :command=>proc{w.collapse_recurse(item)}) end end @@ -539,14 +533,14 @@ if id[0] == 'item' item = id[1] if $Version_1_1_OrLater - m.add_command(:label=>"Item #{item}", + m.add_command(:label=>"Item #{item}", :command=>proc{w.item_expand(item)}) - m.add_command(:label=>"Item #{item} (recurse)", + m.add_command(:label=>"Item #{item} (recurse)", :command=>proc{w.item_expand_recurse(item)}) else - m.add_command(:label=>"Item #{item}", + m.add_command(:label=>"Item #{item}", :command=>proc{w.expand(item)}) - m.add_command(:label=>"Item #{item} (recurse)", + m.add_command(:label=>"Item #{item} (recurse)", :command=>proc{w.expand_recurse(item)}) end end @@ -578,8 +572,8 @@ txt = w.column_cget(i, :text) img_name = w.column_cget(i, :image) img_name = @images.key(img_name) if img_name.kind_of?(TkImage) - m.add_checkbutton(:variable=>@popup[:visible][i], - :label=>"Column #{i} \"#{txt}\" [#{img_name}]", + m.add_checkbutton(:variable=>@popup[:visible][i], + :label=>"Column #{i} \"#{txt}\" [#{img_name}]", :command=>proc{w.column_configure(i, :visible=>@popup[:visible][i].value)}) } @@ -596,90 +590,90 @@ @popup[:justify] = TkVariable.new menuspec = [ - [ 'Arrow', + [ 'Arrow', [ - [ 'None', [@popup[:arrow], 'none'], nil, '', + [ 'None', [@popup[:arrow], 'none'], nil, '', {:command=>proc{ @tree2.column_configure(@popup[:column].value, :arrow=>:none) } } ], - [ 'Up', [@popup[:arrow], 'up'], nil, '', + [ 'Up', [@popup[:arrow], 'up'], nil, '', {:command=>proc{ @tree2.column_configure(@popup[:column].value, :arrow=>:up) } } ], - [ 'Down', [@popup[:arrow], 'down'], nil, '', + [ 'Down', [@popup[:arrow], 'down'], nil, '', {:command=>proc{ @tree2.column_configure(@popup[:column].value, :arrow=>:down) } } ], - '---', + '---', - [ 'Side Left', [@popup[:arrowside], 'left'], nil, '', + [ 'Side Left', [@popup[:arrowside], 'left'], nil, '', {:command=>proc{ - @tree2.column_configure(@popup[:column].value, + @tree2.column_configure(@popup[:column].value, :arrowside=>:left) } } ], - [ 'Side Right', [@popup[:arrowside], 'right'], nil, '', + [ 'Side Right', [@popup[:arrowside], 'right'], nil, '', {:command=>proc{ - @tree2.column_configure(@popup[:column].value, + @tree2.column_configure(@popup[:column].value, :arrowside=>:right) } } ], - '---', + '---', - [ 'Gravity Left', [@popup[:arrowgravity], 'left'], nil, '', + [ 'Gravity Left', [@popup[:arrowgravity], 'left'], nil, '', {:command=>proc{ - @tree2.column_configure(@popup[:column].value, + @tree2.column_configure(@popup[:column].value, :arrowgravity=>:left) } } ], - [ 'Gravity Right', [@popup[:arrowgravity], 'right'], nil, '', + [ 'Gravity Right', [@popup[:arrowgravity], 'right'], nil, '', {:command=>proc{ - @tree2.column_configure(@popup[:column].value, + @tree2.column_configure(@popup[:column].value, :arrowgravity=>:right) } } ], - ], - nil, '', {:menu_config=>{:tearoff=>false}} ], + ], + nil, '', {:menu_config=>{:tearoff=>false}} ], - [ 'Expand', @popup[:expand], nil, '', + [ 'Expand', @popup[:expand], nil, '', {:command=>proc{ - @tree2.column_configure(@popup[:column].value, + @tree2.column_configure(@popup[:column].value, :expand=>@popup[:expand].value) } } ], - [ 'Squeeze', @popup[:squeeze], nil, '', + [ 'Squeeze', @popup[:squeeze], nil, '', {:command=>proc{ - @tree2.column_configure(@popup[:column].value, + @tree2.column_configure(@popup[:column].value, :squeeze=>@popup[:squeeze].value) } } ], - [ 'Justify', + [ 'Justify', [ - [ 'Left', [@popup[:justify], 'left'], nil, '', + [ 'Left', [@popup[:justify], 'left'], nil, '', {:command=>proc{ @tree2.column_configure(@popup[:column].value, :justify=>:left) } } ], - [ 'Center', [@popup[:justify], 'center'], nil, '', + [ 'Center', [@popup[:justify], 'center'], nil, '', {:command=>proc{ - @tree2.column_configure(@popup[:column].value, + @tree2.column_configure(@popup[:column].value, :justify=>:center) } } ], - [ 'Right', [@popup[:justify], 'right'], nil, '', + [ 'Right', [@popup[:justify], 'right'], nil, '', {:command=>proc{ - @tree2.column_configure(@popup[:column].value, + @tree2.column_configure(@popup[:column].value, :justify=>:right) } } ] - ], + ], nil, '', {:menu_config=>{:tearoff=>false}} ] ] @@ -713,7 +707,7 @@ def master._pub_display_styles_in_item(item) display_styles_in_item(item) end - proc_disp_styles_in_item = proc{|item| + proc_disp_styles_in_item = proc{|item| master._pub_display_styles_in_item(item) } @@ -777,15 +771,15 @@ def load_demo_scripts # demo sources [ - 'bitmaps', - 'explorer', - 'help', - 'imovie', - 'layout', - 'mailwasher', - 'outlook-folders', - 'outlook-newgroup', - 'random', + 'bitmaps', + 'explorer', + 'help', + 'imovie', + 'layout', + 'mailwasher', + 'outlook-folders', + 'outlook-newgroup', + 'random', 'www-options' ].each{|f| @demo_scripts.load_demo(File.join(@ScriptDir, "#{f}.rb")) @@ -795,18 +789,18 @@ ########################### def init_demo_list - @tree1.element_create('e1', :text, + @tree1.element_create('e1', :text, :fill=>[@SystemHighlightText, ['selected', 'focus']]) - @tree1.element_create('e2', :rect, :showfocus=>true, + @tree1.element_create('e2', :rect, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], - 'gray', ['selected', '!focus'], + @SystemHighlight, ['selected', 'focus'], + 'gray', ['selected', '!focus'], ]) @tree1.style_create('s1') @tree1.style_elements('s1', ['e2', 'e1']) # Tk listbox has linespace + 1 height - @tree1.style_layout('s1', 'e2', :union=>['e1'], + @tree1.style_layout('s1', 'e2', :union=>['e1'], :ipadx=>2, :ipady=>[0, 1], :iexpand=>:e) if $Version_1_1_OrLater @@ -815,19 +809,19 @@ ### [ - ["Random #{@RandomN[0]} Items", :demoRandom, 'random.rb'], - ["Random #{@RandomN[0]} Items, Button Images", :demoRandom2, 'random.rb'], + ["Random #{@RandomN[0]} Items", :demoRandom, 'random.rb'], + ["Random #{@RandomN[0]} Items, Button Images", :demoRandom2, 'random.rb'], ["Outlook Express (Folders)", :demoOutlookFolders, 'outlook-folders.rb'], - ["Outlook Express (Newsgroup)", :demoOutlookNewsgroup, 'outlook-newgroup.rb'], - ["Explorer (Details)", :demoExplorerDetails, 'explorer.rb'], - ["Explorer (List)", :demoExplorerList, 'explorer.rb'], - ["Explorer (Large icons)", :demoExplorerLargeIcons, 'explorer.rb'], - ["Explorer (Small icons)", :demoExplorerSmallIcons, 'explorer.rb'], - ["Internet Options", :demoInternetOptions, 'www-options.rb'], - ["Help Contents", :demoHelpContents, 'help.rb'], - ["Layout", :demoLayout, 'layout.rb'], - ["MailWasher", :demoMailWasher, 'mailwasher.rb'], - ["Bitmaps", :demoBitmaps, 'bitmaps.rb'], + ["Outlook Express (Newsgroup)", :demoOutlookNewsgroup, 'outlook-newgroup.rb'], + ["Explorer (Details)", :demoExplorerDetails, 'explorer.rb'], + ["Explorer (List)", :demoExplorerList, 'explorer.rb'], + ["Explorer (Large icons)", :demoExplorerLargeIcons, 'explorer.rb'], + ["Explorer (Small icons)", :demoExplorerSmallIcons, 'explorer.rb'], + ["Internet Options", :demoInternetOptions, 'www-options.rb'], + ["Help Contents", :demoHelpContents, 'help.rb'], + ["Layout", :demoLayout, 'layout.rb'], + ["MailWasher", :demoMailWasher, 'mailwasher.rb'], + ["Bitmaps", :demoBitmaps, 'bitmaps.rb'], ["iMovie", :demoIMovie, 'imovie.rb'] ].each{|label, cmd, file| item = @tree1.item_create @@ -859,15 +853,15 @@ def display_styles_in_list # Create elements and styles the first time this is called if @tree4.style_names.empty? - @tree4.element_create('e1', :text, + @tree4.element_create('e1', :text, :fill=>[@SystemHighlightText,['selected','focus']]) - @tree4.element_create('e2', :text, + @tree4.element_create('e2', :text, :fill=>[ - @SystemHighlightText, ['selected','focus'], - '', ['selected','!focus'], + @SystemHighlightText, ['selected','focus'], + '', ['selected','!focus'], 'blue', [] ]) - @tree4.element_create('e3', :rect, :showfocus=>true, + @tree4.element_create('e3', :rect, :showfocus=>true, :fill=>[ @SystemHighlight, ['selected','focus'], 'gray', ['selected', '!focus'] @@ -880,13 +874,13 @@ @tree4.style_create('s2') @tree4.style_elements('s2', ['e3', 'e1', 'e2']) @tree4.style_layout('s2', 'e1', :padx=>[0,4]) - @tree4.style_layout('s2', 'e3', :union=>['e1', 'e2'], + @tree4.style_layout('s2', 'e3', :union=>['e1', 'e2'], :ipadx=>1, :ipady=>[0,1]) end # Clear the list @tree4.item_delete(:all) - + # One item for each element in the demo list @tree2.element_names.sort.each{|elem| if $Version_1_1_OrLater @@ -898,7 +892,7 @@ @tree4.collapse(item) end @tree4.item_style_set(item, 0, 's1') - @tree4.item_text(item, 0, + @tree4.item_text(item, 0, "Element #{elem} (#{@tree2.element_type(elem)})") # One item for each configuration option for this element @@ -913,7 +907,7 @@ else @tree4.item_style_set(item2, 0, 's2') @tree4.item_complex(item2, [ - ['e1', {:text=>name}], + ['e1', {:text=>name}], ['e2', {:text=>current.inspect}] ]) end @@ -948,7 +942,7 @@ @tree4.collapse(item2) end @tree4.item_style_set(item2, 0, 's1') - @tree4.item_text(item2, 0, + @tree4.item_text(item2, 0, "Element #{elem} (#{@tree2.element_type(elem)})") # One item for each layout option for this element in this style @@ -977,15 +971,15 @@ # Create elements and styles the first time this is called if @tree3.style_names.empty? - @tree3.element_create('e1', :text, + @tree3.element_create('e1', :text, :fill=>[@SystemHighlightText,['selected','focus']]) - @tree3.element_create('e2', :text, + @tree3.element_create('e2', :text, :fill=>[ - @SystemHighlightText, ['selected','focus'], - '', ['selected','!focus'], + @SystemHighlightText, ['selected','focus'], + '', ['selected','!focus'], 'blue', [] ]) - @tree3.element_create('e3', :rect, :showfocus=>true, + @tree3.element_create('e3', :rect, :showfocus=>true, :fill=>[ @SystemHighlight, ['selected','focus'], 'gray', ['selected', '!focus'] @@ -998,7 +992,7 @@ @tree3.style_create('s2') @tree3.style_elements('s2', ['e3', 'e1', 'e2']) @tree3.style_layout('s2', 'e1', :padx=>[0,4]) - @tree3.style_layout('s2', 'e3', :union=>['e1', 'e2'], + @tree3.style_layout('s2', 'e3', :union=>['e1', 'e2'], :ipadx=>1, :ipady=>[0,1]) end # Clear the list @@ -1014,7 +1008,7 @@ @tree3.collapse(item2) end @tree3.item_style_set(item2, 0, 's1') - @tree3.item_element_configure(item2, 0, 'e1', + @tree3.item_element_configure(item2, 0, 'e1', :text=>"Column #{column}: Style #{sty}") button = false @@ -1035,7 +1029,7 @@ @tree3.collapse(item3) end @tree3.item_style_set(item3, 0, 's1') - @tree3.item_element_configure(item3, 0, 'e1', + @tree3.item_element_configure(item3, 0, 'e1', :text=>"Element #{elem} (#{@tree2.element_type(elem)})") # One item for each configuration option in this element @@ -1052,13 +1046,13 @@ if sameAsMaster @tree3.item_style_set(item4, 0, 's1') @tree3.item_complex(item4, [ - ['e1', + ['e1', {:text=>"#{name} #{current.inspect}"}] ]) else @tree3.item_style_set(item4, 0, 's2') @tree3.item_complex(item4, [ - ['e1', {:text=>name}], + ['e1', {:text=>name}], ['e2', {:text=>current.inspect}] ]) end @@ -1118,28 +1112,28 @@ # Restore some happy defaults to the demo list # if $Version_1_1_OrLater if @has_bgimg - @tree2.configure(:orient=>:vertical, :wrap=>'', - :xscrollincrement=>0, :yscrollincrement=>0, - :itemheight=>0, :showheader=>true, - :background=>'white', :scrollmargin=>0, - :xscrolldelay=>50, :yscrolldelay=>50, - :openbuttonimage=>'', :closedbuttonimage=>'', - :backgroundmode=>:row, :treecolumn=>0, :indent=>19, + @tree2.configure(:orient=>:vertical, :wrap=>'', + :xscrollincrement=>0, :yscrollincrement=>0, + :itemheight=>0, :showheader=>true, + :background=>'white', :scrollmargin=>0, + :xscrolldelay=>50, :yscrolldelay=>50, + :openbuttonimage=>'', :closedbuttonimage=>'', + :backgroundmode=>:row, :treecolumn=>0, :indent=>19, :defaultstyle=>'', :backgroundimage=>'') else - @tree2.configure(:orient=>:vertical, :wrap=>'', - :xscrollincrement=>0, :yscrollincrement=>0, - :itemheight=>0, :showheader=>true, - :background=>'white', :scrollmargin=>0, - :xscrolldelay=>50, :yscrolldelay=>50, - :openbuttonimage=>'', :closedbuttonimage=>'', + @tree2.configure(:orient=>:vertical, :wrap=>'', + :xscrollincrement=>0, :yscrollincrement=>0, + :itemheight=>0, :showheader=>true, + :background=>'white', :scrollmargin=>0, + :xscrolldelay=>50, :yscrolldelay=>50, + :openbuttonimage=>'', :closedbuttonimage=>'', :backgroundmode=>:row, :treecolumn=>0, :indent=>19) end # Restore default bindings to the demo list @tree2.bindtags = [ @tree2, Tk::TreeCtrl, @tree2.winfo_toplevel, :all ] - @tree2.winfo_children.each{|w| + @tree2.winfo_children.each{|w| w.destroy unless @non_clear_list.include?(w) } end @@ -1153,8 +1147,8 @@ top.destroy if top.kind_of?(TkWindow) && top.winfo_exist? top = TkToplevel.new(:title=>'Cursor Window') - c = TkCanvas.new(top, :background=>'white', - :width=>50*10, :highlightthickness=>0, + c = TkCanvas.new(top, :background=>'white', + :width=>50*10, :highlightthickness=>0, :borderwidth=>0).pack(:expand=>true, :fill=>:both) cursors = %w( X_cursor @@ -1247,7 +1241,7 @@ begin c.cursor = cur - r = TkcRectangle.new(c, x, y, x+50, y+40, + r = TkcRectangle.new(c, x, y, x+50, y+40, :fill=>'gray90', :outline=>'black', :width=>2) t = TkcText.new(c, x+50/2, y+4, :text=>cur, :anchor=>:n, :width=>42) @@ -1284,10 +1278,10 @@ loupe[:y] = 0 unless loupe[:y] loupe[:auto] = true unless loupe[:auto] loupe[:delay] = 500 unless loupe[:delay] - loupe[:image] = + loupe[:image] = TkPhotoImage.new(:width=>150, :height=>150) unless loupe[:image] - top = TkToplevel.new(:geometry=>'-0+30', + top = TkToplevel.new(:geometry=>'-0+30', :title=>'A little screen magnifier for X11') TkLabel.new(top, :image=>loupe[:image]).pack Index: ext/tk/sample/tkextlib/treectrl/help.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/help.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/help.rb (working copy) @@ -4,7 +4,7 @@ def demoHelpContents(t) height = t.font.metrics(:linespace) height = 18 if height < 18 - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, :itemheight=>height, :selectmode=>:browse) init_pics('help-*') @@ -20,16 +20,16 @@ t.element_create('e1', :image, :image=>@images['help-page']) t.element_create('e2', :image, :image=>[ - @images['help-book-open'], ['open'], - @images['help-book-closed'], [], + @images['help-book-open'], ['open'], + @images['help-book-closed'], [], ]) - t.element_create('e3', :text, - :font=>[t.font.dup.underline(true), ['mouseover']], + t.element_create('e3', :text, + :font=>[t.font.dup.underline(true), ['mouseover']], :fill=>[ - @SystemHighlightText, ['selected', 'focus'], + @SystemHighlightText, ['selected', 'focus'], 'blue', ['mouseover'] ]) - t.element_create('e4', :rect, :showfocus=>true, + t.element_create('e4', :rect, :showfocus=>true, :fill=>[@SystemHighlight, ['selected', 'focus']]) # book @@ -49,21 +49,21 @@ parentList = [:root, '', '', '', '', '', ''] parent = :root [ - [0, 's1', "Welcome to Help"], - [0, 's2', "Introducing Windows 98"], - [1, 's2', "How to Use Help"], - [2, 's1', "Find a topic"], + [0, 's1', "Welcome to Help"], + [0, 's2', "Introducing Windows 98"], + [1, 's2', "How to Use Help"], + [2, 's1', "Find a topic"], [2, 's1', "Get more out of help"], [1, 's2', "Register Your Software"], - [2, 's1', "Registering Windows 98 online"], - [1, 's2', "What's New in Windows 98"], - [2, 's1', "Innovative, easy-to-use features"], - [2, 's1', "Improved reliability"], - [2, 's1', "A faster operating system"], - [2, 's1', "True Web integration"], - [2, 's1', "More entertaining and fun"], - [1, 's2', "If You're New to Windows 98"], - [2, 's2', "Tips for Macintosh Users"], + [2, 's1', "Registering Windows 98 online"], + [1, 's2', "What's New in Windows 98"], + [2, 's1', "Innovative, easy-to-use features"], + [2, 's1', "Improved reliability"], + [2, 's1', "A faster operating system"], + [2, 's1', "True Web integration"], + [2, 's1', "More entertaining and fun"], + [1, 's2', "If You're New to Windows 98"], + [2, 's2', "Tips for Macintosh Users"], [3, 's1', "Why does the mouse have two buttons?"] ].each{|depth, style, text| item = t.item_create @@ -81,7 +81,7 @@ treeCtrlHelp = TkBindTag.new - treeCtrlHelp.bind('Double-ButtonPress-1', + treeCtrlHelp.bind('Double-ButtonPress-1', proc{|w, x, y| if w.identify(x, y)[0] == 'header' Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y) @@ -91,25 +91,25 @@ Tk.callback_break }, '%W %x %y') - treeCtrlHelp.bind('ButtonPress-1', + treeCtrlHelp.bind('ButtonPress-1', proc{|w, x, y| helpButton1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlHelp.bind('Button1-Motion', + treeCtrlHelp.bind('Button1-Motion', proc{|w, x, y| helpMotion1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlHelp.bind('Button1-Leave', + treeCtrlHelp.bind('Button1-Leave', proc{|w, x, y| helpLeave1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlHelp.bind('ButtonRelease-1', + treeCtrlHelp.bind('ButtonRelease-1', proc{|w, x, y| helpRelease1(w, x, y) Tk.callback_break @@ -119,7 +119,7 @@ treeCtrlHelp.bind('Leave', proc{|w, x, y| helpMotion(w, x, y) }, '%W %x %y') - treeCtrlHelp.bind('KeyPress-Return', + treeCtrlHelp.bind('KeyPress-Return', proc{|w, x, y| if w.selection_get.length == 1 if $Version_1_1_OrLater @@ -141,7 +141,7 @@ def demoHelpContents2(t) height = t.font.metrics(:linespace) height = 18 if height < 18 - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, :itemheight=>height, :selectmode=>:browse) init_pics('help-*') @@ -154,19 +154,19 @@ t.element_create('e1', :image, :image=>@images['help-page']) t.element_create('e2', :image, :image=>[ - @images['help-book-open'], ['open'], - @images['help-book-closed'], [], + @images['help-book-open'], ['open'], + @images['help-book-closed'], [], ]) - t.element_create('e3', :text, + t.element_create('e3', :text, :fill=>[ - @SystemHighlightText, ['selected', 'focus'], + @SystemHighlightText, ['selected', 'focus'], 'blue', [] ]) - t.element_create('e4', :rect, :showfocus=>true, + t.element_create('e4', :rect, :showfocus=>true, :fill=>[@SystemHighligh, ['selected', 'focus']]) - t.element_create('e5', :text, :font=>t.font.dup.underline(true), + t.element_create('e5', :text, :font=>t.font.dup.underline(true), :fill=>[ - @SystemHighlightText, ['selected', 'focus'], + @SystemHighlightText, ['selected', 'focus'], 'blue', [] ]) @@ -201,21 +201,21 @@ parentList = [:root, '', '', '', '', '', ''] parent = :root [ - [0, 's1', "Welcome to Help"], - [0, 's2', "Introducing Windows 98"], - [1, 's2', "How to Use Help"], - [2, 's1' "Find a topic"], + [0, 's1', "Welcome to Help"], + [0, 's2', "Introducing Windows 98"], + [1, 's2', "How to Use Help"], + [2, 's1' "Find a topic"], [2, 's1', "Get more out of help"], [1, 's2', "Register Your Software"], - [2, 's1', "Registering Windows 98 online"], - [1, 's2', "What's New in Windows 98"], - [2, 's1', "Innovative, easy-to-use features"], - [2, 's1', "Improved reliability"], - [2, 's1', "A faster operating system"], - [2, 's1', "True Web integration"], - [2, 's1', "More entertaining and fun"], - [1, 's2', "If You're New to Windows 98"], - [2, 's2', "Tips for Macintosh Users"], + [2, 's1', "Registering Windows 98 online"], + [1, 's2', "What's New in Windows 98"], + [2, 's1', "Innovative, easy-to-use features"], + [2, 's1', "Improved reliability"], + [2, 's1', "A faster operating system"], + [2, 's1', "True Web integration"], + [2, 's1', "More entertaining and fun"], + [1, 's2', "If You're New to Windows 98"], + [2, 's2', "Tips for Macintosh Users"], [3, 's1', "Why does the mouse have two buttons?"] ].each{|depth, style, text| item = t.item_create @@ -233,7 +233,7 @@ treeCtrlHelp = TkBindTag.new - treeCtrlHelp.bind('Double-ButtonPress-1', + treeCtrlHelp.bind('Double-ButtonPress-1', proc{|w, x, y| if w.identify(x, y)[0] == 'header' Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y) @@ -243,25 +243,25 @@ Tk.callback_break }, '%W %x %y') - treeCtrlHelp.bind('ButtonPress-1', + treeCtrlHelp.bind('ButtonPress-1', proc{|w, x, y| helpButton1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlHelp.bind('Button1-Motion', + treeCtrlHelp.bind('Button1-Motion', proc{|w, x, y| helpMotion1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlHelp.bind('Button1-Leave', + treeCtrlHelp.bind('Button1-Leave', proc{|w, x, y| helpLeave1(w, x, y) Tk.callback_break }, '%W %x %y') - treeCtrlHelp.bind('ButtonRelease-1', + treeCtrlHelp.bind('ButtonRelease-1', proc{|w, x, y| helpRelease1(w, x, y) Tk.callback_break @@ -271,7 +271,7 @@ treeCtrlHelp.bind('Leave', proc{|w, x, y| helpMotion(w, x, y) }, '%W %x %y') - treeCtrlHelp.bind('KeyPress-Return', + treeCtrlHelp.bind('KeyPress-Return', proc{|w, x, y| if w.selection_get.length == 1 w.item_toggle(w.selection_get[0]) Index: ext/tk/sample/tkextlib/treectrl/imovie.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/imovie.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/imovie.rb (working copy) @@ -2,8 +2,8 @@ # Demo: iMovie # def demoIMovie(t) - t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, - :selectmode=>:browse, :orient=>:horizontal, :wrap=>:window, + t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false, + :selectmode=>:browse, :orient=>:horizontal, :wrap=>:window, :showheader=>false, :background=>'#dcdcdc') if $HasColumnCreate @@ -26,24 +26,24 @@ t.element_create('elemTime', :text, :font=>font1) t.element_create('elemName', :text, :font=>font2, :lines=>1, :width=>80) - t.element_create('elemRect', :rect, :outline=>'#827878', :outlinewidth=>1, + t.element_create('elemRect', :rect, :outline=>'#827878', :outlinewidth=>1, :fill=>['#ffdc5a', ['selected'], 'white', []]) t.element_create('elemImg', :image) - t.element_create('elemShadow', :rect, :outline=>'gray', :outlinewidth=>1, + t.element_create('elemShadow', :rect, :outline=>'gray', :outlinewidth=>1, :open=>:wn) s = t.style_create('STYLE', :orient=>:vertical) t.style_elements(s, [ - 'elemShadow', 'elemRect', 'elemTime', + 'elemShadow', 'elemRect', 'elemTime', 'elemImg', 'elemName' ]) - t.style_layout(s, 'elemShadow', :detach=>true, + t.style_layout(s, 'elemShadow', :detach=>true, :padx=>[1,2], :pady=>[1,2], :iexpand=>:es) t.style_layout(s, 'elemTime', :padx=>[2,0]) t.style_layout(s, 'elemImg', :pady=>[0,1]) - t.style_layout(s, 'elemName', :expand=>:we, :ipady=>[0,2], :padx=>[0,3], + t.style_layout(s, 'elemName', :expand=>:we, :ipady=>[0,2], :padx=>[0,3], :squeeze=>:x) - t.style_layout(s, 'elemRect', :union=>['elemTime', 'elemImg', 'elemName'], + t.style_layout(s, 'elemRect', :union=>['elemTime', 'elemImg', 'elemName'], :ipadx=>6, :padx=>[0,3], :pady=>[0,3]) # Set default item style @@ -53,12 +53,12 @@ (0..4).each{|i| [ - ['15:20', 'Clip 1', @images['imovie-01']], - ['19:18', 'Clip 2', @images['imovie-02']], - ['07:20', 'Clip 3', @images['imovie-03']], - ['07:20', 'Clip 4', @images['imovie-04']], - ['07:20', 'Clip 5', @images['imovie-05']], - ['07:20', 'Clip 6', @images['imovie-06']], + ['15:20', 'Clip 1', @images['imovie-01']], + ['19:18', 'Clip 2', @images['imovie-02']], + ['07:20', 'Clip 3', @images['imovie-03']], + ['07:20', 'Clip 4', @images['imovie-04']], + ['07:20', 'Clip 5', @images['imovie-05']], + ['07:20', 'Clip 6', @images['imovie-06']], ['07:20', 'Clip 7', @images['imovie-07']] ].each{|time, name, image| item = t.item_create @@ -110,7 +110,7 @@ Tk::TreeCtrl::BindCallback.entryOpen(w, i, 0, e) ent = TkComm.window(w.path + '.entry') unless exists - ent.configure(:borderwidth=>0, :justify=>:center, + ent.configure(:borderwidth=>0, :justify=>:center, :background=>'#ffdc5a') x1, y1, x2, y2 = w.item_bbox(i, 0, e) ent.place(:y=>y1 - 1) Index: ext/tk/sample/tkextlib/treectrl/outlook-folders.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/outlook-folders.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/outlook-folders.rb (working copy) @@ -7,7 +7,7 @@ height = t.font.metrics(:linespace) + 2 height = 18 if height < 18 - t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>true, + t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>true, :showroot=>true, :showrootbutton=>false, :showbuttons=>true) if $HasColumnCreate @@ -17,15 +17,15 @@ end t.element_create('e1', :image) - t.element_create('e2', :text, :lines=>1, + t.element_create('e2', :text, :lines=>1, :fill=>[@SystemHighlightText, ['selected', 'focus']]) - t.element_create('e3', :text, :lines=>1, :font=>t.font.dup.weight(:bold), + t.element_create('e3', :text, :lines=>1, :font=>t.font.dup.weight(:bold), :fill=>[@SystemHighlightText, ['selected', 'focus']]) t.element_create('e4', :text, :fill=>'blue') t.element_create('e5', :image, :image=>@images['outlook-folder']) - t.element_create('e6', :rect, :showfocus=>true, + t.element_create('e6', :rect, :showfocus=>true, :fill=>[ - @SystemHighlight, ['selected', 'focus'], + @SystemHighlight, ['selected', 'focus'], 'gray', ['selected', '!focus'] ]) @@ -60,28 +60,28 @@ t.style_layout(s, 'e6', :union=>['e3'], :iexpand=>:ns, :ipadx=>2) t.item_style_set(:root, 0, 's1') - t.item_complex(:root, + t.item_complex(:root, [ - ['e1', {:image=>@images['outlook-main']}], + ['e1', {:image=>@images['outlook-main']}], ['e2', {:text=>'Outlook Express'}] ]) parentList = [:root, '', '', '', '', '', ''] parent = :root [ - [0, :local, "Local Folders", true, 0], - [1, :inbox, 'Inbox', false, 5], - [1, :outbox, 'Outbox', false, 0], - [1, :sent, "Sent Items", false, 0], - [1, :deleted, "Deleted Items", false, 50], - [1, :draft, 'Drafts', false, 0], - [1, :folder, "Messages to Dad", false, 0], - [1, :folder, "Messages to Sis", false, 0], - [1, :folder, "Messages to Me", false, 0], - [2, :folder, "2001", false, 0], - [2, :folder, "2000", false, 0], - [2, :folder, "1999", false, 0], - [0, :server, "news.gmane.org", true, 0], + [0, :local, "Local Folders", true, 0], + [1, :inbox, 'Inbox', false, 5], + [1, :outbox, 'Outbox', false, 0], + [1, :sent, "Sent Items", false, 0], + [1, :deleted, "Deleted Items", false, 50], + [1, :draft, 'Drafts', false, 0], + [1, :folder, "Messages to Dad", false, 0], + [1, :folder, "Messages to Sis", false, 0], + [1, :folder, "Messages to Me", false, 0], + [2, :folder, "2001", false, 0], + [2, :folder, "2000", false, 0], + [2, :folder, "1999", false, 0], + [0, :server, "news.gmane.org", true, 0], [1, :group, "gmane.comp.lang.lua.general", false, 498] ].each{|depth, img, text, button, unread| if $Version_1_1_OrLater @@ -93,7 +93,7 @@ if img == :folder if unread != 0 t.item_style_set(item, 0, 's4') - t.item_complex(item, + t.item_complex(item, [['e3', {:text=>text}], ['e4', {:text=>"(#{unread})"}]]) else t.item_style_set(item, 0, 's3') @@ -102,17 +102,17 @@ else if unread != 0 t.item_style_set(item, 0, 's2') - t.item_complex(item, + t.item_complex(item, [ - ['e1', {:image=>@images["outlook-#{img}"]}], - ['e3', {:text=>text}], + ['e1', {:image=>@images["outlook-#{img}"]}], + ['e3', {:text=>text}], ['e4', {:text=>"(#{unread})"}] ]) else t.item_style_set(item, 0, 's1') - t.item_complex(item, + t.item_complex(item, [ - ['e1', {:image=>@images["outlook-#{img}"]}], + ['e1', {:image=>@images["outlook-#{img}"]}], ['e2', {:text=>text}] ]) end Index: ext/tk/sample/tkextlib/treectrl/mailwasher.rb =================================================================== --- ext/tk/sample/tkextlib/treectrl/mailwasher.rb (revision 23917) +++ ext/tk/sample/tkextlib/treectrl/mailwasher.rb (working copy) @@ -7,8 +7,8 @@ height = t.font.metrics(:linespace) + 2 height = 18 if height < 18 - t.configure(:showroot=>false, :showrootbutton=>false, :showbuttons=>false, - :showlines=>false, :itemheight=>height, :selectmode=>:browse, + t.configure(:showroot=>false, :showrootbutton=>false, :showbuttons=>false, + :showlines=>false, :itemheight=>height, :selectmode=>:browse, :xscrollincrement=>1) pad = 4 @@ -16,14 +16,14 @@ if $Version_1_1_OrLater t.column_create(:text=>'Delete', :textpadx=>pad, :tag=>'delete') t.column_create(:text=>'Bounce', :textpadx=>pad, :tag=>'bounce') - t.column_create(:text=>'Status', :width=>80, :textpadx=>pad, + t.column_create(:text=>'Status', :width=>80, :textpadx=>pad, :tag=>'status') - t.column_create(:text=>'Size', :width=>40, :textpadx=>pad, + t.column_create(:text=>'Size', :width=>40, :textpadx=>pad, :justify=>:right, :tag=>'size') t.column_create(:text=>'From', :width=>140, :textpadx=>pad, :tag=>'from') - t.column_create(:text=>'Subject', :width=>240, :textpadx=>pad, + t.column_create(:text=>'Subject', :width=>240, :textpadx=>pad, :tag=>'subject') - t.column_create(:text=>'Received', :textpadx=>pad, :arrow=>:up, + t.column_create(:text=>'Received', :textpadx=>pad, :arrow=>:up, :arrowpad=>[4,0], :tag=>'received') t.column_create(:text=>'Attachments', :textpadx=>pad, :tag=>'attachments') @@ -36,38 +36,38 @@ else # TreeCtrl 1.0 t.column_configure(0, :text=>'Delete', :textpadx=>pad, :tag=>'delete') t.column_configure(1, :text=>'Bounce', :textpadx=>pad, :tag=>'bounce') - t.column_configure(2, :text=>'Status', :width=>80, :textpadx=>pad, + t.column_configure(2, :text=>'Status', :width=>80, :textpadx=>pad, :tag=>'status') - t.column_configure(3, :text=>'Size', :width=>40, :textpadx=>pad, + t.column_configure(3, :text=>'Size', :width=>40, :textpadx=>pad, :justify=>:right, :tag=>'size') - t.column_configure(4, :text=>'From', :width=>140, :textpadx=>pad, + t.column_configure(4, :text=>'From', :width=>140, :textpadx=>pad, :tag=>'from') - t.column_configure(5, :text=>'Subject', :width=>240, :textpadx=>pad, + t.column_configure(5, :text=>'Subject', :width=>240, :textpadx=>pad, :tag=>'subject') - t.column_configure(6, :text=>'Received', :textpadx=>pad, :arrow=>:up, + t.column_configure(6, :text=>'Received', :textpadx=>pad, :arrow=>:up, :arrowpad=>[4,0], :tag=>'received') - t.column_configure(7, :text=>'Attachments', :textpadx=>pad, + t.column_configure(7, :text=>'Attachments', :textpadx=>pad, :tag=>'attachments') t.element_create('imgOff', :image, :image=>@images['unchecked']) t.element_create('imgOn', :image, :image=>@images['checked']) end - t.element_create('border', :rect, :open=>:nw, :outline=>'gray', + t.element_create('border', :rect, :open=>:nw, :outline=>'gray', :outlinewidth=>1, :fill=>[@SystemHighlight, ['selected']]) - t.element_create('txtAny', :text, :lines=>1, + t.element_create('txtAny', :text, :lines=>1, :fill=>[@SystemHighlightText, ['selected']]) - t.element_create('txtNone', :text, :text=>'none', :lines=>1, + t.element_create('txtNone', :text, :text=>'none', :lines=>1, :fill=>[@SystemHighlightText, ['selected']]) - t.element_create('txtYes', :text, :text=>'yes', :lines=>1, + t.element_create('txtYes', :text, :text=>'yes', :lines=>1, :fill=>[@SystemHighlightText, ['selected']]) - t.element_create('txtNormal', :text, :text=>'Normal', :lines=>1, + t.element_create('txtNormal', :text, :text=>'Normal', :lines=>1, :fill=>[@SystemHighlightText, ['selected'], '#006800', []]) - t.element_create('txtPossSpam', :text, :text=>'Possible Spam', :lines=>1, + t.element_create('txtPossSpam', :text, :text=>'Possible Spam', :lines=>1, :fill=>[@SystemHighlightText, ['selected'], '#787800', []]) - t.element_create('txtProbSpam', :text, :text=>'Probably Spam', :lines=>1, + t.element_create('txtProbSpam', :text, :text=>'Probably Spam', :lines=>1, :fill=>[@SystemHighlightText, ['selected'], '#FF9000', []]) - t.element_create('txtBlacklist', :text, :text=>'Blacklisted', :lines=>1, + t.element_create('txtBlacklist', :text, :text=>'Blacklisted', :lines=>1, :fill=>[@SystemHighlightText, ['selected'], '#FF5800', []]) if $Version_1_1_OrLater @@ -96,16 +96,16 @@ } [ - ['baldy@spammer.com', "Your hair is thinning"], - ['flat@spammer.com', "Your breasts are too small"], - ['tiny@spammer.com', "Your penis is too small"], - ['dumbass@spammer.com', "You are not very smart"], - ['bankrobber@spammer.com', "You need more money"], - ['loser@spammer.com', "You need better friends"], - ['gossip@spammer.com', "Find out what your coworkers think about you"], + ['baldy@spammer.com', "Your hair is thinning"], + ['flat@spammer.com', "Your breasts are too small"], + ['tiny@spammer.com', "Your penis is too small"], + ['dumbass@spammer.com', "You are not very smart"], + ['bankrobber@spammer.com', "You need more money"], + ['loser@spammer.com', "You need better friends"], + ['gossip@spammer.com', "Find out what your coworkers think about you"], ['whoami@spammer.com', "Find out what you think about yourself"], - ['downsized@spammer.com', "You need a better job"], - ['poorhouse@spammer.com', "Your mortgage is a joke"], + ['downsized@spammer.com', "You need a better job"], + ['poorhouse@spammer.com', "Your mortgage is a joke"], ['spam4ever@spammer.com', "You need more spam"] ].each{|frm, subj| item = t.item_create @@ -115,8 +115,8 @@ if $Version_1_1_OrLater delete = [false, true][rand(2)] bounce = [false, true][rand(2)] - t.item_style_set(item, - 0, 'styCheck', 1, 'styCheck', 2, status, 3, 'styAny', + t.item_style_set(item, + 0, 'styCheck', 1, 'styCheck', 2, status, 3, 'styAny', 4, 'styAny', 5, 'styAny', 6, 'styAny', 7, attachments) t.item_state_forcolumn(item, 'delete', 'CHECK') if delete t.item_state_forcolumn(item, 'bounce', 'CHECK') if bounce @@ -124,8 +124,8 @@ else # TreeCtrl 1.0 delete = ['styOn', 'styOff'][rand(2)] bounce = ['styOn', 'styOff'][rand(2)] - t.item_style_set(item, - 0, delete, 1, bounce, 2, status, 3, 'styAny', + t.item_style_set(item, + 0, delete, 1, bounce, 2, status, 3, 'styAny', 4, 'styAny', 5, 'styAny', 6, 'styAny', 7, attachments) end @@ -138,7 +138,7 @@ } sortColumn = 6 - t.notify_bind(t, 'Header-invoke', + t.notify_bind(t, 'Header-invoke', proc{|c, w| if c == sortColumn if w.column_cget(sortColumn, :arrow) == 'down' @@ -162,35 +162,35 @@ w.column_configure(c, :arrow=>arrow) case w.column_cget(c, :tag) when 'bounce', 'delete' - w.item_sort(:root, order, - { - :column=>c, + w.item_sort(:root, order, + { + :column=>c, :command=>proc{|item1, item2| compareOnOff(w, c, item1, item2) } - }, + }, { :column=>'subject', :dictionary=>true }) when 'status' - w.item_sort(:root, order, + w.item_sort(:root, order, { :column=>c, :dictionary=>true }) when 'from' - w.item_sort(:root, order, - { :column=>c, :dictionary=>true }, + w.item_sort(:root, order, + { :column=>c, :dictionary=>true }, { :column=>'subject', :dictionary=>true }) when 'subject' - w.item_sort(:root, order, + w.item_sort(:root, order, { :column=>c, :dictionary=>true }) when 'size' - w.item_sort(:root, order, - { :column=>c, :dictionary=>true }, + w.item_sort(:root, order, + { :column=>c, :dictionary=>true }, { :column=>'subject', :dictionary=>true }) when 'received' - w.item_sort(:root, order, - { :column=>c, :dictionary=>true }, + w.item_sort(:root, order, + { :column=>c, :dictionary=>true }, { :column=>'subject', :dictionary=>true }) when 'attachments' - w.item_sort(:root, order, - { :column=>c, :dictionary=>true }, + w.item_sort(:root, order, + { :column=>c, :dictionary=>true }, { :column=>'subject', :dictionary=>true }) end }, '%C %T') @@ -198,7 +198,7 @@ mailWasher = TkBindTag.new if $Version_1_1_OrLater - mailWasher.bind('ButtonPress-1', + mailWasher.bind('ButtonPress-1', proc{|w, x, y| id = w.identify(x, y) if id.empty? @@ -214,7 +214,7 @@ end }, '%W %x %y') else # TreeCtrl 1.0 - mailWasher.bind('ButtonPress-1', + mailWasher.bind('ButtonPress-1', proc{|w, x, y| id = w.identify(x, y) if id.empty? Index: ext/tk/sample/tkextlib/bwidget/select.rb =================================================================== --- ext/tk/sample/tkextlib/bwidget/select.rb (revision 23917) +++ ext/tk/sample/tkextlib/bwidget/select.rb (working copy) @@ -13,28 +13,28 @@ titf1 = Tk::BWidget::TitleFrame.new(frame, :text=>'SpinBox') subf = titf1.get_frame - spin = Tk::BWidget::SpinBox.new(subf, :range=>[1, 100, 1], - :textvariable=>@@var.ref('spin', 'var'), + spin = Tk::BWidget::SpinBox.new(subf, :range=>[1, 100, 1], + :textvariable=>@@var.ref('spin', 'var'), :helptext=>'This is the SpinBox') - ent = Tk::BWidget::LabelEntry.new(subf, :label=>'Linked var', - :labelwidth=>10, :labelanchor=>:w, - :textvariable=>@@var.ref('spin', 'var'), - :editable=>0, + ent = Tk::BWidget::LabelEntry.new(subf, :label=>'Linked var', + :labelwidth=>10, :labelanchor=>:w, + :textvariable=>@@var.ref('spin', 'var'), + :editable=>0, :helptext=>"This is an Entry reflecting\nthe linked var of SpinBox") - labf = Tk::BWidget::LabelFrame.new(subf, :text=>'Options', - :side=>:top, :anchor=>:w, - :relief=>:sunken, :borderwidth=>1, + labf = Tk::BWidget::LabelFrame.new(subf, :text=>'Options', + :side=>:top, :anchor=>:w, + :relief=>:sunken, :borderwidth=>1, :helptext=>'Modify some options of SpinBox') subf = labf.get_frame - chk1 = TkCheckbutton.new(subf, :text=>'Non editable', - :variable=>@@var.ref('spin', 'editable'), - :onvalue=>false, :offvalue=>true, + chk1 = TkCheckbutton.new(subf, :text=>'Non editable', + :variable=>@@var.ref('spin', 'editable'), + :onvalue=>false, :offvalue=>true, :command=>proc{ spin.editable(@@var['spin', 'editable']) }) - chk2 = TkCheckbutton.new(subf, :text=>'Disabled', - :variable=>@@var.ref('spin', 'state'), - :onvalue=>'disabled', :offvalue=>'normal', + chk2 = TkCheckbutton.new(subf, :text=>'Disabled', + :variable=>@@var.ref('spin', 'state'), + :onvalue=>'disabled', :offvalue=>'normal', :command=>proc{ spin.state(@@var['spin', 'state']) }) @@ -47,28 +47,28 @@ combo = Tk::BWidget::ComboBox.new(subf, :textvariable=>@@var.ref('combo', 'var'), :values=>[ - 'first value', 'second value', - 'third value', 'fourth value', + 'first value', 'second value', + 'third value', 'fourth value', 'fifth value' - ], + ], :helptext=>'This is the ComboBox') - ent = Tk::BWidget::LabelEntry.new(subf, :label=>'Linked var', - :labelwidth=>10, :labelanchor=>:w, + ent = Tk::BWidget::LabelEntry.new(subf, :label=>'Linked var', + :labelwidth=>10, :labelanchor=>:w, :textvariable=>@@var.ref('combo', 'var'), :editable=>0, :helptext=>"This is an Entry reflecting\nthe linked var of ComboBox") - labf = Tk::BWidget::LabelFrame.new(subf, :text=>'Options', :side=>:top, - :anchor=>:w, :relief=>:sunken, + labf = Tk::BWidget::LabelFrame.new(subf, :text=>'Options', :side=>:top, + :anchor=>:w, :relief=>:sunken, :borderwidth=>1, :helptext=>'Modify some options of ComboBox') subf = labf.get_frame - chk1 = TkCheckbutton.new(subf, :text=>'Non editable', - :variable=>@@var.ref('combo', 'editable'), - :onvalue=>false, :offvalue=>true, + chk1 = TkCheckbutton.new(subf, :text=>'Non editable', + :variable=>@@var.ref('combo', 'editable'), + :onvalue=>false, :offvalue=>true, :command=>proc{ combo.editable(@@var['combo', 'editable']) }) - chk2 = TkCheckbutton.new(subf, :text=>'Disabled', - :variable=>@@var.ref('combo', 'state'), - :onvalue=>'disabled', :offvalue=>'normal', + chk2 = TkCheckbutton.new(subf, :text=>'Disabled', + :variable=>@@var.ref('combo', 'state'), + :onvalue=>'disabled', :offvalue=>'normal', :command=>proc{ combo.state(@@var['combo', 'state']) }) Index: ext/tk/sample/tkextlib/bwidget/tree.rb =================================================================== --- ext/tk/sample/tkextlib/bwidget/tree.rb (revision 23917) +++ ext/tk/sample/tkextlib/bwidget/tree.rb (working copy) @@ -16,28 +16,28 @@ pane = pw.add(:weight=>1) title = Tk::BWidget::TitleFrame.new(pane, :text=>'Directory tree') - sw = Tk::BWidget::ScrolledWindow.new(title.get_frame, + sw = Tk::BWidget::ScrolledWindow.new(title.get_frame, :relief=>:sunken, :borderwidth=>2) - tree = Tk::BWidget::Tree.new(sw, :relief=>:flat, :borderwidth=>0, - :width=>15, :highlightthickness=>0, - :redraw=>false, :dropenabled=>true, - :dragenabled=>true, :dragevent=>3, + tree = Tk::BWidget::Tree.new(sw, :relief=>:flat, :borderwidth=>0, + :width=>15, :highlightthickness=>0, + :redraw=>false, :dropenabled=>true, + :dragenabled=>true, :dragevent=>3, :droptypes=>[ 'TREE_NODE', [ - :copy, [], + :copy, [], :move, [], :link, [] - ], + ], 'LISTBOX_ITEM', [ - :copy, [], + :copy, [], :move, [], :link, [] ] - ], - :opencmd=>proc{|node| + ], + :opencmd=>proc{|node| moddir(1, tree, node) - }, - :closecmd=>proc{|node| + }, + :closecmd=>proc{|node| moddir(0, tree, node) }) sw.set_widget(tree) @@ -47,24 +47,24 @@ pane = pw.add(:weight=>2) lf = Tk::BWidget::TitleFrame.new(pane, :text=>'Content') - sw = Tk::BWidget::ScrolledWindow.new(lf.get_frame, - :scrollbar=>:horizontal, - :auto=>:none, :relief=>:sunken, + sw = Tk::BWidget::ScrolledWindow.new(lf.get_frame, + :scrollbar=>:horizontal, + :auto=>:none, :relief=>:sunken, :borderwidth=>2) - list = Tk::BWidget::ListBox.new(sw, :relief=>:flat, :borderwidth=>0, - :highlightthickness=>0, :width=>20, - :multicolumn=>true, :redraw=>false, - :dragevent=>3, :dropenabled=>true, - :dragenabled=>true, + list = Tk::BWidget::ListBox.new(sw, :relief=>:flat, :borderwidth=>0, + :highlightthickness=>0, :width=>20, + :multicolumn=>true, :redraw=>false, + :dragevent=>3, :dropenabled=>true, + :dragenabled=>true, :droptypes=>[ 'TREE_NODE', [ - :copy, [], + :copy, [], :move, [], :link, [] - ], + ], 'LISTBOX_ITEM', [ - :copy, [], + :copy, [], :move, [], :link, [] ] @@ -77,43 +77,43 @@ tree.textbind('ButtonPress-1', proc{|node, ev| select('tree', 1, tree, list, node)}) - tree.textbind('Double-ButtonPress-1', + tree.textbind('Double-ButtonPress-1', proc{|node, ev| select('tree', 2, tree, list, node)}) list.textbind('ButtonPress-1', proc{|node, ev| select('list', 1, tree, list, node)}) - list.textbind('Double-ButtonPress-1', + list.textbind('Double-ButtonPress-1', proc{|node, ev| select('list', 2, tree, list, node)}) - list.imagebind('Double-ButtonPress-1', + list.imagebind('Double-ButtonPress-1', proc{|node, ev| select('list', 2, tree, list, node)}) - nb.itemconfigure('demoTree', - :createcmd=>proc{|*args| init(tree, list, *args)}, + nb.itemconfigure('demoTree', + :createcmd=>proc{|*args| init(tree, list, *args)}, :raisecmd=>proc{ - Tk.root.geometry =~ + Tk.root.geometry =~ /\d+x\d+([+-]{1,2}\d+)([+-]{1,2}\d+)/ global_w = ($1 || 0).to_i global_h = ($2 || 0).to_i if @@top - Tk::BWidget.place(@@top, 0, 0, :at, + Tk::BWidget.place(@@top, 0, 0, :at, global_w - Tk.root.winfo_screenwidth, global_h) @@top.deiconify Tk.root.bind('Unmap', proc{@@top.withdraw}) Tk.root.bind('Map', proc{@@top.deiconify}) Tk.root.bind('Configure', proc{|w| if w == Tk.root - Tk.root.geometry =~ + Tk.root.geometry =~ /\d+x\d+([+-]{1,2}\d+)([+-]{1,2}\d+)/ global_w = ($1 || 0).to_i global_h = ($2 || 0).to_i - Tk::BWidget.place(@@top, 0, 0, :at, - global_w - Tk.root.winfo_screenwidth, + Tk::BWidget.place(@@top, 0, 0, :at, + global_w - Tk.root.winfo_screenwidth, global_h) end }, '%W') end - }, + }, :leavecmd=>proc{ @@top.withdraw if @@top Tk.root.bind_remove('Unmap') @@ -131,8 +131,8 @@ rootdir = 'c:' end - tree.insert('end', 'root', 'home', - :text=>rootdir, :data=>rootdir, :open=>true, + tree.insert('end', 'root', 'home', + :text=>rootdir, :data=>rootdir, :open=>true, :image=>Tk::BWidget::Bitmap.new('openfold')) getdir(tree, 'home', rootdir) select('tree', 1, tree, list, 'home') @@ -147,8 +147,8 @@ @@top.resizable(false, false) @@top.title('Drag rectangle to scroll directory tree') @@top.transient(Tk.root) - Tk::BWidget::ScrollView.new(@@top, :window=>tree, :fill=>'white', - :width=>300, :height=>300, :relief=>:sunken, + Tk::BWidget::ScrollView.new(@@top, :window=>tree, :fill=>'white', + :width=>300, :height=>300, :relief=>:sunken, :bd=>1).pack(:fill=>:both, :expand=>true) end @@ -156,11 +156,11 @@ lentries = Dir.glob(File.join(path, '*')).sort lfiles = [] lentries.each{|f| - basename = File.basename(f) + basename = File.basename(f) if File.directory?(f) - Tk::BWidget::Tree::Node.new(tree, node, - :index=>'end', :text=>basename, - :image=>Tk::BWidget::Bitmap.new('folder'), + Tk::BWidget::Tree::Node.new(tree, node, + :index=>'end', :text=>basename, + :image=>Tk::BWidget::Bitmap.new('folder'), :drawcross=>:allways, :data=>f) @@count += 1 else @@ -187,7 +187,7 @@ def self.select(where, num, tree, list, node) @@dblclick = true if num == 1 - if (where == 'tree' && + if (where == 'tree' && tree.selection_get.find{|x| TkUtil._get_eval_string(x) == TkUtil._get_eval_string(node) }) @@ -195,7 +195,7 @@ Tk.after(500, proc{edit('tree', tree, list, node)}) return end - if (where == 'list' && + if (where == 'list' && list.selection_get.find{|x| TkUtil._get_eval_string(x) == TkUtil._get_eval_string(node) }) @@ -230,13 +230,13 @@ end tree.nodes(node).each{|subnode| - list.insert('end', subnode, - :text=>tree.itemcget(subnode, :text), + list.insert('end', subnode, + :text=>tree.itemcget(subnode, :text), :image=>Tk::BWidget::Bitmap.new('folder')) } TkComm.simplelist(dir).each{|f| - Tk::BWidget::ListBox::Item.new(list, 'end', :text=>f, + Tk::BWidget::ListBox::Item.new(list, 'end', :text=>f, :image=>Tk::BWidget::Bitmap.new('file')) } end @@ -244,7 +244,7 @@ def self.edit(where, tree, list, node) return if @@dblclick - if (where == 'tree' && + if (where == 'tree' && tree.selection_get.find{|x| TkUtil._get_eval_string(x) == TkUtil._get_eval_string(node) }) Index: ext/tk/sample/tkextlib/bwidget/basic.rb =================================================================== --- ext/tk/sample/tkextlib/bwidget/basic.rb (revision 23917) +++ ext/tk/sample/tkextlib/bwidget/basic.rb (working copy) @@ -29,37 +29,37 @@ end def self._label(parent) - lab = Tk::BWidget::Label.new(parent, :text=>'This is a Label widget', + lab = Tk::BWidget::Label.new(parent, :text=>'This is a Label widget', :helptext=>'Label widget') - chk = TkCheckbutton.new(parent, :text=>'Disabled', - :variable=>@@var.ref(lab, 'state'), - :onvalue=>'disabled', :offvalue=>'normal', + chk = TkCheckbutton.new(parent, :text=>'Disabled', + :variable=>@@var.ref(lab, 'state'), + :onvalue=>'disabled', :offvalue=>'normal', :command=>proc{lab[:state] = @@var[lab, 'state']}) lab.pack(:anchor=>:w, :pady=>4) chk.pack(:anchor=>:w) end def self._entry(parent) - ent = Tk::BWidget::Entry.new(parent, :text=>'Press enter', - :helptext=>'Entry widtet', + ent = Tk::BWidget::Entry.new(parent, :text=>'Press enter', + :helptext=>'Entry widtet', :command=>proc{ @@var['entcmd'] = 'command called' Tk.after(500, proc{@@var['entcmd'] = ''}) }) - chk1 = TkCheckbutton.new(parent, :text=>'Disabled', - :variable=>@@var.ref(ent, 'state'), - :onvalue=>'disabled', :offvalue=>'normal', + chk1 = TkCheckbutton.new(parent, :text=>'Disabled', + :variable=>@@var.ref(ent, 'state'), + :onvalue=>'disabled', :offvalue=>'normal', :command=>proc{ent.state = @@var[ent, 'state']}) - chk2 = TkCheckbutton.new(parent, :text=>'Non editable', - :variable=>@@var.ref(ent, 'editable'), - :onvalue=>false, :offvalue=>true, + chk2 = TkCheckbutton.new(parent, :text=>'Non editable', + :variable=>@@var.ref(ent, 'editable'), + :onvalue=>false, :offvalue=>true, :command=>proc{ ent.editable = @@var[ent, 'editable'] }) - lab = TkLabel.new(parent, :textvariable=>@@var.ref('entcmd'), + lab = TkLabel.new(parent, :textvariable=>@@var.ref('entcmd'), :foreground=>'red') ent.pack(:pady=>4, :anchor=>:w) @@ -69,22 +69,22 @@ def self._button(parent) frame = TkFrame.new(parent) - but = Tk::BWidget::Button.new(frame, :text=>'Press me!', - :repeatdelay=>300, - :command=>proc{_butcmd('command')}, + but = Tk::BWidget::Button.new(frame, :text=>'Press me!', + :repeatdelay=>300, + :command=>proc{_butcmd('command')}, :helptext=>'This is a Button widget') sep1 = Tk::BWidget::Separator.new(frame, :orient=>:vertical) - arr1 = Tk::BWidget::ArrowButton.new(frame, :type=>:button, - :width=>25, :height=>25, :repeatdelay=>300, - :command=>proc{_butcmd('command')}, + arr1 = Tk::BWidget::ArrowButton.new(frame, :type=>:button, + :width=>25, :height=>25, :repeatdelay=>300, + :command=>proc{_butcmd('command')}, :helptext=>"This is an ArrowButton widget\nof type button") sep2 = Tk::BWidget::Separator.new(frame, :orient=>:vertical) - arr2 = Tk::BWidget::ArrowButton.new(frame, :type=>:arrow, - :width=>25, :height=>25, :relief=>:sunken, - :ipadx=>0, :ipady=>0, :repeatdelay=>300, - :command=>proc{_butcmd('command')}, + arr2 = Tk::BWidget::ArrowButton.new(frame, :type=>:arrow, + :width=>25, :height=>25, :relief=>:sunken, + :ipadx=>0, :ipady=>0, :repeatdelay=>300, + :command=>proc{_butcmd('command')}, :helptext=>"This is an ArrowButton widget\nof type arrow") but.pack(:side=>:left, :padx=>4) @@ -94,49 +94,49 @@ arr2.pack(:side=>:left, :padx=>4) frame.pack - Tk::BWidget::Separator.new(parent, + Tk::BWidget::Separator.new(parent, :orient=>:horizontal).pack(:fill=>:x, :pady=>10) - labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Command', - :side=>:top, :anchor=>:w, + labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Command', + :side=>:top, :anchor=>:w, :relief=>:sunken, :borderwidth=>1) subf = labf1.get_frame - chk1 = TkCheckbutton.new(subf, :text=>'Disabled', - :variable=>@@var.ref('bstate'), - :onvalue=>'disabled', :offvalue=>'normal', - :command=>proc{_bstate(@@var['bstate'], + chk1 = TkCheckbutton.new(subf, :text=>'Disabled', + :variable=>@@var.ref('bstate'), + :onvalue=>'disabled', :offvalue=>'normal', + :command=>proc{_bstate(@@var['bstate'], but, arr1, arr2)}) - chk2 = TkCheckbutton.new(subf, :text=>"Use armcommand/\ndisarmcommand", - :variable=>@@var.ref('barmcmd'), - :command=>proc{_barmcmd(@@var['barmcmd'], + chk2 = TkCheckbutton.new(subf, :text=>"Use armcommand/\ndisarmcommand", + :variable=>@@var.ref('barmcmd'), + :command=>proc{_barmcmd(@@var['barmcmd'], but, arr1, arr2)}) Tk.pack(chk1, chk2, :anchor=>:w) - label = TkLabel.new(parent, :textvariable=>@@var.ref('butcmd'), + label = TkLabel.new(parent, :textvariable=>@@var.ref('butcmd'), :foreground=>'red').pack(:side=>:bottom, :pady=>4) - labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Direction', - :side=>:top, :anchor=>:w, + labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Direction', + :side=>:top, :anchor=>:w, :relief=>:sunken, :borderwidth=>1) subf = labf2.get_frame @@var['bside'] = :top [:top, :left, :bottom, :right].each{|dir| - TkRadiobutton.new(subf, :text=>"#{dir} arrow", - :variable=>@@var.ref('bside'), :value=>dir, + TkRadiobutton.new(subf, :text=>"#{dir} arrow", + :variable=>@@var.ref('bside'), :value=>dir, :command=>proc{_bside(@@var['bside'], arr1, arr2)} ).pack(:anchor=>:w) } - labf3 = Tk::BWidget::LabelFrame.new(parent, :text=>'Relief', - :side=>:top, :anchor=>:w, + labf3 = Tk::BWidget::LabelFrame.new(parent, :text=>'Relief', + :side=>:top, :anchor=>:w, :relief=>:sunken, :borderwidth=>1) subf = labf3.get_frame @@var['brelief'] = :raised [ %w(raised sunken ridge groove), %w(flat solid link)].each{|lrelief| f = TkFrame.new(subf) lrelief.each{|relief| - TkRadiobutton.new(f, :text=>relief, - :variable=>@@var.ref('brelief'), :value=>relief, + TkRadiobutton.new(f, :text=>relief, + :variable=>@@var.ref('brelief'), :value=>relief, :command=>proc{ _brelief(@@var['brelief'], but, arr1, arr2) }).pack(:anchor=>:w) @@ -163,19 +163,19 @@ def self._barmcmd(value, but, arr1, arr2) if TkComm.bool(value) - but.configure(:armcommand=>proc{_butcmd('arm')}, - :disarmcommand=>proc{_butcmd('disarm')}, + but.configure(:armcommand=>proc{_butcmd('arm')}, + :disarmcommand=>proc{_butcmd('disarm')}, :command=>'') [arr1, arr2].each{|arr| - arr.configure(:armcommand=>proc{_butcmd('arm')}, - :disarmcommand=>proc{_butcmd('disarm')}, + arr.configure(:armcommand=>proc{_butcmd('arm')}, + :disarmcommand=>proc{_butcmd('disarm')}, :command=>'') } else - but.configure(:armcommand=>'', :disarmcommand=>'', + but.configure(:armcommand=>'', :disarmcommand=>'', :command=>proc{_butcmd('command')}) [arr1, arr2].each{|arr| - arr.configure(:armcommand=>'', :disarmcommand=>'', + arr.configure(:armcommand=>'', :disarmcommand=>'', :command=>proc{_butcmd('command')}) } end Index: ext/tk/sample/tkextlib/bwidget/tmpldlg.rb =================================================================== --- ext/tk/sample/tkextlib/bwidget/tmpldlg.rb (revision 23917) +++ ext/tk/sample/tkextlib/bwidget/tmpldlg.rb (working copy) @@ -23,14 +23,14 @@ titf4 = Tk::BWidget::TitleFrame.new(frame, :text=>'Other dialog') subf = titf1.get_frame - cmd = proc{ TkOption.read_file(File.join(Tk::BWidget::LIBRARY, 'lang', + cmd = proc{ TkOption.read_file(File.join(Tk::BWidget::LIBRARY, 'lang', @@resources.value + '.rc')) } - Tk.pack(TkRadiobutton.new(subf, :text=>'English', :value=>'en', - :variable=>@@resources, :command=>cmd), - TkRadiobutton.new(subf, :text=>'French', :value=>'fr', - :variable=>@@resources, :command=>cmd), - TkRadiobutton.new(subf, :text=>'German', :value=>'de', - :variable=>@@resources, :command=>cmd), + Tk.pack(TkRadiobutton.new(subf, :text=>'English', :value=>'en', + :variable=>@@resources, :command=>cmd), + TkRadiobutton.new(subf, :text=>'French', :value=>'fr', + :variable=>@@resources, :command=>cmd), + TkRadiobutton.new(subf, :text=>'German', :value=>'de', + :variable=>@@resources, :command=>cmd), :side=>:left) _tmpldlg(titf2.get_frame) @@ -46,34 +46,34 @@ @@tmpl['side'] = :bottom @@tmpl['anchor'] = :c - labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Button side', - :side=>:top, :anchor=>:w, + labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Button side', + :side=>:top, :anchor=>:w, :relief=>:sunken, :borderwidth=>1) subf = labf1.get_frame - Tk.pack(TkRadiobutton.new(subf, :text=>'Bottom', :value=>:bottom, - :variable=>@@tmpl.ref('side'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Left', :value=>:left, - :variable=>@@tmpl.ref('side'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Right', :value=>:right, - :variable=>@@tmpl.ref('side'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Top', :value=>:top, - :variable=>@@tmpl.ref('side'), :anchor=>:w), + Tk.pack(TkRadiobutton.new(subf, :text=>'Bottom', :value=>:bottom, + :variable=>@@tmpl.ref('side'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Left', :value=>:left, + :variable=>@@tmpl.ref('side'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Right', :value=>:right, + :variable=>@@tmpl.ref('side'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Top', :value=>:top, + :variable=>@@tmpl.ref('side'), :anchor=>:w), :fill=>:x, :anchor=>:w) - labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Button anchor', - :side=>:top, :anchor=>:w, + labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Button anchor', + :side=>:top, :anchor=>:w, :relief=>:sunken, :borderwidth=>1) subf = labf2.get_frame - Tk.pack(TkRadiobutton.new(subf, :text=>'North', :value=>:n, - :variable=>@@tmpl.ref('anchor'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'West', :value=>:w, - :variable=>@@tmpl.ref('anchor'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'East', :value=>:e, - :variable=>@@tmpl.ref('anchor'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'South', :value=>:s, - :variable=>@@tmpl.ref('anchor'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Center', :value=>:c, - :variable=>@@tmpl.ref('anchor'), :anchor=>:w), + Tk.pack(TkRadiobutton.new(subf, :text=>'North', :value=>:n, + :variable=>@@tmpl.ref('anchor'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'West', :value=>:w, + :variable=>@@tmpl.ref('anchor'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'East', :value=>:e, + :variable=>@@tmpl.ref('anchor'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'South', :value=>:s, + :variable=>@@tmpl.ref('anchor'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Center', :value=>:c, + :variable=>@@tmpl.ref('anchor'), :anchor=>:w), :fill=>:x, :anchor=>:w) sep = Tk::BWidget::Separator.new(parent, :orient=>:horizontal) @@ -88,44 +88,44 @@ @@msg['type'] = 'ok' @@msg['icon'] = 'info' - labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Type', :side=>:top, - :anchor=>:w, :relief=>:sunken, + labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Type', :side=>:top, + :anchor=>:w, :relief=>:sunken, :borderwidth=>1) subf = labf1.get_frame - Tk.pack(TkRadiobutton.new(subf, :text=>'Ok', :value=>'ok', - :variable=>@@msg.ref('type'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Ok, Cancel', :value=>'okcancel', - :variable=>@@msg.ref('type'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Retry, Cancel', - :value=>'retrycancel', - :variable=>@@msg.ref('type'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Yes, No', :value=>'yesno', - :variable=>@@msg.ref('type'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Yes, No, Cancel', - :value=>'yesnocancel', - :variable=>@@msg.ref('type'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Abort, Retry, Ignore', - :value=>'abortretryignore', - :variable=>@@msg.ref('type'), :anchor=>:w), + Tk.pack(TkRadiobutton.new(subf, :text=>'Ok', :value=>'ok', + :variable=>@@msg.ref('type'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Ok, Cancel', :value=>'okcancel', + :variable=>@@msg.ref('type'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Retry, Cancel', + :value=>'retrycancel', + :variable=>@@msg.ref('type'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Yes, No', :value=>'yesno', + :variable=>@@msg.ref('type'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Yes, No, Cancel', + :value=>'yesnocancel', + :variable=>@@msg.ref('type'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Abort, Retry, Ignore', + :value=>'abortretryignore', + :variable=>@@msg.ref('type'), :anchor=>:w), :fill=>:x, :anchor=>:w) - Tk.pack(TkRadiobutton.new(subf, :text=>'User', :value=>'user', - :variable=>@@msg.ref('type'), :anchor=>:w), + Tk.pack(TkRadiobutton.new(subf, :text=>'User', :value=>'user', + :variable=>@@msg.ref('type'), :anchor=>:w), Tk::BWidget::Entry.new(subf, :textvariable=>@@msg.ref('buttons')), :side=>:left) - labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Icon', :side=>:top, - :anchor=>:w, :relief=>:sunken, + labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Icon', :side=>:top, + :anchor=>:w, :relief=>:sunken, :borderwidth=>1) subf = labf2.get_frame - Tk.pack(TkRadiobutton.new(subf, :text=>'Information', :value=>'info', - :variable=>@@msg.ref('icon'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Question', :value=>'question', - :variable=>@@msg.ref('icon'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Warning', :value=>'warning', - :variable=>@@msg.ref('icon'), :anchor=>:w), - TkRadiobutton.new(subf, :text=>'Error', :value=>'error', - :variable=>@@msg.ref('icon'), :anchor=>:w), + Tk.pack(TkRadiobutton.new(subf, :text=>'Information', :value=>'info', + :variable=>@@msg.ref('icon'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Question', :value=>'question', + :variable=>@@msg.ref('icon'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Warning', :value=>'warning', + :variable=>@@msg.ref('icon'), :anchor=>:w), + TkRadiobutton.new(subf, :text=>'Error', :value=>'error', + :variable=>@@msg.ref('icon'), :anchor=>:w), :fill=>:x, :anchor=>:w) sep = Tk::BWidget::Separator.new(parent, :orient=>:horizontal) @@ -139,13 +139,13 @@ def self._stddlg(parent) Tk.pack(TkButton.new(parent, :text=>'Select a color '){|w| command(proc{DemoDialog._show_color(w)}) - }, - TkButton.new(parent, :text=>'Font selector dialog', - :command=>proc{_show_fontdlg}), - TkButton.new(parent, :text=>'Progression dialog', - :command=>proc{_show_progdlg}), - TkButton.new(parent, :text=>'Password dialog', - :command=>proc{_show_passdlg}), + }, + TkButton.new(parent, :text=>'Font selector dialog', + :command=>proc{_show_fontdlg}), + TkButton.new(parent, :text=>'Progression dialog', + :command=>proc{_show_progdlg}), + TkButton.new(parent, :text=>'Password dialog', + :command=>proc{_show_passdlg}), :side=>:left, :padx=>5, :anchor=>:w) end @@ -158,15 +158,15 @@ end def self._show_tmpldlg - dlg = Tk::BWidget::Dialog.new(:relative=>Tk.root, :modal=>:local, - :separator=>true, :title=>'Template dialog', - :side=>@@tmpl['side'], - :anchor=>@@tmpl['anchor'], + dlg = Tk::BWidget::Dialog.new(:relative=>Tk.root, :modal=>:local, + :separator=>true, :title=>'Template dialog', + :side=>@@tmpl['side'], + :anchor=>@@tmpl['anchor'], :default=>0, :cancel=>1) dlg.add('name'=>'ok') dlg.add('name'=>'cancel') - TkMessage.new(dlg.get_frame, :text=>"Template\nDialog", :justify=>:center, - :anchor=>:c, :width=>80).pack(:fill=>:both, :expand=>true, + TkMessage.new(dlg.get_frame, :text=>"Template\nDialog", :justify=>:center, + :anchor=>:c, :width=>80).pack(:fill=>:both, :expand=>true, :padx=>100, :pady=>100) dlg.draw dlg.destroy @@ -174,16 +174,16 @@ def self._show_msgdlg @@msgdlg.destroy if @@msgdlg - @@msgdlg = Tk::BWidget::MessageDlg.new(:relative=>Tk.root, - :message=>'Message for MessageBox', - :type=>@@msg['type'], - :icon=>@@msg['icon'], + @@msgdlg = Tk::BWidget::MessageDlg.new(:relative=>Tk.root, + :message=>'Message for MessageBox', + :type=>@@msg['type'], + :icon=>@@msg['icon'], :buttons=>@@msg['buttons']) @@msgdlg.create end def self._show_fontdlg - font = Tk::BWidget::SelectFont.new(:relative=>Tk.root, + font = Tk::BWidget::SelectFont.new(:relative=>Tk.root, :font=>DemoVar.font).create DemoVar::Demo.update_font(font) end @@ -192,11 +192,11 @@ @@progmsg.value = "Compute in progress..." @@progval.value = 0 - @@progdlg = Tk::BWidget::ProgressDlg.new(:relative=>Tk.root, - :title=>'Wait...', - :type=>'infinite', :width=>20, - :textvariable=>@@progmsg, - :variable=>@@progval, + @@progdlg = Tk::BWidget::ProgressDlg.new(:relative=>Tk.root, + :title=>'Wait...', + :type=>'infinite', :width=>20, + :textvariable=>@@progmsg, + :variable=>@@progval, :stop=>'Stop') { command(proc{self.destroy}) create Index: ext/tk/sample/tkextlib/bwidget/demo.rb =================================================================== --- ext/tk/sample/tkextlib/bwidget/demo.rb (revision 23917) +++ ext/tk/sample/tkextlib/bwidget/demo.rb (working copy) @@ -54,21 +54,21 @@ descmenu = [ '&File', 'all', 'file', 0, [ - ['command', 'E&xit', [], 'Exit BWidget demo', [], + ['command', 'E&xit', [], 'Exit BWidget demo', [], {:command=>proc{exit}}] - ], + ], '&Options', 'all', 'options', 0, [ - ['checkbutton', 'Toolbar &1', ['all', 'option'], - 'Show/hide toolbar 1', [], - { :variable=>DemoVar.toolbar1, + ['checkbutton', 'Toolbar &1', ['all', 'option'], + 'Show/hide toolbar 1', [], + { :variable=>DemoVar.toolbar1, :command=>proc{ DemoVar.mainframe.show_toolbar(0, DemoVar.toolbar1.value) } } - ], - ['checkbutton', 'Toolbar &2', ['all', 'option'], - 'Show/hide toolbar 2', [], - { :variable=>DemoVar.toolbar2, + ], + ['checkbutton', 'Toolbar &2', ['all', 'option'], + 'Show/hide toolbar 2', [], + { :variable=>DemoVar.toolbar2, :command=>proc{ DemoVar.mainframe.show_toolbar(1, DemoVar.toolbar2.value) } @@ -81,8 +81,8 @@ DemoVar.prgindic.value = 0 DemoVar.mainframe = Tk::BWidget::MainFrame.new( - :menu=>descmenu, - :textvariable=>DemoVar.status, + :menu=>descmenu, + :textvariable=>DemoVar.status, :progressvar=>DemoVar.prgindic ) @@ -91,22 +91,22 @@ DemoVar.mainframe.add_toolbar{|tb1| Tk::BWidget::ButtonBox.new(tb1, :spacing=>0, :padx=>1, :pady=>1){|bbox| - add(:image=>Tk::BWidget::Bitmap.new('new'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Create a new file" icon'}, + add(:image=>Tk::BWidget::Bitmap.new('new'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Create a new file" icon'}, :helptext=>"Create a new file") - add(:image=>Tk::BWidget::Bitmap.new('open'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Open an existing file" icon'}, + add(:image=>Tk::BWidget::Bitmap.new('open'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Open an existing file" icon'}, :helptext=>"Open an existing file") - add(:image=>Tk::BWidget::Bitmap.new('save'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Save file" icon'}, + add(:image=>Tk::BWidget::Bitmap.new('save'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Save file" icon'}, :helptext=>"Save file") pack(:side=>:left, :anchor=>:w) @@ -119,22 +119,22 @@ DemoVar.prgindic.numeric += 1 Tk::BWidget::ButtonBox.new(tb1, :spacing=>0, :padx=>1, :pady=>1){|bbox| - add(:image=>Tk::BWidget::Bitmap.new('cut'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Cut selection" icon'}, + add(:image=>Tk::BWidget::Bitmap.new('cut'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Cut selection" icon'}, :helptext=>"Cut selection") - add(:image=>Tk::BWidget::Bitmap.new('copy'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Copy selection" icon'}, + add(:image=>Tk::BWidget::Bitmap.new('copy'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Copy selection" icon'}, :helptext=>"Copy selection") - add(:image=>Tk::BWidget::Bitmap.new('paste'), - :highlightthickness=>0, :takefocus=>0, :relief=>:link, - :borderwidth=>1, :padx=>1, :pady=>1, - :command=>proc{puts 'select "Paste selection" icon'}, + add(:image=>Tk::BWidget::Bitmap.new('paste'), + :highlightthickness=>0, :takefocus=>0, :relief=>:link, + :borderwidth=>1, :padx=>1, :pady=>1, + :command=>proc{puts 'select "Paste selection" icon'}, :helptext=>"Paste selection") pack(:side=>:left, :anchor=>:w) @@ -145,7 +145,7 @@ DemoVar.prgindic.numeric += 1 tb2 = DemoVar.mainframe.add_toolbar - DemoVar._wfont = Tk::BWidget::SelectFont::Toolbar.new(tb2, + DemoVar._wfont = Tk::BWidget::SelectFont::Toolbar.new(tb2, :command=>proc{update_font(DemoVar._wfont[:font])} ) DemoVar.font = DemoVar._wfont[:font] @@ -213,18 +213,18 @@ top.withdraw top.overrideredirect(true) - ximg = TkLabel.new(top, :bitmap=>"@#{File.join(DEMODIR,'x1.xbm')}", + ximg = TkLabel.new(top, :bitmap=>"@#{File.join(DEMODIR,'x1.xbm')}", :foreground=>'grey90', :background=>'white') bwimg = TkLabel.new(ximg, :bitmap=>"@#{File.join(DEMODIR,'bwidget.xbm')}", :foreground=>'grey90', :background=>'white') frame = TkFrame.new(ximg, :background=>'white') - TkLabel.new(frame, :text=>'Loading demo', + TkLabel.new(frame, :text=>'Loading demo', :background=>'white', :font=>'times 8').pack - TkLabel.new(frame, :textvariable=>DemoVar.prgtext, + TkLabel.new(frame, :textvariable=>DemoVar.prgtext, :background=>'white', :font=>'times 8', :width=>35).pack - Tk::BWidget::ProgressBar.new(frame, :width=>50, :height=>10, - :background=>'white', - :variable=>DemoVar.prgindic, + Tk::BWidget::ProgressBar.new(frame, :width=>50, :height=>10, + :background=>'white', + :variable=>DemoVar.prgindic, :maximum=>10).pack frame.place(:x=>0, :y=>0, :anchor=>:nw) bwimg.place(:relx=>1, :rely=>1, :anchor=>:se) Index: ext/tk/sample/tkextlib/bwidget/dnd.rb =================================================================== --- ext/tk/sample/tkextlib/bwidget/dnd.rb (revision 23917) +++ ext/tk/sample/tkextlib/bwidget/dnd.rb (working copy) @@ -12,19 +12,19 @@ titf1 = Tk::BWidget::TitleFrame.new(frame, :text=>'Drag source') subf = titf1.get_frame - ent1 = Tk::BWidget::LabelEntry.new(subf, :label=>'Entry', - :labelwidth=>14, :dragenabled=>true, + ent1 = Tk::BWidget::LabelEntry.new(subf, :label=>'Entry', + :labelwidth=>14, :dragenabled=>true, :dragevent=>3) - labf1 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label (text)', + labf1 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label (text)', :width=>14) f = labf1.get_frame - lab = Tk::BWidget::Label.new(f, :text=>'Drag this text', + lab = Tk::BWidget::Label.new(f, :text=>'Drag this text', :dragenabled=>true, :dragevent=>3).pack - labf2 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label (bitmap)', + labf2 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label (bitmap)', :width=>14) f = labf2.get_frame - lab = Tk::BWidget::Label.new(f, :bitmap=>'info', + lab = Tk::BWidget::Label.new(f, :bitmap=>'info', :dragenabled=>true, :dragevent=>3).pack Tk.pack(ent1, labf1, labf2, :side=>:top, :fill=>:x, :pady=>4) @@ -32,11 +32,11 @@ titf2 = Tk::BWidget::TitleFrame.new(frame, :text=>'Drop targets') subf = titf2.get_frame - ent1 = Tk::BWidget::LabelEntry.new(subf, :label=>'Entry', + ent1 = Tk::BWidget::LabelEntry.new(subf, :label=>'Entry', :labelwidth=>14, :dropenabled=>true) labf1 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label', :width=>14) f = labf1.get_frame - lab = Tk::BWidget::Label.new(f, :dropenabled=>true, + lab = Tk::BWidget::Label.new(f, :dropenabled=>true, :highlightthickness=>1).pack(:fill=>:x) Tk.pack(ent1, labf1, :side=>:top, :fill=>:x, :pady=>4) Tk.pack(titf1, titf2, :pady=>4) Index: ext/tk/sample/tkextlib/bwidget/manager.rb =================================================================== --- ext/tk/sample/tkextlib/bwidget/manager.rb (revision 23917) +++ ext/tk/sample/tkextlib/bwidget/manager.rb (working copy) @@ -32,19 +32,19 @@ end def self._mainframe(parent) - labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Toolbar', - :side=>:top, :anchor=>:w, + labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Toolbar', + :side=>:top, :anchor=>:w, :relief=>:sunken, :borderwidth=>2) subf = labf1.get_frame - chk1 = TkCheckbutton.new(subf, :text=>'View toolbar 1', - :variable=>DemoVar.toolbar1, + chk1 = TkCheckbutton.new(subf, :text=>'View toolbar 1', + :variable=>DemoVar.toolbar1, :command=>proc{ DemoVar.mainframe.show_toolbar( 0, DemoVar.toolbar1.value ) }) - chk2 = TkCheckbutton.new(subf, :text=>'View toolbar 2', - :variable=>DemoVar.toolbar2, + chk2 = TkCheckbutton.new(subf, :text=>'View toolbar 2', + :variable=>DemoVar.toolbar2, :command=>proc{ DemoVar.mainframe.show_toolbar( 1, DemoVar.toolbar2.value @@ -54,12 +54,12 @@ Tk.pack(chk1, chk2, :anchor=>:w, :fill=>:x) labf1.pack(:fill=>:both) - labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Status bar', - :side=>:top, :anchor=>:w, + labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Status bar', + :side=>:top, :anchor=>:w, :relief=>:sunken, :borderwidth=>2) subf = labf2.get_frame - chk1 = TkCheckbutton.new(subf, :text=>"Show Progress\nindicator", - :justify=>:left, :variable=>@@progress, + chk1 = TkCheckbutton.new(subf, :text=>"Show Progress\nindicator", + :justify=>:left, :variable=>@@progress, :command=>proc{ _show_progress }) chk1.pack(:anchor=>:w, :fill=>:x) @@ -67,8 +67,8 @@ end def self._notebook(parent) - TkCheckbutton.new(parent, :text=>'Homogeneous label', - :variable=>@@homogeneous, + TkCheckbutton.new(parent, :text=>'Homogeneous label', + :variable=>@@homogeneous, :command=>proc{ DemoVar.notebook[:homogeneous] = @@homogeneous.value }).pack(:side=>:left, :anchor=>:n, :fill=>:x) @@ -92,13 +92,13 @@ sw.pack(:fill=>:both, :expand=>true) } - sw = Tk::BWidget::ScrolledWindow.new(pane3, :relief=>:sunken, + sw = Tk::BWidget::ScrolledWindow.new(pane3, :relief=>:sunken, :borderwidth=>2) sf = Tk::BWidget::ScrollableFrame.new(sw) sw.set_widget(sf) subf = sf.get_frame lab = TkLabel.new(subf, :text=>'This is a ScrollableFrame') - chk = TkCheckbutton.new(subf, :text=>'Constrained with', + chk = TkCheckbutton.new(subf, :text=>'Constrained with', :variable=>@@constw, :command=>proc{ sf['constrainedwidth'] = @@constw.value }) Index: ext/tk/sample/tkextlib/tktable/buttons.rb =================================================================== --- ext/tk/sample/tkextlib/tktable/buttons.rb (revision 23917) +++ ext/tk/sample/tkextlib/tktable/buttons.rb (working copy) @@ -14,11 +14,11 @@ rows = 20 cols = 20 -table = Tk::TkTable.new(:rows=>rows + 1, :cols=>cols + 1, - :variable=>tab, :titlerows=>1, :titlecols=>1, - :roworigin=>-1, :colorigin=>-1, - :colwidth=>4, :width=>8, :height=>8, - :cursor=>'top_left_arrow', :borderwidth=>2, +table = Tk::TkTable.new(:rows=>rows + 1, :cols=>cols + 1, + :variable=>tab, :titlerows=>1, :titlecols=>1, + :roworigin=>-1, :colorigin=>-1, + :colwidth=>4, :width=>8, :height=>8, + :cursor=>'top_left_arrow', :borderwidth=>2, :flashmode=>false, :state=>:disabled) sx = table.xscrollbar(TkScrollbar.new) @@ -67,7 +67,7 @@ 0.step(cols){|j| if i == 0 tab[-1,j] = j - end + end tab[i,j] = "OFF" table.tag_cell('OFF', "#{i},#{j}") } Index: ext/tk/sample/tkextlib/tktable/command.rb =================================================================== --- ext/tk/sample/tkextlib/tktable/command.rb (revision 23917) +++ ext/tk/sample/tkextlib/tktable/command.rb (working copy) @@ -27,7 +27,7 @@ ent_var = TkVariable.new entry = TkEntry.new(:textvariable=>ent_var) -table = Tk::TkTable.new(:rows=>rows, :cols=>cols, +table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :command=>[proc{|mode, cell, val| if (mode == :w) data[cell] = val @@ -38,10 +38,10 @@ '' # not exist end end - }, '%i %C %s'], - :width=>6, :height=>6, - :titlerows=>1, :titlecols=>1, - :roworigin=>-1, :colorigin=>-1, + }, '%i %C %s'], + :width=>6, :height=>6, + :titlerows=>1, :titlecols=>1, + :roworigin=>-1, :colorigin=>-1, :rowstretchmode=>:last, :colstretchmode=>:last, :rowtagcommand=>proc{|row| row = Integer(row) @@ -50,20 +50,20 @@ :coltagcommand=>proc{|col| col = Integer(col) (col>0 && col%2 == 1)? 'OddCol': '' - }, - :selectmode=>:extended, :flashmode=>true, + }, + :selectmode=>:extended, :flashmode=>true, :rowstretch=>:unset, :colstretch=>:unset, :browsecommand=>[proc{|w, s| cur_var.value = s ent_var.value = w.get(s) - }, '%W %S'], - :validate=>true, - :validatecommand=>proc{|e| + }, '%W %S'], + :validate=>true, + :validatecommand=>proc{|e| ent_var.value = e.new_value; true }) =begin :validatecommand=>[ - proc{|s| + proc{|s| ent_var.value = s; true }, '%S']) =end Index: ext/tk/sample/tkextlib/tktable/valid.rb =================================================================== --- ext/tk/sample/tkextlib/tktable/valid.rb (revision 23917) +++ ext/tk/sample/tkextlib/tktable/valid.rb (working copy) @@ -4,7 +4,7 @@ ## ## This demos shows the use of the validation mechanism of the table ## and uses the table's cache (no -command or -variable) -## +## ## ( based on 'valid.tcl' included source archive of tktable extension ) ## require 'tk' @@ -53,12 +53,12 @@ lbl = TkLabel.new(:text=>"TkTable v1 Validated Table Example") -table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :cache=>1, - :width=>5, :height=>5, :titlerows=>1, :titlecols=>1, +table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :cache=>1, + :width=>5, :height=>5, :titlerows=>1, :titlecols=>1, :coltagcommand=>proc{|n| colorize(n)}, - :flashmode=>true, :selectmode=>:extended, - :colstretch=>:unset, :rowstretch=>:unset, - :validate=>true, + :flashmode=>true, :selectmode=>:extended, + :colstretch=>:unset, :rowstretch=>:unset, + :validate=>true, :validatecommand=>proc{|e| unless e.widget.tag_include?('title', e.index) validate_proc(e.column, e.new_value) Index: ext/tk/sample/tkextlib/tktable/maxsize.rb =================================================================== --- ext/tk/sample/tkextlib/tktable/maxsize.rb (revision 23917) +++ ext/tk/sample/tkextlib/tktable/maxsize.rb (working copy) @@ -4,7 +4,7 @@ ## ## This demo uses a really big table. The big startup time is in ## filling the table's Tcl array var. -## +## ## ( based on 'maxsize.tcl' included source archive of tktable extension ) ## require 'tk' @@ -23,15 +23,15 @@ lbl = TkLabel.new(:text=>"TkTable v2 Example") -table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary, - :width=>6, :height=>8, - :titlerows=>1, :titlecols=>1, +table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary, + :width=>6, :height=>8, + :titlerows=>1, :titlecols=>1, :coltagcommand=>proc{|col| col = Integer(col) (col>0 && col%2 == 1)? 'OddCol': '' - }, - :selectmode=>:extended, - :colstretch=>:unset, :rowstretch=>:unset, + }, + :selectmode=>:extended, + :colstretch=>:unset, :rowstretch=>:unset, :selecttitles=>false, :drawmode=>:slow) sx = table.xscrollbar(TkScrollbar.new) Index: ext/tk/sample/tkextlib/tktable/basic.rb =================================================================== --- ext/tk/sample/tkextlib/tktable/basic.rb (revision 23917) +++ ext/tk/sample/tkextlib/tktable/basic.rb (working copy) @@ -3,7 +3,7 @@ ## basic.rb ## ## This demo shows the basic use of the table widget -## +## ## ( based on 'basic.tcl' included source archive of tktable extension ) ## require 'tk' @@ -22,19 +22,19 @@ lbl = TkLabel.new(:text=>"TkTable v1 Example") -table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary, - :width=>6, :height=>6, - :titlerows=>1, :titlecols=>2, - :roworigin=>-1, :colorigin=>-2, +table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary, + :width=>6, :height=>6, + :titlerows=>1, :titlecols=>2, + :roworigin=>-1, :colorigin=>-2, :rowstretchmode=>:last, :colstretchmode=>:last, :rowtagcommand=>proc{|row| row = Integer(row) (row>0 && row%2 == 1)? 'OddRow': '' - }, + }, :coltagcommand=>proc{|col| col = Integer(col) (col>0 && col%2 == 1)? 'OddCol': '' - }, + }, :selectmode=>:extended, :sparsearray=>false) sx = table.xscrollbar(TkScrollbar.new) Index: ext/tk/sample/tkextlib/tktable/debug.rb =================================================================== --- ext/tk/sample/tkextlib/tktable/debug.rb (revision 23917) +++ ext/tk/sample/tkextlib/tktable/debug.rb (working copy) @@ -23,15 +23,15 @@ lbl = TkLabel.new(:text=>"TkTable v2 Example") -table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary, - :width=>6, :height=>6, - :titlerows=>1, :titlecols=>2, - :roworigin=>-5, :colorigin=>-2, +table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary, + :width=>6, :height=>6, + :titlerows=>1, :titlecols=>2, + :roworigin=>-5, :colorigin=>-2, :coltagcommand=>proc{|col| col = Integer(col) (col>0 && col%2 == 1)? 'OddCol': '' - }, - :selectmode=>:extended, :flashmode=>true, + }, + :selectmode=>:extended, :flashmode=>true, :rowstretch=>:unset, :colstretch=>:unset, :selecttitles=>false, :drawmode=>:single) @@ -67,8 +67,8 @@ table.tag_cell('dis', [2,1], [1,-1], [3,0]) table.set_width([-2,8], [-1,9], [0, 12], [4, 14]) -table.set([1,1], "multi-line\ntext\nmight be\ninteresting", - [3,2], "more\nmulti-line\nplaying\n", +table.set([1,1], "multi-line\ntext\nmight be\ninteresting", + [3,2], "more\nmulti-line\nplaying\n", [2,2], "null\0byte") # This is in the row span Index: ext/tk/sample/tkextlib/tktable/dynarows.rb =================================================================== --- ext/tk/sample/tkextlib/tktable/dynarows.rb (revision 23917) +++ ext/tk/sample/tkextlib/tktable/dynarows.rb (working copy) @@ -5,7 +5,7 @@ ## This demos shows the use of the validation mechanism of the table ## and uses the table's cache (no -command or -variable) with a cute ## dynamic row routine. -## +## ## ( based on 'dynarows.tcl' included source archive of tktable extension ) ## require 'tk' @@ -24,7 +24,7 @@ begin time = Tk.tk_call('clock', 'scan', val) date = [] - Tk.tk_call('clock', 'format', time, + Tk.tk_call('clock', 'format', time, :format=>'%m %d %Y').split(' ').each{|item| date << item.sub(/^\s*0*/,'') } @@ -54,12 +54,12 @@ lbl = TkLabel.new(:text=>"Dynamic Date Validated Rows") -table = Tk::TkTable.new(:rows=>2, :cols=>3, :cache=>1, :selecttype=>:row, - :titlerows=>1, :titlecols=>1, :height=>5, - :colstretch=>:unset, :rowstretch=>:unset, - :autoclear=>true, +table = Tk::TkTable.new(:rows=>2, :cols=>3, :cache=>1, :selecttype=>:row, + :titlerows=>1, :titlecols=>1, :height=>5, + :colstretch=>:unset, :rowstretch=>:unset, + :autoclear=>true, :browsecommand=>[ - proc{|w,s| table_validate(w, s)}, + proc{|w,s| table_validate(w, s)}, '%W %s' ]) table.set([0,1], 'Begin', [0,2], 'End', [1,0], '*') Index: ext/tk/sample/tkextlib/tktable/spreadsheet.rb =================================================================== --- ext/tk/sample/tkextlib/tktable/spreadsheet.rb (revision 23917) +++ ext/tk/sample/tkextlib/tktable/spreadsheet.rb (working copy) @@ -4,7 +4,7 @@ ## ## This demos shows how you can simulate a 3D table ## and has other basic features to begin a basic spreadsheet -## +## ## ( based on 'spreadsheet.tcl' included source archive of tktable extension ) ## require 'tk' @@ -67,15 +67,15 @@ fill_table(table_list, page.value) fill_table(table_list, 'BB', Integer(rows/2), Integer(cols/2)) -table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :width=>5, :height=>5, - :variable=>table_list[page.value], - :titlerows=>1, :titlecols=>1, +table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :width=>5, :height=>5, + :variable=>table_list[page.value], + :titlerows=>1, :titlecols=>1, :coltagcommand=>proc{|n| colorize(n)}, - :flashmode=>true, :selectmode=>:extended, - :colstretch=>:unset, :rowstretch=>:unset, + :flashmode=>true, :selectmode=>:extended, + :colstretch=>:unset, :rowstretch=>:unset, :browsecommand=>proc{|e| cur_var.value = e.new_index}) -page.trace(:w, proc{|var, elem, op| +page.trace(:w, proc{|var, elem, op| changepage(table_list, table, entry, color, var, elem, op) }) @@ -128,7 +128,7 @@ m_file = TkMenu.new(menu) Tk.root.menu(menu) menu.add(:cascade, :label=>'File', :underline=>0, :menu=>m_file) -m_file.add(:command, :label=>'Fill Array', +m_file.add(:command, :label=>'Fill Array', :command=>proc{ fill_table(table_list, page.value) }) m_file.add(:command, :label=>'Quit', :command=>proc{exit}) Index: ext/tk/sample/tkextlib/tcllib/xyplot.rb =================================================================== --- ext/tk/sample/tkextlib/tcllib/xyplot.rb (revision 23917) +++ ext/tk/sample/tkextlib/tcllib/xyplot.rb (working copy) @@ -5,7 +5,7 @@ TkCanvas.new(:background=>'white', :width=>400, :height=>200){|c| pack(:fill=>:both) - Tk::Tcllib::Plotchart::XYPlot.new(c, [0.0, 100.0, 10.0], + Tk::Tcllib::Plotchart::XYPlot.new(c, [0.0, 100.0, 10.0], [0.0, 100.0, 20.0]){ [ [0.0, 32.0], [10.0, 50.0], [25.0, 60.0], [78.0, 11.0] ].each{|x, y| plot('series1', x, y) Index: ext/tk/sample/tkextlib/tcllib/datefield.rb =================================================================== --- ext/tk/sample/tkextlib/tcllib/datefield.rb (revision 23917) +++ ext/tk/sample/tkextlib/tcllib/datefield.rb (working copy) @@ -20,8 +20,8 @@ df = Tk::Tcllib::Datefield.new(:textvariable=>my_date1) Tk.grid(TkLabel.new(:text=>'Enter a date:', :anchor=>:e), df, :sticky=>:ew) -Tk.grid(TkLabel.new(:text=>'That date ia a:', :anchor=>:e), - TkLabel.new(:textvariable=>my_date2, :relief=>:sunken, :width=>12), +Tk.grid(TkLabel.new(:text=>'That date ia a:', :anchor=>:e), + TkLabel.new(:textvariable=>my_date2, :relief=>:sunken, :width=>12), :sticky=>:ew) df.set_focus Index: ext/tk/sample/tkextlib/tcllib/plotdemos1.rb =================================================================== --- ext/tk/sample/tkextlib/tcllib/plotdemos1.rb (revision 23917) +++ ext/tk/sample/tkextlib/tcllib/plotdemos1.rb (working copy) @@ -23,7 +23,7 @@ ############################### -s = Tk::Tcllib::Plotchart::XYPlot.new(c1, [0.0, 100.0, 10.0], +s = Tk::Tcllib::Plotchart::XYPlot.new(c1, [0.0, 100.0, 10.0], [0.0, 100.0, 20.0]) @@ -56,7 +56,7 @@ s = Tk::Tcllib::Plotchart::Piechart.new(c2) -s.plot([ ["Long names", 10], ["Short names", 30], +s.plot([ ["Long names", 10], ["Short names", 30], ["Average", 40], ["Ultra-short names", 5] ]) # @@ -78,7 +78,7 @@ ############################### -s = Tk::Tcllib::Plotchart::Barchart.new(hc1, %w(A B C D E), +s = Tk::Tcllib::Plotchart::Barchart.new(hc1, %w(A B C D E), [0.0, 10.0, 2.0], 2) s.plot('series1', [1.0, 4.0, 6.0, 1.0, 7.0], 'red') @@ -87,7 +87,7 @@ ############################### -s = Tk::Tcllib::Plotchart::Barchart.new(hc2, %w(A B C D E), +s = Tk::Tcllib::Plotchart::Barchart.new(hc2, %w(A B C D E), [0.0, 20.0, 5.0], :stacked) s.plot('series1', [1.0, 4.0, 6.0, 1.0, 7.0], 'red') @@ -96,7 +96,7 @@ ############################### -s = Tk::Tcllib::Plotchart::HorizontalBarchart.new(vc1, [0.0, 10.0, 2.0], +s = Tk::Tcllib::Plotchart::HorizontalBarchart.new(vc1, [0.0, 10.0, 2.0], %w(A B C D E), 2) s.plot('series1', [1.0, 4.0, 6.0, 1.0, 7.0], 'red') @@ -105,7 +105,7 @@ ############################### -s = Tk::Tcllib::Plotchart::HorizontalBarchart.new(vc2, [0.0, 20.0, 5.0], +s = Tk::Tcllib::Plotchart::HorizontalBarchart.new(vc2, [0.0, 20.0, 5.0], %w(A B C D E), :stacked) s.plot('series1', [1.0, 4.0, 6.0, 1.0, 7.0], 'red') @@ -114,7 +114,7 @@ ############################### -s = Tk::Tcllib::Plotchart::Timechart.new(vc3, "1 january 2004", +s = Tk::Tcllib::Plotchart::Timechart.new(vc3, "1 january 2004", "31 december 2004", 4) s.period("Spring", "1 march 2004", "1 june 2004", 'green') @@ -134,7 +134,7 @@ zc2 = TkCanvas.new(z, :background=>'white', :width=>400, :height=>250) Tk.pack(zc1,zc2) -s = Tk::Tcllib::Plotchart::Plot3D.new(zc1, +s = Tk::Tcllib::Plotchart::Plot3D.new(zc1, [0, 10, 3], [-10, 10, 10], [0, 10, 2.5]) s.title "3D Plot" @@ -145,12 +145,12 @@ 3.0 * (1.0-(x1*x1+y1*y1))*(1.0-(x1*x1+y1*y1)) } -s = Tk::Tcllib::Plotchart::Plot3D.new(zc2, +s = Tk::Tcllib::Plotchart::Plot3D.new(zc2, [0, 10, 3], [-10, 10, 10], [0, 10, 2.5]) s.title "3D Plot - data " s.colour("green", "black") -s.plot_data([ [1.0, 2.0, 1.0, 0.0], - [1.1, 3.0, 1.1, -0.5], +s.plot_data([ [1.0, 2.0, 1.0, 0.0], + [1.1, 3.0, 1.1, -0.5], [3.0, 1.0, 4.0, 5.0] ]) ############################### Index: ext/tk/sample/tkextlib/tcllib/plotdemos2.rb =================================================================== --- ext/tk/sample/tkextlib/tcllib/plotdemos2.rb (revision 23917) +++ ext/tk/sample/tkextlib/tcllib/plotdemos2.rb (working copy) @@ -12,7 +12,7 @@ ############################### # Set up a strip chart ############################### -slipchart = Tk::Tcllib::Plotchart::Stripchart.new(c1, [0.0, 100.0, 10.0], +slipchart = Tk::Tcllib::Plotchart::Stripchart.new(c1, [0.0, 100.0, 10.0], [0.0, 100.0, 20.0]) TkTimer.new(500, -1, proc{|obj| # obj --> TkTimer object @@ -34,7 +34,7 @@ ############################### # Set up an isometric plot ############################### -s = Tk::Tcllib::Plotchart::IsometricPlot.new(c2, [0.0, 100.0], [0.0, 200.0], +s = Tk::Tcllib::Plotchart::IsometricPlot.new(c2, [0.0, 100.0], [0.0, 200.0], :noaxes) s.set_zoom_pan @@ -50,8 +50,8 @@ h = TkToplevel.new(:title=>'h') c = TkCanvas.new(h, :bg=>'white', :width=>400, :height=>200).pack(:fill=>:both) -s = Tk::Tcllib::Plotchart::XYPlot.new(c, [0.0, 100.0, 10.0], - [0.0, 100.0, 20.0]) +s = Tk::Tcllib::Plotchart::XYPlot.new(c, [0.0, 100.0, 10.0], + [0.0, 100.0, 20.0]) s.dataconfig('series1', :colour=>'red', :type=>:symbol) s.dataconfig('series2', :colour=>'green', :type=>:both) Index: ext/tk/sample/tkextlib/tcllib/plotdemos3.rb =================================================================== --- ext/tk/sample/tkextlib/tcllib/plotdemos3.rb (revision 23917) +++ ext/tk/sample/tkextlib/tcllib/plotdemos3.rb (working copy) @@ -7,9 +7,9 @@ # Set up a strip chart ############################### -Tk::Tcllib::Plotchart::Stripchart.new([0.0, 100.0, 10.0], - [0.0, 100.0, 20.0], - :background=>'white', +Tk::Tcllib::Plotchart::Stripchart.new([0.0, 100.0, 10.0], + [0.0, 100.0, 20.0], + :background=>'white', :width=>400, :height=>200){|chart| title "Aha!" pack(:fill=>:both, :side=>:top) @@ -38,8 +38,8 @@ ############################### # Set up an isometric plot ############################### -Tk::Tcllib::Plotchart::IsometricPlot.new([0.0, 100.0], [0.0, 200.0], :noaxes, - :background=>'white', +Tk::Tcllib::Plotchart::IsometricPlot.new([0.0, 100.0], [0.0, 200.0], :noaxes, + :background=>'white', :width=>400, :height=>200){|chart| pack(:fill=>:both, :side=>:top) set_zoom_pan @@ -54,17 +54,17 @@ # Check the symbols ############################### TkToplevel.new(:title=>'h'){|h| - Tk::Tcllib::Plotchart::XYPlot.new(h, [0.0, 100.0, 10.0], - [0.0, 100.0, 20.0], - :bg=>'white', + Tk::Tcllib::Plotchart::XYPlot.new(h, [0.0, 100.0, 10.0], + [0.0, 100.0, 20.0], + :bg=>'white', :width=>400, :height=>200){|chart| pack(:fill=>:both) yconfig(:format=>"%12.2e") - series1 = Tk::Tcllib::Plotchart::PlotSeries.new(chart, :colour=>'red', + series1 = Tk::Tcllib::Plotchart::PlotSeries.new(chart, :colour=>'red', :type=>:symbol) - series2 = Tk::Tcllib::Plotchart::PlotSeries.new(chart, :colour=>'green', + series2 = Tk::Tcllib::Plotchart::PlotSeries.new(chart, :colour=>'green', :type=>:both) x = 5.0 Index: ext/tk/sample/tkextlib/vu/dial_demo.rb =================================================================== --- ext/tk/sample/tkextlib/vu/dial_demo.rb (revision 23917) +++ ext/tk/sample/tkextlib/vu/dial_demo.rb (working copy) @@ -12,61 +12,61 @@ v_linked = TkVariable.new v_needle = TkVariable.new -volume = Tk::Vu::Dial.new(:label=>"Volume", :from=>-0.1, :to=>0.1, - :resolution=>0.001, :minortickinterval=>0.01, - :tickinterval=>0.1, :beginangle=>-20, +volume = Tk::Vu::Dial.new(:label=>"Volume", :from=>-0.1, :to=>0.1, + :resolution=>0.001, :minortickinterval=>0.01, + :tickinterval=>0.1, :beginangle=>-20, :endangle=>260, :variable=>v_volume) -speed = Tk::Vu::Dial.new(:label=>"Speed", :from=>2000, :to=>100, - :resolution=>10, :tickinterval=>100, - :minortickinterval=>0, :variable=>v_speed, +speed = Tk::Vu::Dial.new(:label=>"Speed", :from=>2000, :to=>100, + :resolution=>10, :tickinterval=>100, + :minortickinterval=>0, :variable=>v_speed, :showtags=>:label, :showvalue=>false) speed.set_tag_constrain(100, 'Fast', 2000, 'Slow') -fwd = Tk::Vu::Dial.new(:from=>-10.0, :to=>-20.0, :resolution=>0.1, - :tickinterval=>5.0, :minortickinterval=>1.0, +fwd = Tk::Vu::Dial.new(:from=>-10.0, :to=>-20.0, :resolution=>0.1, + :tickinterval=>5.0, :minortickinterval=>1.0, :variable=>v_dir) -rev = Tk::Vu::Dial.new(:from=>-20.0, :to=>-10.0, :resolution=>0.1, - :tickinterval=>5.0, :minortickinterval=>1.0, +rev = Tk::Vu::Dial.new(:from=>-20.0, :to=>-10.0, :resolution=>0.1, + :tickinterval=>5.0, :minortickinterval=>1.0, :variable=>v_dir) -small = Tk::Vu::Dial.new(:font=>"Helvetica -10", :from=>0, :to=>10, +small = Tk::Vu::Dial.new(:font=>"Helvetica -10", :from=>0, :to=>10, :resolution=>0.05, :tickinterval=>2, - :minortickinterval=>0.5, :radius=>20, - :dialcolor=>'red2', :activebackground=>'red', + :minortickinterval=>0.5, :radius=>20, + :dialcolor=>'red2', :activebackground=>'red', :variable=>v_rot) -large = Tk::Vu::Dial.new(:font=>"Helvetica -8", :from=>0, :to=>10, +large = Tk::Vu::Dial.new(:font=>"Helvetica -8", :from=>0, :to=>10, :resolution=>0.05, :tickinterval=>1, - :minortickinterval=>0.25, :radius=>40, - :dialcolor=>'red2', :activebackground=>'red', + :minortickinterval=>0.25, :radius=>40, + :dialcolor=>'red2', :activebackground=>'red', :variable=>v_rot) -turn = Tk::Vu::Dial.new(:needlecolor=>'red', :label=>"Linked", +turn = Tk::Vu::Dial.new(:needlecolor=>'red', :label=>"Linked", :variable=>v_linked) scale = TkScale.new(:label=>"Linked", :variable=>v_linked) -d1 = Tk::Vu::Dial.new(:resolution=>0.0001, :from=>-0.1, :to=>0.1, - :showvalue=>true, :minortickinterval=>0.01, - :tickinterval=>0.1, :radius=>30, :label=>"Dial", - :beginangle=>-20, :endangle=>260, :variable=>v_needle, +d1 = Tk::Vu::Dial.new(:resolution=>0.0001, :from=>-0.1, :to=>0.1, + :showvalue=>true, :minortickinterval=>0.01, + :tickinterval=>0.1, :radius=>30, :label=>"Dial", + :beginangle=>-20, :endangle=>260, :variable=>v_needle, :relief=>:raised) -d2 = Tk::Vu::Dial.new(:resolution=>0.01, :from=>-0.1, :to=>0.1, - :showvalue=>true, :minortickinterval=>0.01, - :tickinterval=>0.1, :radius=>30, :label=>"Dial 2", - :beginangle=>-20, :endangle=>260, :variable=>v_needle, - :dialrelief=>:flat, :needlecolor=>'red', +d2 = Tk::Vu::Dial.new(:resolution=>0.01, :from=>-0.1, :to=>0.1, + :showvalue=>true, :minortickinterval=>0.01, + :tickinterval=>0.1, :radius=>30, :label=>"Dial 2", + :beginangle=>-20, :endangle=>260, :variable=>v_needle, + :dialrelief=>:flat, :needlecolor=>'red', :needletype=>:triangle, :relief=>:sunken) -d3 = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1, - :showvalue=>true, :minortickinterval=>0.01, - :tickinterval=>0.1, :radius=>30, :label=>"Dial 3", - :beginangle=>-20, :endangle=>260, :variable=>v_needle, - :dialrelief=>:flat, :needlecolor=>'blue', +d3 = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1, + :showvalue=>true, :minortickinterval=>0.01, + :tickinterval=>0.1, :radius=>30, :label=>"Dial 3", + :beginangle=>-20, :endangle=>260, :variable=>v_needle, + :dialrelief=>:flat, :needlecolor=>'blue', :needletype=>:arc, :relief=>:ridge) f_btns = TkFrame.new Index: ext/tk/sample/tkextlib/vu/pie.rb =================================================================== --- ext/tk/sample/tkextlib/vu/pie.rb (revision 23917) +++ ext/tk/sample/tkextlib/vu/pie.rb (working copy) @@ -26,13 +26,13 @@ Tk.grid(pie, :sticky=>:news) Tk.grid(f, :sticky=>:ew) -Tk.pack(fast_btn, slow_btn, quit_btn, +Tk.pack(fast_btn, slow_btn, quit_btn, :in=>f, :side=>:left, :fill=>:both, :expand=>true, :padx=>6, :pady=>4) Tk.root.grid_columnconfigure(0, :weight=>1) Tk.root.grid_rowconfigure(0, :weight=>1) -priv = { +priv = { :x=>0, :y=>0, :pie_in=>false, :angle=>pie[:angle], :origin=>pie[:origin] } @@ -46,9 +46,9 @@ pie.bind('B1-Motion', proc{|w, x, y| if priv[:pie_in] - w.configure(:angle=>priv[:angle] + (priv[:y] - y)/3, - :origin=>(priv[:origin] + - ((w.winfo_height/2.2 > y)? -1: 1) * + w.configure(:angle=>priv[:angle] + (priv[:y] - y)/3, + :origin=>(priv[:origin] + + ((w.winfo_height/2.2 > y)? -1: 1) * (priv[:x] - x)/3) % 360) end }, '%W %x %y') Index: ext/tk/sample/tkextlib/vu/canvSticker2.rb =================================================================== --- ext/tk/sample/tkextlib/vu/canvSticker2.rb (revision 23917) +++ ext/tk/sample/tkextlib/vu/canvSticker2.rb (working copy) @@ -10,7 +10,7 @@ begin st = Tk::Vu::TkcSticker.new(c, 0, 0, 10, 10) rescue - Tk.messageBox(:type=>'ok', :title=>"No sticker Item", + Tk.messageBox(:type=>'ok', :title=>"No sticker Item", :message=>"This build of vu does not include the sticker item") exit end @@ -22,7 +22,7 @@ #sti_conf = [ [10, 10, 180, 180], "Sticker äöüß@²³¼½¾", :center ] #txt_conf = [ [210, 210], "Text äöüß@²³¼½¾", :center ] -sti_conf = [ [10, 10, 350, 350], +sti_conf = [ [10, 10, 350, 350], Tk::UTF8_String('Sticker \u00E4\u00F6\u00FC\u00DF\u0040\u00B2\u00B3\u00BC\u00BD\u00BE'), :center ] txt_conf = [ [250, 250], Index: ext/tk/sample/tkextlib/vu/oscilloscope.rb =================================================================== --- ext/tk/sample/tkextlib/vu/oscilloscope.rb (revision 23917) +++ ext/tk/sample/tkextlib/vu/oscilloscope.rb (working copy) @@ -22,26 +22,26 @@ c = TkCanvas.new(:width=>220, :height=>190).pack(:fill=>:both, :expand=>true) #---background -TkcRectangle.new(c, geo_fr, :width=>4, :fill=>'aquamarine3', +TkcRectangle.new(c, geo_fr, :width=>4, :fill=>'aquamarine3', :tags=>['osc', 'frbg']) #---channel 0 -ch0 = Tk::Vu::TkcStripchart.new(c, geo_ch0, - :fill=>'', :jumpscroll=>false, - :outline=>'', :scaleline=>'', +ch0 = Tk::Vu::TkcStripchart.new(c, geo_ch0, + :fill=>'', :jumpscroll=>false, + :outline=>'', :scaleline=>'', :stripline=>'cyan', :tags=>['osc', 'ch0']) #---channel 1 -ch1 = Tk::Vu::TkcStripchart.new(c, geo_ch1, - :fill=>'', :jumpscroll=>0, - :outline=>'', :scaleline=>'', +ch1 = Tk::Vu::TkcStripchart.new(c, geo_ch1, + :fill=>'', :jumpscroll=>0, + :outline=>'', :scaleline=>'', :stripline=>'red', :tags=>['osc', 'ch1']) #---frame TkcRectangle.new(c, geo_fr, :width=>4, :tags=>['osc', 'frfg']) #---position -txt1 = TkcText.new(c, geo_t1, :text=>"B1-Motion: X:%X\tY:%Y", +txt1 = TkcText.new(c, geo_t1, :text=>"B1-Motion: X:%X\tY:%Y", :anchor=>:nw, :tags=>['osc', 'txt1']) #---BINDINGS Index: ext/tk/sample/tkextlib/vu/vu_demo.rb =================================================================== --- ext/tk/sample/tkextlib/vu/vu_demo.rb (revision 23917) +++ ext/tk/sample/tkextlib/vu/vu_demo.rb (working copy) @@ -9,13 +9,13 @@ speed = TkVariable.new(0) -dial = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1, - :showvalue=>true, :minortickinterval=>0.01, - :tickinterval=>0.1, :radius=>50, :label=>"Dial", - :beginangle=>-20, :endangle=>260, :dialcolor=>'red3', +dial = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1, + :showvalue=>true, :minortickinterval=>0.01, + :tickinterval=>0.1, :radius=>50, :label=>"Dial", + :beginangle=>-20, :endangle=>260, :dialcolor=>'red3', :active=>'red2', :variable=>speed) -bar = Tk::Vu::Bargraph.new(:from=>0, :to=>100, :relief=>:groove, +bar = Tk::Vu::Bargraph.new(:from=>0, :to=>100, :relief=>:groove, :border=>2, :label=>"Bar Chart") ####################################### @@ -26,7 +26,7 @@ current = 50 def rand_bool - + end update = TkTimer.new(200, -1, proc{ @@ -61,7 +61,7 @@ Tk.grid(quit, '-', '-', :sticky=>:ew, :padx=>4, :pady=>4) Tk.root.grid_columnconfigure(2, :weight=>1) Tk.root.grid_rowconfigure(1, :weight=>1) - + ####################################### Tk.mainloop Index: ext/tk/sample/tkextlib/vu/canvItems.rb =================================================================== --- ext/tk/sample/tkextlib/vu/canvItems.rb (revision 23917) +++ ext/tk/sample/tkextlib/vu/canvItems.rb (working copy) @@ -9,63 +9,63 @@ sval = [ 11, 22, 33, 44, 55, 66, 77, 88, 99 ] -l0 = TkLabel.new(:width=>128, :height=>128, +l0 = TkLabel.new(:width=>128, :height=>128, :bitmap=>"@#{xbm}", :relief=>:groove).pack(:side=>:left) -c0 = TkCanvas.new(:width=>80, :height=>80, - :insertwidth=>0, :highlightthickness=>0, - :selectborderwidth=>0, :borderwidth=>2, - :relief=>:ridge).place(:in=>l0, :relx=>0.5, :rely=>0.5, +c0 = TkCanvas.new(:width=>80, :height=>80, + :insertwidth=>0, :highlightthickness=>0, + :selectborderwidth=>0, :borderwidth=>2, + :relief=>:ridge).place(:in=>l0, :relx=>0.5, :rely=>0.5, :anchor=>:c) -st = Tk::Vu::TkcStripchart.new(c0, 3, 3, 80, 80, - :background=>"#b7c0d7", :fill=>'slategray3', - :jumpscroll=>1, :outline=>'black', - :scaleline=>'blue', :stripline=>'red', +st = Tk::Vu::TkcStripchart.new(c0, 3, 3, 80, 80, + :background=>"#b7c0d7", :fill=>'slategray3', + :jumpscroll=>1, :outline=>'black', + :scaleline=>'blue', :stripline=>'red', :selected=>1, :values=>sval) -TkcText.create(c0, 40, 40, +TkcText.create(c0, 40, 40, :text=>Tk::TCL_PATCHLEVEL, :fill=>'cyan', :tags=>'text') -l1 = TkLabel.new(:width=>128, :height=>128, +l1 = TkLabel.new(:width=>128, :height=>128, :bitmap=>"@#{xbm}", :relief=>:groove).pack(:side=>:left) -c1 = TkCanvas.new(:width=>80, :height=>80, - :insertwidth=>0, :highlightthickness=>0, - :selectborderwidth=>0, :borderwidth=>2, - :relief=>:ridge).place(:in=>l1, :relx=>0.5, :rely=>0.5, +c1 = TkCanvas.new(:width=>80, :height=>80, + :insertwidth=>0, :highlightthickness=>0, + :selectborderwidth=>0, :borderwidth=>2, + :relief=>:ridge).place(:in=>l1, :relx=>0.5, :rely=>0.5, :anchor=>:c) -bar1 = Tk::Vu::TkcBarchart.new(c1, 3, 3, 80, 80, - :background=>"#b7c0d7", :scalevalue=>10.0, - :autocolor=>true, :selected=>1, - :outline=>'black', :barline=>'yellow', +bar1 = Tk::Vu::TkcBarchart.new(c1, 3, 3, 80, 80, + :background=>"#b7c0d7", :scalevalue=>10.0, + :autocolor=>true, :selected=>1, + :outline=>'black', :barline=>'yellow', :scalelinestyle=>0) -bar2 = Tk::Vu::TkcBarchart.new(c1, 53, 3, 80, 80, - :background=>"#b7c0d7", :scalevalue=>10.0, - :autocolor=>true, :selected=>1, - :outline=>'black', :fill=>"#b7c0d7", +bar2 = Tk::Vu::TkcBarchart.new(c1, 53, 3, 80, 80, + :background=>"#b7c0d7", :scalevalue=>10.0, + :autocolor=>true, :selected=>1, + :outline=>'black', :fill=>"#b7c0d7", :barline=>'red', :scalelinestyle=>22) -l2 = TkLabel.new(:width=>128, :height=>128, +l2 = TkLabel.new(:width=>128, :height=>128, :bitmap=>"@#{xbm}", :relief=>:groove).pack(:side=>:left) -c2 = TkCanvas.new(:width=>80, :height=>80, - :insertwidth=>0, :highlightthickness=>0, - :selectborderwidth=>0, :borderwidth=>2, - :relief=>:ridge).place(:in=>l2, :relx=>0.5, :rely=>0.5, +c2 = TkCanvas.new(:width=>80, :height=>80, + :insertwidth=>0, :highlightthickness=>0, + :selectborderwidth=>0, :borderwidth=>2, + :relief=>:ridge).place(:in=>l2, :relx=>0.5, :rely=>0.5, :anchor=>:c) begin - stick = Tk::Vu::TkcSticker.new(c2, 3, 3, 80, 80, - :text=>"Tcl/Tk", :space=>0, :color=>'red', - :outline=>'red', :font=>'Helvetica 14 bold', - :fill=>'', :stipple=>'', :bar=>'blue', - :orient=>:vertical, :anchor=>:s, - :relheight=>1.0, :relwidth=>0.15, + stick = Tk::Vu::TkcSticker.new(c2, 3, 3, 80, 80, + :text=>"Tcl/Tk", :space=>0, :color=>'red', + :outline=>'red', :font=>'Helvetica 14 bold', + :fill=>'', :stipple=>'', :bar=>'blue', + :orient=>:vertical, :anchor=>:s, + :relheight=>1.0, :relwidth=>0.15, :relx=>0.1, :rely=>0.0) rescue stick = nil Index: ext/tk/sample/tkextlib/vu/canvSticker.rb =================================================================== --- ext/tk/sample/tkextlib/vu/canvSticker.rb (revision 23917) +++ ext/tk/sample/tkextlib/vu/canvSticker.rb (working copy) @@ -14,7 +14,7 @@ begin st = Tk::Vu::TkcSticker.new(c, 0, 0, 10, 10) rescue - Tk.messageBox(:type=>'ok', :title=>"No sticker Item", + Tk.messageBox(:type=>'ok', :title=>"No sticker Item", :message=>"This build of vu does not include the sticker item") exit end @@ -56,7 +56,7 @@ steps << proc{ puts 'A vertical bar appears in the lower right region and text jumps to the left.' - st.configure(:anchor=>:n, :relw=>0.3, :relh=>0.7, + st.configure(:anchor=>:n, :relw=>0.3, :relh=>0.7, :relx=>0.6, :rely=>0.3, :bar=>'red') } Index: ext/tk/sample/tkextlib/ICONS/viewIcons.rb =================================================================== --- ext/tk/sample/tkextlib/ICONS/viewIcons.rb (revision 23917) +++ ext/tk/sample/tkextlib/ICONS/viewIcons.rb (working copy) @@ -4,7 +4,7 @@ # # -- Display icons from icon library. # -# -- Copy the clicked icon data (command string of creating +# -- Copy the clicked icon data (command string of creating # a TkPhotoImage instance) to the clipboard. # require 'tk' @@ -27,7 +27,7 @@ ent_library = TkEntry.new(base, :width=>50, :textvariable=>@library) ent_groups = TkEntry.new(base, :width=>50, :textvariable=>@groups) - btn_browse = TkButton.new(base, :text=>'Browse', + btn_browse = TkButton.new(base, :text=>'Browse', :command=>method(:select_icons)) btn_view = TkButton.new(base, :text=>'View', :command=>method(:display_icons)) @@ -35,8 +35,8 @@ @column_btns = {} 6.step(20, 2){|i| - @column_btns[i] = TkButton.new(columns, - :text=>i.to_s, :width=>2, + @column_btns[i] = TkButton.new(columns, + :text=>i.to_s, :width=>2, :command=>proc{set_columns(i)} ).pack(:side=>:left) } @@ -90,15 +90,15 @@ end def _create_info_window - @info_window = TkToplevel.new(:background=>'lightyellow', :borderwidth=>1, + @info_window = TkToplevel.new(:background=>'lightyellow', :borderwidth=>1, :relief=>:solid){|w| - lbl_name = TkLabel.new(w, :text=>'Name', :background=>'lightyellow', + lbl_name = TkLabel.new(w, :text=>'Name', :background=>'lightyellow', :font=>@boldfont, :justify=>:left) - lbl_grps = TkLabel.new(w, :text=>'Groups', :background=>'lightyellow', + lbl_grps = TkLabel.new(w, :text=>'Groups', :background=>'lightyellow', :font=>@boldfont, :justify=>:left) - lbl_type = TkLabel.new(w, :text=>'Type', :background=>'lightyellow', + lbl_type = TkLabel.new(w, :text=>'Type', :background=>'lightyellow', :font=>@boldfont, :justify=>:left) - lbl_size = TkLabel.new(w, :text=>'Size', :background=>'lightyellow', + lbl_size = TkLabel.new(w, :text=>'Size', :background=>'lightyellow', :font=>@boldfont, :justify=>:left) lbl_name.grid(:row=>0, :column=>0, :sticky=>:w) @@ -192,7 +192,7 @@ def cancel_info if @delay_timer - @delay_timer.cancel + @delay_timer.cancel @delay_timer = nil end @info_window.withdraw @@ -242,9 +242,9 @@ TkClipboard.append(@command) if Tk::PLATFORM['platform'] == 'unix' - TkSelection.handle(Tk.root, method(:primary_transfer), + TkSelection.handle(Tk.root, method(:primary_transfer), :selection=>'PRIMARY') - TkSelection.set_owner(Tk.root, :selection=>'PRIMARY', + TkSelection.set_owner(Tk.root, :selection=>'PRIMARY', :command=>method(:lost_selection)) end @@ -256,17 +256,17 @@ bbox = @icons_window.bbox('all') width = @controls.winfo_width - @icons_window.yscrollbar.winfo_width - 8 - @icons_window.configure(:width=>width, :scrollregion=>bbox, - :xscrollincrement=>'0.1i', + @icons_window.configure(:width=>width, :scrollregion=>bbox, + :xscrollincrement=>'0.1i', :yscrollincrement=>'0.1i') end def select_icons - new_lib = Tk.getOpenFile(:initialdir=>@initial_dir, - :initialfile=>'tkIcons', - :title=>'Select Icon Library', + new_lib = Tk.getOpenFile(:initialdir=>@initial_dir, + :initialfile=>'tkIcons', + :title=>'Select Icon Library', :filetypes=>[ - ['Icon Libraries', ['tkIcons*']], + ['Icon Libraries', ['tkIcons*']], ['All Files', ['*']] ]) @@ -280,7 +280,7 @@ row = 0 unless File.exist?(@library.value) - Tk.messageBox(:icon=>'warning', :message=>'File does not exist', + Tk.messageBox(:icon=>'warning', :message=>'File does not exist', :title=>'viewIcons') return end Index: ext/tk/sample/tkextlib/tkimg/demo.rb =================================================================== --- ext/tk/sample/tkextlib/tkimg/demo.rb (revision 23917) +++ ext/tk/sample/tkextlib/tkimg/demo.rb (working copy) @@ -2,7 +2,7 @@ # # Tk::Img demo # -# -- This script is based on demo.tcl of Tcl/Tk's 'Img' extention. +# -- This script is based on demo.tcl of Tcl/Tk's 'Img' extention. # Image data in this script is those of demo.tcl. # Please read 'license_terms_of_Img_extension' file. # @@ -85,7 +85,7 @@ Tk.update_idletasks Tk.after(20, proc{update_animated_gif(w, :image, 0)}) rescue => e - w.configure(:text=>"error displaying animated gif:\n#{e.message}", + w.configure(:text=>"error displaying animated gif:\n#{e.message}", :image=>'', :relief=>:ridge) end w.pack @@ -98,15 +98,15 @@ TkLabel.new(@typeFrame[fmt], :text=>"#{fmt} : ").pack(:side=>:left) end begin - f = TkFrame.new(@typeFrame[fmt], + f = TkFrame.new(@typeFrame[fmt], :borderwidth=>2, :relief=>:ridge).pack(:side=>:left) im = TkPhotoImage.new(:data=>data) im['data'] = '' TkLabel.new(f, :image=>im).pack - TkLabel.new(f, :text=>type, :borderwidth=>0, :pady=>0, :padx=>2, + TkLabel.new(f, :text=>type, :borderwidth=>0, :pady=>0, :padx=>2, :font=>'Helvetica 8').pack rescue => e - TkMessage.new(f, :text=>"error displaying #{type} image: #{e.message}", + TkMessage.new(f, :text=>"error displaying #{type} image: #{e.message}", :aspect=>250).pack end Tk.update Index: ext/tk/sample/tkextlib/tile/themes/kroc.rb =================================================================== --- ext/tk/sample/tkextlib/tile/themes/kroc.rb (revision 23917) +++ ext/tk/sample/tkextlib/tile/themes/kroc.rb (working copy) @@ -1,5 +1,5 @@ # -# kroc.rb +# kroc.rb # # based on: # >> kroc.tcl - Copyright (C) 2004 David Zolli @@ -15,30 +15,30 @@ end def kroc_rb_settings - # Tk::Tile::Style.default(TkRoot, :background=>'#FCB64F', + # Tk::Tile::Style.default(TkRoot, :background=>'#FCB64F', # :troughcolor=>'#F8C278', :borderwidth=>1) # or - # Tk::Tile::Style.default(Tk.root, :background=>'#FCB64F', + # Tk::Tile::Style.default(Tk.root, :background=>'#FCB64F', # :troughcolor=>'#F8C278', :borderwidth=>1) # or - # Tk::Tile::Style.default('.', :background=>'#FCB64F', + # Tk::Tile::Style.default('.', :background=>'#FCB64F', # :troughcolor=>'#F8C278', :borderwidth=>1) # or - # Tk::Tile::Style.default(nil, :background=>'#FCB64F', + # Tk::Tile::Style.default(nil, :background=>'#FCB64F', # :troughcolor=>'#F8C278', :borderwidth=>1) # or - Tk::Tile::Style.default(:background=>'#FCB64F', :troughcolor=>'#F8C278', + Tk::Tile::Style.default(:background=>'#FCB64F', :troughcolor=>'#F8C278', :borderwidth=>1) - # Tk::Tile::Style.default(TkRoot, :font=>Tk::Tile::Font::Default, + # Tk::Tile::Style.default(TkRoot, :font=>Tk::Tile::Font::Default, # :borderwidth=>1) # or - # Tk::Tile::Style.default(Tk.root, :font=>Tk::Tile::Font::Default, + # Tk::Tile::Style.default(Tk.root, :font=>Tk::Tile::Font::Default, # :borderwidth=>1) # or - # Tk::Tile::Style.default('.', :font=>Tk::Tile::Font::Default, + # Tk::Tile::Style.default('.', :font=>Tk::Tile::Font::Default, # :borderwidth=>1) # or - # Tk::Tile::Style.default(nil, :font=>Tk::Tile::Font::Default, + # Tk::Tile::Style.default(nil, :font=>Tk::Tile::Font::Default, # :borderwidth=>1) # or Tk::Tile::Style.default(:font=>Tk::Tile::Font::Default, :borderwidth=>1) @@ -57,37 +57,37 @@ # Tk::Tile::Style.default('TButton', :padding=>[10,4]) Tk::Tile::Style.default(Tk::Tile::TButton, :padding=>[10,4]) - # Tk::Tile::Style.default('TNotebook.Tab', - Tk::Tile::Style.default($TNotebook_Tab, + # Tk::Tile::Style.default('TNotebook.Tab', + Tk::Tile::Style.default($TNotebook_Tab, :padding=>[10, 3], :font=>Tk::Tile::Font::Default) - # Tk::Tile::Style.map('TNotebook.Tab', - Tk::Tile::Style.map($TNotebook_Tab, - :background=>[:selected, '#FCB64F', '', '#FFE6BA'], - :foreground=>['', 'black'], + # Tk::Tile::Style.map('TNotebook.Tab', + Tk::Tile::Style.map($TNotebook_Tab, + :background=>[:selected, '#FCB64F', '', '#FFE6BA'], + :foreground=>['', 'black'], :padding=>[:selected, [10, 6, 10, 3]]) - # Tk::Tile::Style.map('TScrollbar', - Tk::Tile::Style.map(Tk::Tile::TScrollbar, - :background=>[:pressed, '#694418'], - :arrowcolor=>[:pressed, '#FEF7CB'], + # Tk::Tile::Style.map('TScrollbar', + Tk::Tile::Style.map(Tk::Tile::TScrollbar, + :background=>[:pressed, '#694418'], + :arrowcolor=>[:pressed, '#FEF7CB'], :relief=>[:pressed, :sunken]) - # Tk::Tile::Style.layout('Vertical.TScrollbar', - Tk::Tile::Style.layout(Tk::Tile.style('Vertical', Tk::Tile::TScrollbar), + # Tk::Tile::Style.layout('Vertical.TScrollbar', + Tk::Tile::Style.layout(Tk::Tile.style('Vertical', Tk::Tile::TScrollbar), ['Scrollbar.trough', {:children=>[ - 'Scrollbar.uparrow', {:side=>:top}, - 'Scrollbar.downarrow', {:side=>:bottom}, - 'Scrollbar.uparrow', {:side=>:bottom}, + 'Scrollbar.uparrow', {:side=>:top}, + 'Scrollbar.downarrow', {:side=>:bottom}, + 'Scrollbar.uparrow', {:side=>:bottom}, 'Scrollbar.thumb', {:side=>:top, :expand=>true} ]} ]) - # Tk::Tile::Style.layout('Horizontal.TScrollbar', - Tk::Tile::Style.layout(Tk::Tile.style('Horizontal', Tk::Tile::TScrollbar), + # Tk::Tile::Style.layout('Horizontal.TScrollbar', + Tk::Tile::Style.layout(Tk::Tile.style('Horizontal', Tk::Tile::TScrollbar), ['Scrollbar.trough', {:children=>[ - 'Scrollbar.leftarrow', {:side=>:left}, - 'Scrollbar.rightarrow', {:side=>:right}, - 'Scrollbar.leftarrow', {:side=>:right}, + 'Scrollbar.leftarrow', {:side=>:left}, + 'Scrollbar.rightarrow', {:side=>:right}, + 'Scrollbar.leftarrow', {:side=>:right}, 'Scrollbar.thumb', {:side=>:left, :expand=>true} ]} ]) @@ -96,15 +96,15 @@ # Elements: # if Tk::Tile::TILE_SPEC_VERSION_ID >= 8 - Tk::Tile::Style.element_create('Button.button', - :image, + Tk::Tile::Style.element_create('Button.button', + :image, [ $images['button-n'], - :pressed, $images['button-p'], - :active, $images['button-h'], + :pressed, $images['button-p'], + :active, $images['button-h'], ], :border=>3, :sticky=>:ew) - Tk::Tile::Style.element_create('Checkbutton.indicator', - :image, + Tk::Tile::Style.element_create('Checkbutton.indicator', + :image, [ $images['check-nu'], [:pressed, :selected],$images['check-nc'], :pressed, $images['check-nu'], @@ -113,8 +113,8 @@ :selected, $images['check-nc'], ], :sticky=>:w) - Tk::Tile::Style.element_create('Radiobutton.indicator', - :image, + Tk::Tile::Style.element_create('Radiobutton.indicator', + :image, [ $images['radio-nu'], [:pressed,:selected],$images['radio-nc'], :pressed, $images['radio-nu'], @@ -124,14 +124,14 @@ ], :sticky=>:w) elsif TkPackage.vcompare(Tk::Tile.package_version, '0.5') >= 0 - Tk::Tile::Style.element_create('Button.button', + Tk::Tile::Style.element_create('Button.button', :image, $images['button-n'], :map=>[ - :pressed, $images['button-p'], - :active, $images['button-h'], + :pressed, $images['button-p'], + :active, $images['button-h'], ], :border=>3, :sticky=>:ew) - Tk::Tile::Style.element_create('Checkbutton.indicator', + Tk::Tile::Style.element_create('Checkbutton.indicator', :image, $images['check-nu'], :map=>[ [:pressed, :selected],$images['check-nc'], @@ -141,7 +141,7 @@ :selected, $images['check-nc'], ], :sticky=>:w) - Tk::Tile::Style.element_create('Radiobutton.indicator', + Tk::Tile::Style.element_create('Radiobutton.indicator', :image, $images['radio-nu'], :map=>[ [:pressed, :selected],$images['radio-nc'], @@ -152,14 +152,14 @@ ], :sticky=>:w) else # tile 0.4 or earlier - Tk::Tile::Style.element_create('Button.button', :pixmap, + Tk::Tile::Style.element_create('Button.button', :pixmap, :images=>[ - :pressed, $images['button-p'], - :active, $images['button-h'], + :pressed, $images['button-p'], + :active, $images['button-h'], '', $images['button-n'] ], :border=>3, :tiling=>:tile) - Tk::Tile::Style.element_create('Checkbutton.indicator', :pixmap, + Tk::Tile::Style.element_create('Checkbutton.indicator', :pixmap, :images=>[ [:pressed, :selected],$images['check-nc'], :pressed, $images['check-nu'], @@ -169,7 +169,7 @@ '', $images['check-nu'], ], :tiling=>:fixed) - Tk::Tile::Style.element_create('Radiobutton.indicator', :pixmap, + Tk::Tile::Style.element_create('Radiobutton.indicator', :pixmap, :images=>[ [:pressed, :selected],$images['radio-nc'], :pressed, $images['radio-nu'], @@ -184,7 +184,7 @@ # # Settings: # - # Tk::Tile::Style.layout(Tk::Tile::TButton, + # Tk::Tile::Style.layout(Tk::Tile::TButton, Tk::Tile::Style.layout('TButton', [ 'Button.button', {:children=>[ 'Button.focus', {:children=>[ @@ -195,12 +195,12 @@ ]} ]) - # Tk::Tile::Style.layout(Tk::Tile::TCheckbutton, + # Tk::Tile::Style.layout(Tk::Tile::TCheckbutton, Tk::Tile::Style.layout('TCheckbutton', [ 'Checkbutton.background', # this is not needed in tile 0.5 or later 'Checkbutton.border', {:children=>[ 'Checkbutton.padding', {:children=>[ - 'Checkbutton.indicator', {:side=>:left}, + 'Checkbutton.indicator', {:side=>:left}, 'Checkbutton.focus', {:side=>:left, :children=>[ 'Checkbutton.label' ]} @@ -208,12 +208,12 @@ ]} ]) - # Tk::Tile::Style.layout(Tk::Tile::TRadiobutton, + # Tk::Tile::Style.layout(Tk::Tile::TRadiobutton, Tk::Tile::Style.layout('TRadiobutton', [ 'Radiobutton.background', # this is not needed in tile 0.5 or later 'Radiobutton.border', {:children=>[ 'Radiobutton.padding', {:children=>[ - 'Radiobutton.indicator', {:side=>:left}, + 'Radiobutton.indicator', {:side=>:left}, 'Radiobutton.focus', {:expand=>true, :sticky=>:w, :children=>[ 'Radiobutton.label', {:side=>:right, :expand=>true} ]} @@ -222,5 +222,5 @@ ]) end -Tk::Tile::Style.theme_create('kroc-rb', :parent=>'alt', +Tk::Tile::Style.theme_create('kroc-rb', :parent=>'alt', :settings=>proc{ kroc_rb_settings() }) Index: ext/tk/sample/tkextlib/tile/demo.rb =================================================================== --- ext/tk/sample/tkextlib/tile/demo.rb (revision 23917) +++ ext/tk/sample/tkextlib/tile/demo.rb (working copy) @@ -34,7 +34,7 @@ # This forces an update of the available packages list. It's required # for package names to find the themes in demos/themes/*.tcl ## Tk.tk_call(TkPackage.unknown_proc, 'Tcl', TkPackage.provide('Tcl')) -## --> This doesn't work. +## --> This doesn't work. ## Because, unknown_proc may be "command + some arguments". Tk.ip_eval("#{TkPackage.unknown_proc} Tcl #{TkPackage.provide('Tcl')}") @@ -45,18 +45,18 @@ # The descriptive names of the builtin themes. $THEMELIST = [ - ['default', 'Default'], - ['classic', 'Classic'], - ['alt', 'Revitalized'], - ['winnative', 'Windows native'], - ['xpnative', 'XP Native'], - ['aqua', 'Aqua'], + ['default', 'Default'], + ['classic', 'Classic'], + ['alt', 'Revitalized'], + ['winnative', 'Windows native'], + ['xpnative', 'XP Native'], + ['aqua', 'Aqua'], ] -$V = TkVariable.new_hash(:THEME => 'default', - :COMPOUND => 'top', - :CONSOLE => false, - :MENURADIO1 => 'One', +$V = TkVariable.new_hash(:THEME => 'default', + :COMPOUND => 'top', + :CONSOLE => false, + :MENURADIO1 => 'One', :MENUCHECK1 => true, :PBMODE => 'determinate', :SELECTED => true, @@ -84,8 +84,8 @@ def makeThemeControl(parent) c = Tk::Tile::Labelframe.new(parent, :text=>'Theme') $THEMELIST.each{|theme, name| - b = Tk::Tile::Radiobutton.new(c, :text=>name, :value=>theme, - :variable=>$V.ref(:THEME), + b = Tk::Tile::Radiobutton.new(c, :text=>name, :value=>theme, + :variable=>$V.ref(:THEME), :command=>proc{setTheme(theme)}) b.grid(:sticky=>:ew) unless (TkPackage.names.find{|n| n =~ /(tile|ttk)::theme::#{theme}/}) @@ -93,8 +93,8 @@ end } $RUBY_THEMELIST.each{|theme, name, available| - b = Tk::Tile::Radiobutton.new(c, :text=>name, :value=>theme, - :variable=>$V.ref(:THEME), + b = Tk::Tile::Radiobutton.new(c, :text=>name, :value=>theme, + :variable=>$V.ref(:THEME), :command=>proc{setTheme(theme)}) b.grid(:sticky=>:ew) b.ttk_state(:disabled) unless available @@ -105,14 +105,14 @@ def makeThemeMenu(parent) m = TkMenu.new(parent) $THEMELIST.each{|theme, name| - m.add(:radiobutton, :label=>name, :variable=>$V.ref(:THEME), + m.add(:radiobutton, :label=>name, :variable=>$V.ref(:THEME), :value=>theme, :command=>proc{setTheme(theme)}) unless (TkPackage.names.find{|n| n =~ /(tile|ttk)::theme::#{theme}/}) m.entryconfigure(:end, :state=>:disabled) end } $RUBY_THEMELIST.each{|theme, name, available| - m.add(:radiobutton, :label=>name, :variable=>$V.ref(:THEME), + m.add(:radiobutton, :label=>name, :variable=>$V.ref(:THEME), :value=>theme, :command=>proc{setTheme(theme)}) m.entryconfigure(:end, :state=>:disabled) unless available } @@ -174,7 +174,7 @@ current = sb.get sb.set(current[0] + delta * num, current[1] + delta * num) end -end +end # ... for debugging: TkBindTag::ALL.bind('ButtonPress-3', proc{|w| $W = w}, '%W') @@ -209,21 +209,21 @@ i = 0 $BUTTONS.each{|icon| i += 1 - Tk::Tile::Button.new(tb, :text=>icon, :image=>$ICON[icon], - :compound=>$V[:COMPOUND], - :style=>:Toolbutton).grid(:row=>0, :column=>i, + Tk::Tile::Button.new(tb, :text=>icon, :image=>$ICON[icon], + :compound=>$V[:COMPOUND], + :style=>:Toolbutton).grid(:row=>0, :column=>i, :sticky=>:news) } $CHECKBOXES.each{|icon| i += 1 - Tk::Tile::Checkbutton.new(tb, :text=>icon, :image=>$ICON[icon], - :variable=>$V.ref(icon), - :compound=>$V[:COMPOUND], - :style=>:Toolbutton).grid(:row=>0, :column=>i, + Tk::Tile::Checkbutton.new(tb, :text=>icon, :image=>$ICON[icon], + :variable=>$V.ref(icon), + :compound=>$V[:COMPOUND], + :style=>:Toolbutton).grid(:row=>0, :column=>i, :sticky=>:news) } - mb = Tk::Tile::Menubutton.new(tb, :text=>'toolbar', :image=>$ICON['file'], + mb = Tk::Tile::Menubutton.new(tb, :text=>'toolbar', :image=>$ICON['file'], :compound=>$V[:COMPOUND]) mb.configure(:menu=>makeCompoundMenu(mb)) i += 1 @@ -240,21 +240,21 @@ i = 0 $BUTTONS.each{|icon| i += 1 - TkButton.new(tb, :text=>icon, :image=>$ICON[icon], - :compound=>$V[:COMPOUND], :relief=>:flat, - :overrelief=>:raised).grid(:row=>0, :column=>i, + TkButton.new(tb, :text=>icon, :image=>$ICON[icon], + :compound=>$V[:COMPOUND], :relief=>:flat, + :overrelief=>:raised).grid(:row=>0, :column=>i, :sticky=>:news) } $CHECKBOXES.each{|icon| i += 1 - TkCheckbutton.new(tb, :text=>icon, :image=>$ICON[icon], - :variable=>$V.ref(icon), :compound=>$V[:COMPOUND], - :indicatoron=>false, :selectcolor=>'', :relief=>:flat, - :overrelief=>:raised).grid(:row=>0, :column=>i, + TkCheckbutton.new(tb, :text=>icon, :image=>$ICON[icon], + :variable=>$V.ref(icon), :compound=>$V[:COMPOUND], + :indicatoron=>false, :selectcolor=>'', :relief=>:flat, + :overrelief=>:raised).grid(:row=>0, :column=>i, :sticky=>:news) } - mb = TkMenubutton.new(tb, :text=>'toolbar', :image=>$ICON['file'], + mb = TkMenubutton.new(tb, :text=>'toolbar', :image=>$ICON['file'], :compound=>$V[:COMPOUND]) mb.configure(:menu=>makeCompoundMenu(mb)) i += 1 @@ -270,8 +270,8 @@ def makeCompoundMenu(mb) menu = TkMenu.new(mb) %w(text image none top bottom left right center).each{|str| - menu.add(:radiobutton, :label=>Tk.tk_call('string', 'totitle', str), - :variable=>$V.ref(:COMPOUND), :value=>str, + menu.add(:radiobutton, :label=>Tk.tk_call('string', 'totitle', str), + :variable=>$V.ref(:COMPOUND), :value=>str, :command=>proc{ changeToolbars() }) } menu @@ -289,7 +289,7 @@ control.grid_rowconfigure(99, :weight=>1) def changeToolbars - foreachWidget($TOOLBARS, + foreachWidget($TOOLBARS, proc{|w| begin w.compound($V[:COMPOUND]) @@ -350,7 +350,7 @@ # def fillMenu(menu) %w(above below left right flush).each{|dir| - menu.add(:command, :label=>Tk.tk_call('string', 'totitle', dir), + menu.add(:command, :label=>Tk.tk_call('string', 'totitle', dir), :command=>proc{ menu.winfo_parent.direction(dir) }) } menu.add(:cascade, :label=>'Submenu', :menu=>(submenu = TkMenu.new(menu))) @@ -366,14 +366,14 @@ r = TkLabelframe.new(client, :text=>'Standard', :padx=>6, :pady=>6) ## Styled frame -cb = Tk::Tile::Checkbutton.new(l, :text=>'Checkbutton', +cb = Tk::Tile::Checkbutton.new(l, :text=>'Checkbutton', :variable=>$V.ref(:SELECTED), :underline=>2) -rb1 = Tk::Tile::Radiobutton.new(l, :text=>'One', :variable=>$V.ref(:CHOICE), +rb1 = Tk::Tile::Radiobutton.new(l, :text=>'One', :variable=>$V.ref(:CHOICE), :value=>1, :underline=>0) -rb2 = Tk::Tile::Radiobutton.new(l, :text=>'Two', :variable=>$V.ref(:CHOICE), +rb2 = Tk::Tile::Radiobutton.new(l, :text=>'Two', :variable=>$V.ref(:CHOICE), :value=>2) -rb3 = Tk::Tile::Radiobutton.new(l, :text=>'Three', - :variable=>$V.ref(:CHOICE), +rb3 = Tk::Tile::Radiobutton.new(l, :text=>'Three', + :variable=>$V.ref(:CHOICE), :value=>3, :underline=>0) btn = Tk::Tile::Button.new(l, :text=>'Button', :underline=>0) @@ -386,9 +386,9 @@ e = Tk::Tile::Entry.new(l, :textvariable=>$entryText) e.selection_range(6, :end) -ltext_f, ltext = scrolledWidget(l, TkText, true, +ltext_f, ltext = scrolledWidget(l, TkText, true, :width=>12, :height=>5, :wrap=>:none) -# NOTE TO MAINTAINERS: +# NOTE TO MAINTAINERS: # The checkbuttons are -sticky ew / -expand x on purpose: # it demonstrates one of the differences between TCheckbuttons # and standard checkbuttons. @@ -407,11 +407,11 @@ ## Orig frame cb = TkCheckbutton.new(r, :text=>'Checkbutton', :variable=>$V.ref(:SELECTED)) -rb1 = TkRadiobutton.new(r, :text=>'One', +rb1 = TkRadiobutton.new(r, :text=>'One', :variable=>$V.ref(:CHOICE), :value=>1) -rb2 = TkRadiobutton.new(r, :text=>'Two', :variable=>$V.ref(:CHOICE), +rb2 = TkRadiobutton.new(r, :text=>'Two', :variable=>$V.ref(:CHOICE), :value=>2, :underline=>1) -rb3 = TkRadiobutton.new(r, :text=>'Three', +rb3 = TkRadiobutton.new(r, :text=>'Three', :variable=>$V.ref(:CHOICE), :value=>3) btn = TkButton.new(r, :text=>'Button') @@ -420,14 +420,14 @@ mb.menu(m) $V[:rmbIndicatoron] = mb.indicatoron m.add(:checkbutton, :label=>'Indicator?', #' - :variable=>$V.ref(:rmbIndicatoron), + :variable=>$V.ref(:rmbIndicatoron), :command=>proc{mb.indicatoron($V[:rmbIndicatoron])}) m.add(:separator) fillMenu(m) e = TkEntry.new(r, :textvariable=>$entryText) -rtext_f, rtext = scrolledWidget(r, TkText, false, +rtext_f, rtext = scrolledWidget(r, TkText, false, :width=>12, :height=>5, :wrap=>:none) Tk.grid(cb, :sticky=>:ew) @@ -450,9 +450,9 @@ # Add some text to the text boxes: # msgs = [ -"The cat crept into the crypt, crapped and crept out again", -"Peter Piper picked a peck of pickled peppers", -"How much wood would a woodchuck chuck if a woodchuck could chuck wood", +"The cat crept into the crypt, crapped and crept out again", +"Peter Piper picked a peck of pickled peppers", +"How much wood would a woodchuck chuck if a woodchuck could chuck wood", "He thrusts his fists against the posts and still insists he sees the ghosts", "Who put the bomb in the bom-b-bom-b-bom,", "Is this your sister's sixth zither, sir?", @@ -493,8 +493,8 @@ scale.command {|value| progress.value(value)} vscale.command {|value| progress.inverted(vprogress, value) } else - # This would also work, but the Tk scale widgets - # in the right hand pane cause some interference when + # This would also work, but the Tk scale widgets + # in the right hand pane cause some interference when # in autoincrement/indeterminate mode. # progress.variable $V.ref(:SCALE) @@ -609,10 +609,10 @@ # Command box: # cmd = Tk::Tile::Frame.new($BASE) -b_close = Tk::Tile::Button.new(cmd, :text=>'Close', - :underline=>0, :default=>:normal, +b_close = Tk::Tile::Button.new(cmd, :text=>'Close', + :underline=>0, :default=>:normal, :command=>proc{Tk.root.destroy}) -b_help = Tk::Tile::Button.new(cmd, :text=>'Help', :underline=>0, +b_help = Tk::Tile::Button.new(cmd, :text=>'Help', :underline=>0, :default=>:normal, :command=>proc{showHelp()}) Tk.grid('x', b_close, b_help, :pady=>[6, 4], :padx=>4) TkGrid.columnconfigure(cmd, 0, :weight=>1) @@ -639,20 +639,20 @@ $ROOT.menu(menu) m_file = TkMenu.new(menu, :tearoff=>0) menu.add(:cascade, :label=>'File', :underline=>0, :menu=>m_file) -m_file.add(:command, :label=>'Open', :underline=>0, +m_file.add(:command, :label=>'Open', :underline=>0, :compound=>:left, :image=>$ICON['open']) -m_file.add(:command, :label=>'Save', :underline=>0, +m_file.add(:command, :label=>'Save', :underline=>0, :compound=>:left, :image=>$ICON['save']) m_file.add(:separator) m_f_test = TkMenu.new(menu, :tearoff=>0) m_file.add(:cascade, :label=>'Test submenu', :underline=>0, :menu=>m_f_test) -m_file.add(:checkbutton, :label=>'Text check', :underline=>5, +m_file.add(:checkbutton, :label=>'Text check', :underline=>5, :variable=>$V.ref(:MENUCHECK1)) m_file.insert(:end, :separator) if Tk.windowingsystem != 'x11' TkConsole.create - m_file.insert(:end, :checkbutton, :label=>'Console', :underline=>5, + m_file.insert(:end, :checkbutton, :label=>'Console', :underline=>5, :variable=>$V.ref(:CONSOLE), :command=>proc{toggle_console()}) def toggle_console if TkComm.bool($V[:CONSOLE]) @@ -663,7 +663,7 @@ end end -m_file.add(:command, :label=>'Exit', :underline=>1, +m_file.add(:command, :label=>'Exit', :underline=>1, :command=>proc{Tk.event_generate(b_close, '')}) %w(One Two Three Four).each{|lbl| @@ -672,7 +672,7 @@ # Add Theme menu. # -menu.add(:cascade, :label=>'Theme', :underline=>3, +menu.add(:cascade, :label=>'Theme', :underline=>3, :menu=>makeThemeMenu(menu)) setTheme($V[:THEME]) @@ -710,7 +710,7 @@ tree.grid_rowconfigure(0, :weight=>1) tree.grid_propagate(0) - # Add initial tree node: + # Add initial tree node: # Later nodes will be added in <> binding. treeview.insert('', 0, :id=>'.', :text=>'Main Window', :open=>false, :values=>[TkWinfo.classname('.')]) @@ -758,20 +758,20 @@ showDescription.bind('Leave', proc{|w| msg.text('')}, '%W') [ - [ :trackStates, "Widget states...", - "Display/modify widget state bits" ], + [ :trackStates, "Widget states...", + "Display/modify widget state bits" ], - [ :scrollbarResizeDemo, "Scrollbar resize behavior...", - "Shows how Tile and standard scrollbars differ when they're sized too large" ], + [ :scrollbarResizeDemo, "Scrollbar resize behavior...", + "Shows how Tile and standard scrollbars differ when they're sized too large" ], - [ :trackFocus, "Track keyboard focus..." , + [ :trackFocus, "Track keyboard focus..." , "Display the name of the widget that currently has focus" ], [ :repeatDemo, "Repeating buttons...", "Demonstrates custom classes (see demos/repeater.tcl)" ] ].each{|demo_cmd, label, description| - b = Tk::Tile::Button.new(others, :text=>label, + b = Tk::Tile::Button.new(others, :text=>label, :command=>proc{ self.__send__(demo_cmd) }) $Desc[b.path] = description b.bindtags <<= showDescription @@ -825,16 +825,16 @@ $focus = TkToplevel.new(:title=>'Keyboard focus') i = 0 [ - ["Focus widget:", :Widget], - ["Class:", :WidgetClass], - ["Next:", :WidgetNext], - ["Grab:", :Grab], + ["Focus widget:", :Widget], + ["Class:", :WidgetClass], + ["Next:", :WidgetNext], + ["Grab:", :Grab], ["Status:", :GrabStatus] ].each{|label, var_index| - Tk.grid(Tk::Tile::Label.new($focus, :text=>label, :anchor=>:e), - Tk::Tile::Label.new($focus, - :textvariable=>$FocusInf.ref(var_index), - :width=>40, :anchor=>:w, :relief=>:groove), + Tk.grid(Tk::Tile::Label.new($focus, :text=>label, :anchor=>:e), + Tk::Tile::Label.new($focus, + :textvariable=>$FocusInf.ref(var_index), + :width=>40, :anchor=>:w, :relief=>:groove), :sticky=>:ew) i += 1 } @@ -857,7 +857,7 @@ $FocusInf[:Grab] = grab_wins = Tk.current_grabs unless grab_wins.empty? $FocusInf[:GrabStatus] = grab_wins[0].grab_status - else + else $FocusInf[:GrabStatus] = '' end @@ -869,13 +869,13 @@ # $Widget = TkVariable.new -TkBindTag::ALL.bind('Control-Shift-ButtonPress-1', +TkBindTag::ALL.bind('Control-Shift-ButtonPress-1', proc{|w| $Widget.value = w updateStates() Tk.callback_break }, '%W') -$states_list = %w(active disabled focus pressed selected +$states_list = %w(active disabled focus pressed selected background indeterminate invalid default) $states_btns = {} $states = nil @@ -893,17 +893,17 @@ l_inf = Tk::Tile::Label.new($states, :text=>"Press Control-Shift-Button-1 on any widget") - l_lw = Tk::Tile::Label.new($states, :text=>'Widget:', + l_lw = Tk::Tile::Label.new($states, :text=>'Widget:', :anchor=>:e, :relief=>:groove) - l_w = Tk::Tile::Label.new($states, :textvariable=>$Widget, + l_w = Tk::Tile::Label.new($states, :textvariable=>$Widget, :anchor=>:w, :relief=>:groove) Tk.grid(l_inf, '-', :sticky=>:ew, :padx=>6, :pady=>6) Tk.grid(l_lw, l_w, :sticky=>:ew) $states_list.each{|st| - cb = Tk::Tile::Checkbutton.new($states, :text=>st, - :variable=>$State.ref(st), + cb = Tk::Tile::Checkbutton.new($states, :text=>st, + :variable=>$State.ref(st), :command=>proc{ changeState(st) }) $states_btns[st] = cb Tk.grid('x', cb, :sticky=>:nsew) @@ -914,7 +914,7 @@ f_cmd = Tk::Tile::Frame.new($states) Tk.grid('x', f_cmd, :sticky=>:nse) - b_close = Tk::Tile::Button.new(f_cmd, :text=>'Close', + b_close = Tk::Tile::Button.new(f_cmd, :text=>'Close', :command=>proc{ $states.destroy }) Tk.grid('x', b_close, :padx=>4, :pady=>[6,4]) f_cmd.grid_columnconfigure(0, :weight=>1) Index: ext/tk/sample/remote-ip_sample2.rb =================================================================== --- ext/tk/sample/remote-ip_sample2.rb (revision 23917) +++ ext/tk/sample/remote-ip_sample2.rb (working copy) @@ -17,23 +17,23 @@ # setup remote-ip window btns = [] ip.eval_proc{ - btns << + btns << TkButton.new(:command=>proc{ puts 'This procesure is on the controller-ip (Ruby-side)' - }, + }, :text=>'print on controller-ip (Ruby-side)').pack(:fill=>:x) - btns << + btns << TkButton.new(:command=> 'puts {This procesure is on the remote-ip (Tk-side)}', :text=>'print on remote-ip (Tk-side)').pack(:fill=>:x) - btns << + btns << TkButton.new(:command=> 'ruby { puts "This procedure is on the remote-ip (Ruby-side)" p Array.new(3,"ruby") - }', + }', :text=>'ruby cmd on the remote-ip').pack(:fill=>:x) TkButton.new(:command=>'exit', :text=>'QUIT').pack(:fill=>:x) @@ -41,15 +41,15 @@ # setup controller-ip window btns.each_with_index{|btn, idx| - # The scope of the eval-block of 'eval_proc' method is different from - # the enternal. If you want to pass local values to the eval-block, + # The scope of the eval-block of 'eval_proc' method is different from + # the enternal. If you want to pass local values to the eval-block, # use arguments of eval_proc method. They are passed to block-arguments. - TkButton.new(:command=>proc{ip.eval_proc(btn){|b| b.flash}}, - :text=>"flash button-#{idx}", + TkButton.new(:command=>proc{ip.eval_proc(btn){|b| b.flash}}, + :text=>"flash button-#{idx}", :padx=>10).pack(:padx=>10, :pady=>2) } -TkButton.new(:command=>proc{exit}, :text=>'QUIT', +TkButton.new(:command=>proc{exit}, :text=>'QUIT', :padx=>10, :pady=>7).pack(:padx=>10, :pady=>7) # start eventloop Index: ext/tk/sample/binstr_usage.rb =================================================================== --- ext/tk/sample/binstr_usage.rb (revision 23917) +++ ext/tk/sample/binstr_usage.rb (working copy) @@ -13,7 +13,7 @@ Tk::BinaryString class (subclass of Tk::EncodedString class) is the class \ to avoid such troubles. Please see the source code of this sample. \ -A Tk::BinaryString instance is used to create the image for the center button. +A Tk::BinaryString instance is used to create the image for the center button. EOM ImgFile=[File.dirname(__FILE__), 'images','tcllogo.gif'].join(File::Separator) Index: ext/tk/sample/cd_timer.rb =================================================================== --- ext/tk/sample/cd_timer.rb (revision 23917) +++ ext/tk/sample/cd_timer.rb (working copy) @@ -7,23 +7,23 @@ require 'tk' if ARGV.empty? - $stderr.puts 'Error:: No time arguments for counting down' + $stderr.puts 'Error:: No time arguments for counting down' exit(1) end width = 10 -TkButton.new(:text=>'exit', +TkButton.new(:text=>'exit', :command=>proc{exit}).pack(:side=>:bottom, :fill=>:x) b = TkButton.new(:text=>'start').pack(:side=>:top, :fill=>:x) f = TkFrame.new(:relief=>:ridge, :borderwidth=>2).pack(:fill=>:x) -TkLabel.new(f, :relief=>:flat, :pady=>3, - :background=>'black', :foreground=>'white', +TkLabel.new(f, :relief=>:flat, :pady=>3, + :background=>'black', :foreground=>'white', :text=>' elapsed: ').pack(:fill=>:x, :side=>:left, :expand=>true) -now = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w, - :background=>'black', :foreground=>'white', +now = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w, + :background=>'black', :foreground=>'white', :text=>'%4d:%02d.00' % [0, 0]).pack(:side=>:right) timers = [ TkRTTimer.new(10){|tm| @@ -41,9 +41,9 @@ ARGV.collect{|arg| (Float(arg) * 60).to_i}.sort.each_with_index{|time, idx| f = TkFrame.new(:relief=>:ridge, :borderwidth=>2).pack(:fill=>:x) - TkLabel.new(f, :relief=>:flat, :pady=>3, + TkLabel.new(f, :relief=>:flat, :pady=>3, :text=>' %4d:%02d --> ' % (time.divmod(60))).pack(:side=>:left) - l = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w, + l = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w, :text=>'%4d:%02d' % (time.divmod(60))).pack(:side=>:right) timers << TkRTTimer.new(1000){|tm| t = (tm.return_value || time) - 1 Index: ext/tk/sample/tkmsgcat-load_tk.rb =================================================================== --- ext/tk/sample/tkmsgcat-load_tk.rb (revision 23917) +++ ext/tk/sample/tkmsgcat-load_tk.rb (working copy) @@ -14,7 +14,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ }.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 @@ 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.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 Index: ext/tk/sample/optobj_sample.rb =================================================================== --- ext/tk/sample/optobj_sample.rb (revision 23917) +++ ext/tk/sample/optobj_sample.rb (working copy) @@ -12,13 +12,13 @@ b2 = TkButton.new(f, :text=>'BBB').pack(:fill=>:x) b3 = TkButton.new(f, :text=>'CCC').pack(:fill=>:x) -optobj.assign( b1, - [ b2, 'configure', - { 'foreground'=>'background', - 'background'=>'foreground' } ], - [ b3, nil, - { 'foreground'=>'background', - 'activeforeground'=>nil, +optobj.assign( b1, + [ b2, 'configure', + { 'foreground'=>'background', + 'background'=>'foreground' } ], + [ b3, nil, + { 'foreground'=>'background', + 'activeforeground'=>nil, 'background'=>['foreground', 'activeforeground'] } ] ) optobj.update('activeforeground'=>'yellow') @@ -29,26 +29,26 @@ } TkButton.new(f){ - configure( optobj.assign([self, nil, - {'foreground'=>'activeforeground', - 'background'=>'foreground', + configure( optobj.assign([self, nil, + {'foreground'=>'activeforeground', + 'background'=>'foreground', 'activeforeground'=>'background'}]) \ + {:text=>'EEE', :relief=>:groove, :borderwidth=>5} ) pack(:fill=>:x) } -optobj.notify # To apply the convert_key ( 3rd element of widget info - # (that is, {'foreground'=>'activeforeground', ,,, } ) - # of the 'EEE' button +optobj.notify # To apply the convert_key ( 3rd element of widget info + # (that is, {'foreground'=>'activeforeground', ,,, } ) + # of the 'EEE' button -TkButton.new(f, :text=>'toggle', +TkButton.new(f, :text=>'toggle', :command=>proc{ fg = optobj['foreground'] bg = optobj['background'] optobj.configure('foreground'=>bg, 'background'=>fg) }).pack(:fill=>:x, :pady=>10) -TkButton.new(f, :text=>'exit', +TkButton.new(f, :text=>'exit', :command=>proc{exit}).pack(:fill=>:x, :pady=>10) TkFrame.new{|f| Index: ext/tk/sample/tkballoonhelp.rb =================================================================== --- ext/tk/sample/tkballoonhelp.rb (revision 23917) +++ ext/tk/sample/tkballoonhelp.rb (working copy) @@ -2,16 +2,20 @@ # tkballoonhelp.rb : simple balloon help widget # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # -# Add a balloon help to a widget. -# This widget has only poor featureas. If you need more useful features, +# Add a balloon help to a widget. +# This widget has only poor featureas. If you need more useful features, # please try to use the Tix extension of Tcl/Tk under Ruby/Tk. -# +# # The interval time to display a balloon help is defined 'interval' option -# (default is 1000ms). +# (default is 750ms). # require 'tk' -class TkBalloonHelp'bisque').pack + # @label = TkLabel.new(@frame, 'background'=>'bisque').pack + @label = TkLabel.new(@frame, + 'foreground'=>DEFAULT_FOREGROUND, + 'background'=>DEFAULT_BACKGROUND).pack @label.configure(_symbolkey2str(keys)) unless keys.empty? @path = @label end @@ -87,10 +94,10 @@ when 2 @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent)) when 3 - @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent), + @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent), self) else - @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent), + @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent), self, @parent) end end @@ -99,11 +106,11 @@ @frame.raise @org_cursor = @parent['cursor'] - @parent.cursor('crosshair') + @parent.cursor('crosshair') end def erase - @parent.cursor(@org_cursor) + @parent.cursor(@org_cursor) @frame.withdraw end @@ -118,41 +125,42 @@ if __FILE__ == $0 TkButton.new('text'=>'This button has a balloon help') {|b| pack('fill'=>'x') - TkBalloonHelp.new(b, 'text'=>' Message ') + Tk::BalloonHelp.new(b, 'text'=>' Message ') } TkButton.new('text'=>'This button has another balloon help') {|b| pack('fill'=>'x') - TkBalloonHelp.new(b, 'text'=>'configured message', - 'interval'=>200, 'font'=>'courier', - 'background'=>'gray', 'foreground'=>'red') + Tk::BalloonHelp.new(b, + 'text'=>"CONFIGURED MESSAGE\nchange colors, and so on", + 'interval'=>200, 'font'=>'courier', + 'background'=>'gray', 'foreground'=>'red') } sb = TkScrollbox.new.pack(:fill=>:x) sb.insert(:end, *%w(aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm)) =begin # CASE1 : command takes no arguemnt - bh = TkBalloonHelp.new(sb, :interval=>500, - :relief=>:ridge, :background=>'white', - :command=>proc{ - y = TkWinfo.pointery(sb) - TkWinfo.rooty(sb) - bh.text "current index == #{sb.nearest(y)}" - }) + bh = Tk::BalloonHelp.new(sb, :interval=>500, + :relief=>:ridge, :background=>'white', + :command=>proc{ + y = TkWinfo.pointery(sb) - TkWinfo.rooty(sb) + bh.text "current index == #{sb.nearest(y)}" + }) =end =begin # CASE2 : command takes 2 arguemnts - bh = TkBalloonHelp.new(sb, :interval=>500, - :relief=>:ridge, :background=>'white', - :command=>proc{|x, y| - bh.text "current index == #{sb.nearest(y)}" - }) + bh = Tk::BalloonHelp.new(sb, :interval=>500, + :relief=>:ridge, :background=>'white', + :command=>proc{|x, y| + bh.text "current index == #{sb.nearest(y)}" + }) =end =begin # CASE3 : command takes 3 arguemnts - TkBalloonHelp.new(sb, :interval=>500, - :relief=>:ridge, :background=>'white', - :command=>proc{|x, y, bhelp| - bhelp.text "current index == #{sb.nearest(y)}" - }) + Tk::BalloonHelp.new(sb, :interval=>500, + :relief=>:ridge, :background=>'white', + :command=>proc{|x, y, bhelp| + bhelp.text "current index == #{sb.nearest(y)}" + }) =end =begin # CASE4a : command is a Proc object and takes 4 arguemnts @@ -160,16 +168,16 @@ bhelp.text "current index == #{parent.nearest(y)}" } - TkBalloonHelp.new(sb, :interval=>500, - :relief=>:ridge, :background=>'white', - :command=>cmd) + Tk::BalloonHelp.new(sb, :interval=>500, + :relief=>:ridge, :background=>'white', + :command=>cmd) sb2 = TkScrollbox.new.pack(:fill=>:x) sb2.insert(:end, *%w(AAA BBB CCC DDD EEE FFF GGG HHH III JJJ KKK LLL MMM)) - TkBalloonHelp.new(sb2, :interval=>500, - :padx=>5, :relief=>:raised, - :background=>'gray25', :foreground=>'white', - :command=>cmd) + Tk::BalloonHelp.new(sb2, :interval=>500, + :padx=>5, :relief=>:raised, + :background=>'gray25', :foreground=>'white', + :command=>cmd) =end #=begin # CASE4b : command is a Method object and takes 4 arguemnts @@ -178,16 +186,16 @@ end cmd = self.method(:set_msg) - TkBalloonHelp.new(sb, :interval=>500, - :relief=>:ridge, :background=>'white', - :command=>cmd) + Tk::BalloonHelp.new(sb, :interval=>500, + :relief=>:ridge, :background=>'white', + :command=>cmd) sb2 = TkScrollbox.new.pack(:fill=>:x) sb2.insert(:end, *%w(AAA BBB CCC DDD EEE FFF GGG HHH III JJJ KKK LLL MMM)) - TkBalloonHelp.new(sb2, :interval=>500, - :padx=>5, :relief=>:raised, - :background=>'gray25', :foreground=>'white', - :command=>cmd) + Tk::BalloonHelp.new(sb2, :interval=>500, + :padx=>5, :relief=>:raised, + :background=>'gray25', :foreground=>'white', + :command=>cmd) #=end Tk.mainloop Index: ext/tk/sample/tkdialog.rb =================================================================== --- ext/tk/sample/tkdialog.rb (revision 23917) +++ ext/tk/sample/tkdialog.rb (working copy) @@ -8,7 +8,7 @@ } msg = TkMessage.new(top) { text "File main.c hasn't been saved to disk since \ -it was last modified. What should I do?" +it was last modified. What should I do?" justify 'center' aspect 200 font '-Adobe-helvetica-medium-r-normal--*-240*' Index: ext/tk/sample/tkmultilistbox.rb =================================================================== --- ext/tk/sample/tkmultilistbox.rb (revision 23917) +++ ext/tk/sample/tkmultilistbox.rb (working copy) @@ -35,10 +35,10 @@ # create base flames @f_title = TkFrame.new(@frame, 'width'=>@width_total) - @f_lbox = TkFrame.new(@frame, + @f_lbox = TkFrame.new(@frame, 'width'=>@width_total, 'height'=>lbox_height) - @f_hscr = TkFrame.new(@frame, 'width'=>@width_total, - 'height'=>@v_scroll.cget('width') + + @f_hscr = TkFrame.new(@frame, 'width'=>@width_total, + 'height'=>@v_scroll.cget('width') + 2 * @v_scroll.cget('borderwidth')) # dummy label to keep the hight of title space @@ -63,25 +63,25 @@ f = TkFrame.new(@f_title, 'width'=>width) base = [f] @title_list << TkLabel.new(f, 'text'=>label).pack('fill'=>'x') - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-6, + f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-6, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx]) # listbox field f = TkFrame.new(@f_lbox, 'width'=>width) base << f @lbox_list << TkListbox.new(f).pack('fill'=>'both', 'expand'=>true) - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-4, + f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-4, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0) # scrollbar field f = TkFrame.new(@f_hscr, 'width'=>width) base << f - @hscr_list << TkScrollbar.new(f, 'orient'=>'horizontal') . + @hscr_list << TkScrollbar.new(f, 'orient'=>'horizontal') . pack('fill'=>'x', 'anchor'=>'w') - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-4, + f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-4, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx]) - @lbox_list[idx].xscrollcommand proc{|first, last| + @lbox_list[idx].xscrollcommand proc{|first, last| @hscr_list[idx].set first, last } @hscr_list[idx].command proc{|*args| @lbox_list[idx].xview *args} @@ -93,19 +93,19 @@ # create tab @tab_list = [nil] (1..(@rel_list.size - 2)).each{|idx| - tab = TkFrame.new(@f_title, 'cursor'=>'sb_h_double_arrow', + tab = TkFrame.new(@f_title, 'cursor'=>'sb_h_double_arrow', 'width'=>6, 'borderwidth'=>2, 'relief'=>'raised') @tab_list << tab tab.place('relx'=>@rel_list[idx], 'anchor'=>'ne', 'relheight'=>0.95) - tab.bind('Button-1', - proc{|x| @x = x; @frame_width = TkWinfo.width(@f_title).to_f}, + tab.bind('Button-1', + proc{|x| @x = x; @frame_width = TkWinfo.width(@f_title).to_f}, '%X') tab.bind('B1-Motion', proc{|x, idx| resize(x, idx.to_i)}, "%X #{idx}") } # set control procedure for virtical scroll @lbox_list.each{|lbox| - lbox.yscrollcommand proc{|first, last| + lbox.yscrollcommand proc{|first, last| @v_scroll.set first, last } } @@ -118,17 +118,17 @@ @mode['extended'] = extended_mode_bindtag @mode['multiple'] = multiple_mode_bindtag @current_mode = 'browse' - @lbox_list.each{|l| - l.bind('Shift-Key-Left', + @lbox_list.each{|l| + l.bind('Shift-Key-Left', proc{|w| focus_shift(w, -1); Tk.callback_break}, '%W') - l.bind('Shift-Key-Right', + l.bind('Shift-Key-Right', proc{|w| focus_shift(w, 1); Tk.callback_break}, '%W') - l.bind('Button-2', proc{|x, y| + l.bind('Button-2', proc{|x, y| @lbox_mark_x = x @lbox_list.each{|lbox| lbox.scan_mark(x, y)} }, '%x %y') - l.bind('B2-Motion', proc{|x, y| + l.bind('B2-Motion', proc{|x, y| @lbox_list.each{|lbox| lbox.scan_dragto(@lbox_mark_x, y)} l.scan_dragto(x, y) }, '%x %y') @@ -189,7 +189,7 @@ # set 'mode' option of listboxes def mode(sel_mode) - @lbox_list.each{|l| + @lbox_list.each{|l| tags = l.bindtags tags = tags - [ @mode[@current_mode] ] l.bindtags(tags.unshift(@mode[sel_mode])) @@ -282,7 +282,7 @@ array[indices[0]] = line[label] else if line[label].kind_of? Array - indices.each_with_index{|index, num| + indices.each_with_index{|index, num| array[index] = line[label][num] } else @@ -300,9 +300,9 @@ indices.each{|index| lbox_ins[index] << line[index]} end } - } + } - @lbox_list.each_with_index{|lbox, index| + @lbox_list.each_with_index{|lbox, index| lbox.insert(idx, *lbox_ins[index]) if lbox_ins[index] } end @@ -326,7 +326,7 @@ (0..(@rel_list.size - 2)).each{|idx| title, lbox, hscr = @base_list[idx] title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx]) - lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0) hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx]) @@ -356,11 +356,11 @@ # adjustment of rightside widget of the tab title, lbox, hscr = @base_list[idx] - title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relx'=>@rel_list[idx]) - lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relx'=>@rel_list[idx], 'relheight'=>1.0) - hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relx'=>@rel_list[idx]) # update reference position @@ -370,11 +370,11 @@ ################################# def browse_mode_bindtag t = TkBindTag.new - t.bind('Button-1', + t.bind('Button-1', proc{|w, y| w.focus; select_line(w, w.nearest(y))}, '%W %y') t.bind('B1-Motion', proc{|w, y| select_line(w, w.nearest(y))}, '%W %y') - t.bind('Shift-Button-1', + t.bind('Shift-Button-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W') @@ -385,7 +385,7 @@ t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W') t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Control-slash', + t.bind('Control-slash', proc{|w| select_line(w, w.index('active').to_i)}, '%W') t @@ -394,12 +394,12 @@ ######################## def single_mode_bindtag t = TkBindTag.new - t.bind('Button-1', + t.bind('Button-1', proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y') - t.bind('ButtonRelease-1', + t.bind('ButtonRelease-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') - t.bind('Shift-Button-1', + t.bind('Shift-Button-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W') @@ -410,9 +410,9 @@ t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W') t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Control-slash', + t.bind('Control-slash', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Control-backslash', + t.bind('Control-backslash', proc{@lbox_list.each{|l| l.selection_clear(0, 'end')}}) t @@ -421,22 +421,22 @@ ######################## def extended_mode_bindtag t = TkBindTag.new - t.bind('Button-1', + t.bind('Button-1', proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y') t.bind('B1-Motion', proc{|w, y| select_range(w, w.nearest(y))}, '%W %y') - t.bind('ButtonRelease-1', + t.bind('ButtonRelease-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') - t.bind('Shift-Button-1', + t.bind('Shift-Button-1', proc{|w, y| select_range(w, w.nearest(y))}, '%W %y') - t.bind('Shift-B1-Motion', + t.bind('Shift-B1-Motion', proc{|w, y| select_range(w, w.nearest(y))}, '%W %y') - t.bind('Control-Button-1', + t.bind('Control-Button-1', proc{|w, y| select_toggle(w, w.nearest(y))}, '%W %y') - t.bind('Control-B1-Motion', + t.bind('Control-B1-Motion', proc{|w, y| select_drag(w, w.nearest(y))}, '%W %y') t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W') @@ -462,9 +462,9 @@ ######################## def multiple_mode_bindtag t = TkBindTag.new - t.bind('Button-1', + t.bind('Button-1', proc{|w, y| w.focus; select_line3(w, w.nearest(y))}, '%W %y') - t.bind('ButtonRelease-1', + t.bind('ButtonRelease-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W') @@ -624,15 +624,15 @@ # test ################################################ if __FILE__ == $0 - f = TkFrame.new(nil, 'width'=>300, + f = TkFrame.new(nil, 'width'=>300, 'height'=>200).pack('fill'=>'both', 'expand'=>'true') #f = TkFrame.new.pack('fill'=>'both', 'expand'=>'true') - l = TkMultiListbox.new(f, 150, - [ ['L1', 100], - ['L2', 200], - ['L3', 50] ], - 'titlefont'=>'courier', - 'titleforeground'=>'yellow', + l = TkMultiListbox.new(f, 150, + [ ['L1', 100], + ['L2', 200], + ['L3', 50] ], + 'titlefont'=>'courier', + 'titleforeground'=>'yellow', 'titlebackground'=>'navy' ).pack('fill'=>'both', 'expand'=>true) l.insert('end', [1,2,3]) Index: ext/tk/sample/tktextframe.rb =================================================================== --- ext/tk/sample/tktextframe.rb (revision 23917) +++ ext/tk/sample/tktextframe.rb (working copy) @@ -5,9 +5,53 @@ # require 'tk' -class TkTextFrame < TkText +module Tk::ScrollbarComposite include TkComposite + def component_construct_keys + # If a component requires options for construction, + # return an Array of option-keys. + [] + end + private :component_construct_keys + + def create_component(keys={}) + # This method must return the created component widget. + end + private :create_component + + def component_delegates + # if want to override defalut option-methods or delegates, + # please define here. + end + private :component_delegates + + def define_delegates + # option methods for scrollbars + option_methods([:scrollbarwidth, :get_scrollbarwidth]) + + # set receiver widgets for configure methods (with alias) + delegate_alias('scrollbarrelief', 'relief', @h_scroll, @v_scroll) + delegate_alias('framebackground', 'background', + @frame, @h_scroll, @v_scroll) + delegate_alias('activeframebackground', 'activebackground', + @h_scroll, @v_scroll) + + # set receiver widgets for configure methods + delegate('DEFAULT', @component) + delegate('troughcolor', @h_scroll, @v_scroll) + delegate('repeatdelay', @h_scroll, @v_scroll) + delegate('repeatinterval', @h_scroll, @v_scroll) + delegate('borderwidth', @frame) + delegate('relief', @frame) + + component_delegates + end + private :define_delegates + + DEFAULT_VSCROLL = true + DEFAULT_HSCROLL = true + def initialize_composite(keys={}) keys = _symbolkey2str(keys) @@ -15,55 +59,123 @@ @v_scroll = TkScrollbar.new(@frame, 'orient'=>'vertical') @h_scroll = TkScrollbar.new(@frame, 'orient'=>'horizontal') - # create a text widget - @text = TkText.new(@frame, 'wrap'=>'none') + # create a component + construct_keys = {} + ((component_construct_keys.map{|k| k.to_s}) & keys.keys).each{|k| + construct_keys[k] = keys.delete(k) + } + # create a component (the component must be scrollable) + @component = create_component(construct_keys) + # set default receiver of method calls - @path = @text.path + @path = @component.path # assign scrollbars - @text.xscrollbar(@h_scroll) - @text.yscrollbar(@v_scroll) + @component.xscrollbar(@h_scroll) + @component.yscrollbar(@v_scroll) # allignment TkGrid.rowconfigure(@frame, 0, 'weight'=>1, 'minsize'=>0) TkGrid.columnconfigure(@frame, 0, 'weight'=>1, 'minsize'=>0) - @text.grid('row'=>0, 'column'=>0, 'sticky'=>'news') + @component.grid('row'=>0, 'column'=>0, 'sticky'=>'news') # scrollbars ON - vscroll(keys.delete('vscroll'){true}) - hscroll(keys.delete('hscroll'){true}) + vscroll(keys.delete('vscroll'){self.class::DEFAULT_VSCROLL}) + hscroll(keys.delete('hscroll'){self.class::DEFAULT_HSCROLL}) - # set background of the text widget -=begin - color = keys.delete('textbackground') - textbackground(color) if color -=end - # please check the differences of the following definitions + # do configure + define_delegates + + # do configure + configure keys unless keys.empty? + end + private :initialize_composite + + # get/set width of scrollbar + def get_scrollbarwidth + @v_scroll.width + end + def set_scrollbarwidth(width) + @v_scroll.width(width) + @h_scroll.width(width) + end + alias :scrollbarwidth :set_scrollbarwidth + + def hook_vscroll_on(*args); end + def hook_vscroll_off(*args); end + def hook_hscroll_on(*args); end + def hook_hscroll_off(*args); end + private :hook_vscroll_on,:hook_vscroll_off,:hook_hscroll_on,:hook_hscroll_off + + # vertical scrollbar : ON/OFF + def vscroll(mode, *args) + st = TkGrid.info(@v_scroll) + if mode && st.size == 0 then + @v_scroll.grid('row'=>0, 'column'=>1, 'sticky'=>'ns') + hook_vscroll_on(*args) + elsif !mode && st.size != 0 then + @v_scroll.ungrid + hook_vscroll_off(*args) + end + self + end + + # horizontal scrollbar : ON/OFF + def hscroll(mode, *args) + st = TkGrid.info(@h_scroll) + if mode && st.size == 0 then + @h_scroll.grid('row'=>1, 'column'=>0, 'sticky'=>'ew') + hook_hscroll_on(*args) + elsif !mode && st.size != 0 then + @h_scroll.ungrid + hook_hscroll_off(*args) + end + self + end +end + +################################################ + +class TkTextFrame < TkText + include Tk::ScrollbarComposite + + # def component_construct_keys; []; end + # private :component_construct_keys + + def create_component(keys={}) + # keys has options which are listed by component_construct_keys method. + @text = TkText.new(@frame, 'wrap'=>'none') + @text.configure(keys) unless keys.empty? + + # option methods for component option_methods( - [:scrollbarwidth, :get_scrollbarwidth], - [:textbackground, nil, :textbg_info], - :textborderwidth, + [:textbackground, nil, :textbg_info], + :textborderwidth, :textrelief ) - # set receiver widgets for configure methods (with alias) - delegate_alias('scrollbarrelief', 'relief', @h_scroll, @v_scroll) + # return the created componet + @text + end + private :create_component - # set receiver widgets for configure methods - delegate('DEFAULT', @text) - delegate('background', @frame, @h_scroll, @v_scroll) - delegate('activebackground', @h_scroll, @v_scroll) - delegate('troughcolor', @h_scroll, @v_scroll) - delegate('repeatdelay', @h_scroll, @v_scroll) - delegate('repeatinterval', @h_scroll, @v_scroll) - delegate('borderwidth', @frame) - delegate('relief', @frame) + # def component_delegates; end + # private :component_delegates - # do configure - configure keys unless keys.empty? + def hook_hscroll_on(wrap_mode=nil) + if wrap_mode + wrap wrap_mode + else + wrap 'none' # => self.wrap('none') + end end - private :initialize_composite + def hook_hscroll_off(wrap_mode) + wrap wrap_mode # => self.wrap(wrap_mode) + end + def hscroll(mode, wrap_mode="char") + super + end # set background color of text widget def textbackground(color = nil) @@ -103,60 +215,67 @@ def textrelief(type) @text.relief(type) end - - # get/set width of scrollbar - def get_scrollbarwidth - @v_scroll.width - end - def set_scrollbarwidth(width) - @v_scroll.width(width) - @h_scroll.width(width) - end - alias :scrollbarwidth :set_scrollbarwidth - - # vertical scrollbar : ON/OFF - def vscroll(mode) - st = TkGrid.info(@v_scroll) - if mode && st.size == 0 then - @v_scroll.grid('row'=>0, 'column'=>1, 'sticky'=>'ns') - elsif !mode && st.size != 0 then - @v_scroll.ungrid - end - self - end - - # horizontal scrollbar : ON/OFF - def hscroll(mode, wrap_mode="char") - st = TkGrid.info(@h_scroll) - if mode && st.size == 0 then - @h_scroll.grid('row'=>1, 'column'=>0, 'sticky'=>'ew') - wrap 'none' # => self.wrap('none') - elsif !mode && st.size != 0 then - @h_scroll.ungrid - wrap wrap_mode # => self.wrap(wrap_mode) - end - self - end end - ################################################ # test ################################################ if __FILE__ == $0 + TkLabel.new(:text=>'TkTextFrame is an example of Tk::ScrollbarComposite module.').pack f = TkFrame.new.pack('fill'=>'x') #t = TkTextFrame.new.pack - t = TkTextFrame.new(:textborderwidth=>3, - :textrelief=>:ridge, + t = TkTextFrame.new(:textborderwidth=>3, + :textrelief=>:ridge, :scrollbarrelief=>:ridge).pack p t.configinfo - TkButton.new(f, 'text'=>'vscr OFF', + TkButton.new(f, 'text'=>'vscr OFF', 'command'=>proc{t.vscroll(false)}).pack('side'=>'right') - TkButton.new(f, 'text'=>'vscr ON', + TkButton.new(f, 'text'=>'vscr ON', 'command'=>proc{t.vscroll(true)}).pack('side'=>'right') - TkButton.new(f, 'text'=>'hscr ON', + TkButton.new(f, 'text'=>'hscr ON', 'command'=>proc{t.hscroll(true)}).pack('side'=>'left') - TkButton.new(f, 'text'=>'hscr OFF', + TkButton.new(f, 'text'=>'hscr OFF', 'command'=>proc{t.hscroll(false)}).pack('side'=>'left') + + ############################################ + + # Tk.default_widget_set = :Ttk + + TkFrame.new.pack(:pady=>10) + TkLabel.new(:text=>'The following is another example of Tk::ScrollbarComposite module.').pack + + #---------------------------------- + class ScrListbox < TkListbox + include Tk::ScrollbarComposite + + DEFAULT_HSCROLL = false + + def create_component(keys={}) + TkListbox.new(@frame, keys) + end + private :create_component + end + #---------------------------------- + + f = TkFrame.new.pack(:pady=>5) + lbox = ScrListbox.new(f).pack(:side=>:left) + lbox.value = %w(aa bb cc dd eeeeeeeeeeeeeeeeeeeeeeeeee ffffffffff gg hh ii jj kk ll mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm nn oo pp qq) + fb = TkFrame.new(f).pack(:expand=>true, :fill=>:y, :padx=>5) + TkButton.new(fb, 'text'=>'lbox hscr OFF', + 'command'=>proc{lbox.hscroll(false)}).pack(:side=>:bottom, + :fill=>:x) + TkButton.new(fb, 'text'=>'lbox hscr ON', + 'command'=>proc{lbox.hscroll(true)}).pack(:side=>:bottom, + :fill=>:x) + TkFrame.new(fb).pack(:pady=>5, :side=>:bottom) + TkButton.new(fb, 'text'=>'lbox vscr OFF', + 'command'=>proc{lbox.vscroll(false)}).pack(:side=>:bottom, + :fill=>:x) + TkButton.new(fb, 'text'=>'lbox vscr ON', + 'command'=>proc{lbox.vscroll(true)}).pack(:side=>:bottom, + :fill=>:x) + + ############################################ + Tk.mainloop end Index: ext/tk/sample/tkmenubutton.rb =================================================================== --- ext/tk/sample/tkmenubutton.rb (revision 23917) +++ ext/tk/sample/tkmenubutton.rb (working copy) @@ -7,56 +7,56 @@ TkLabel.new(:text=>'Sample of TkMenubutton').pack(:side=>:top) TkFrame.new{|f| - pack(:side=>:top) + pack(:side=>:top) - TkMenubutton.new(:parent=>f, :text=>'Right', :underline=>0, + TkMenubutton.new(:parent=>f, :text=>'Right', :underline=>0, :direction=>:right, :relief=>:raised){|mb| menu TkMenu.new(:parent=>mb, :tearoff=>0){ - add(:command, :label=>'Right menu: first item', - :command=>proc{print 'You have selected the first item' + + add(:command, :label=>'Right menu: first item', + :command=>proc{print 'You have selected the first item' + " from the Right menu.\n"}) - add(:command, :label=>'Right menu: second item', - :command=>proc{print 'You have selected the second item' + + add(:command, :label=>'Right menu: second item', + :command=>proc{print 'You have selected the second item' + " from the Right menu.\n"}) } pack(:side=>:left, :padx=>25, :pady=>25) } - TkMenubutton.new(:parent=>f, :text=>'Below', :underline=>0, + TkMenubutton.new(:parent=>f, :text=>'Below', :underline=>0, :direction=>:below, :relief=>:raised){|mb| menu(TkMenu.new(:parent=>mb, :tearoff=>0){ - add(:command, :label=>'Below menu: first item', - :command=>proc{print 'You have selected the first item' + + add(:command, :label=>'Below menu: first item', + :command=>proc{print 'You have selected the first item' + " from the Below menu.\n"}) - add(:command, :label=>'Below menu: second item', - :command=>proc{print 'You have selected the second item' + + add(:command, :label=>'Below menu: second item', + :command=>proc{print 'You have selected the second item' + " from the Below menu.\n"}) }) pack(:side=>:left, :padx=>25, :pady=>25) } - TkMenubutton.new(:parent=>f, :text=>'Above', :underline=>0, + TkMenubutton.new(:parent=>f, :text=>'Above', :underline=>0, :direction=>:above, :relief=>:raised){|mb| menu TkMenu.new(:parent=>mb, :tearoff=>0){ - add(:command, :label=>'Above menu: first item', - :command=>proc{print 'You have selected the first item' + + add(:command, :label=>'Above menu: first item', + :command=>proc{print 'You have selected the first item' + " from the Above menu.\n"}) - add(:command, :label=>'Above menu: second item', - :command=>proc{print 'You have selected the second item' + + add(:command, :label=>'Above menu: second item', + :command=>proc{print 'You have selected the second item' + " from the Above menu.\n"}) } pack(:side=>:left, :padx=>25, :pady=>25) } - TkMenubutton.new(:parent=>f, :text=>'Left', :underline=>0, + TkMenubutton.new(:parent=>f, :text=>'Left', :underline=>0, :direction=>:left, :relief=>:raised){|mb| menu(TkMenu.new(:parent=>mb, :tearoff=>0){ - add(:command, :label=>'Left menu: first item', - :command=>proc{print 'You have selected the first item' + + add(:command, :label=>'Left menu: first item', + :command=>proc{print 'You have selected the first item' + " from the Left menu.\n"}) - add(:command, :label=>'Left menu: second item', - :command=>proc{print 'You have selected the second item' + + add(:command, :label=>'Left menu: second item', + :command=>proc{print 'You have selected the second item' + " from the Left menu.\n"}) }) pack(:side=>:left, :padx=>25, :pady=>25) @@ -64,20 +64,20 @@ } ############################ -TkFrame.new(:borderwidth=>2, :relief=>:sunken, +TkFrame.new(:borderwidth=>2, :relief=>:sunken, :height=>5).pack(:side=>:top, :fill=>:x, :padx=>20) ############################ TkLabel.new(:text=>'Sample of TkOptionMenu').pack(:side=>:top) -colors = %w(Black red4 DarkGreen NavyBlue gray75 Red Green Blue gray50 +colors = %w(Black red4 DarkGreen NavyBlue gray75 Red Green Blue gray50 Yellow Cyan Magenta White Brown DarkSeaGreen DarkViolet) TkFrame.new{|f| - pack(:side=>:top) + pack(:side=>:top) - b1 = TkOptionMenubutton . - new(:parent=>f, :values=>%w(one two three)) . + b1 = TkOptionMenubutton . + new(:parent=>f, :values=>%w(one two three)) . pack(:side=>:left, :padx=>25, :pady=>25) b2 = TkOptionMenubutton.new(:parent=>f, :values=>colors) {|optMB| @@ -96,7 +96,7 @@ put 'Black', *[14, 2, 16, 14] put color, *[ 2, 2, 14, 14] } - optMB.entryconfigure(color, :hidemargin=>1, + optMB.entryconfigure(color, :hidemargin=>1, :image=>no_sel, :selectimage=>sel) } optMB.menuconfigure(:tearoff, 1) @@ -114,7 +114,7 @@ } ############################ -TkFrame.new(:borderwidth=>2, :relief=>:sunken, +TkFrame.new(:borderwidth=>2, :relief=>:sunken, :height=>5).pack(:side=>:top, :fill=>:x, :padx=>20) ############################ Index: ext/tk/sample/tkmsgcat-load_rb2.rb =================================================================== --- ext/tk/sample/tkmsgcat-load_rb2.rb (revision 23917) +++ ext/tk/sample/tkmsgcat-load_rb2.rb (working copy) @@ -15,7 +15,7 @@ TkComm.window(frame).background(color) Tk.update TkComm.window(label).text( - msgcat["%1$s:: %2$s", 'Color', + msgcat["%1$s:: %2$s", 'Color', color.capitalize]) w.flash; w.flash Tk.callback_break; @@ -23,7 +23,7 @@ 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['Application Error'])}) show_sample = proc{|loc| @@ -38,10 +38,10 @@ pack(:pady=>10, :padx=>10) } - lbl = TkLabel.new(top_win, :text=>msgcat["%1$s:: %2$s", + lbl = TkLabel.new(top_win, :text=>msgcat["%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| @@ -53,9 +53,9 @@ }.pack(:anchor=>'center', :pady=>15) TkFrame.new(top_win){|f| - TkButton.new(f, :text=>msgcat['Delete'], + TkButton.new(f, :text=>msgcat['Delete'], :command=>del_proc).pack(:side=>:right, :padx=>5) - TkButton.new(f, :text=>msgcat['Error'], + TkButton.new(f, :text=>msgcat['Error'], :command=>err_proc).pack(:side=>:left, :padx=>5) }.pack(:side=>:bottom, :fill=>:x) @@ -67,7 +67,7 @@ TkLabel.new(:text=>"Please click a locale.").pack(:padx=>5, :pady=>3) TkFrame.new{|f| - TkButton.new(f, :text=>msgcat['Exit'], + TkButton.new(f, :text=>msgcat['Exit'], :command=>proc{exit}).pack(:side=>:right, :padx=>5) }.pack(:side=>:bottom, :fill=>:x) @@ -90,7 +90,7 @@ 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 Index: ext/tk/sample/tkmultilistframe.rb =================================================================== --- ext/tk/sample/tkmultilistframe.rb (revision 23917) +++ ext/tk/sample/tkmultilistframe.rb (working copy) @@ -32,7 +32,7 @@ # decide total width @lbox_total = title_info.size @width_total = 0 - title_info.each{|title, width, cmd| + title_info.each{|title, width, cmd| @width_total += width.to_f @title_cmd << cmd } @@ -54,37 +54,37 @@ # virtical scrollbar =begin - @v_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, - 'borderwidth'=>@scrbar_border, + @v_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, + 'borderwidth'=>@scrbar_border, 'orient'=>'vertical', 'width'=>@scrbar_width) =end - @v_scroll = TkYScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, - 'borderwidth'=>@scrbar_border, + @v_scroll = TkYScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, + 'borderwidth'=>@scrbar_border, 'width'=>@scrbar_width) # horizontal scrollbar =begin - @h_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, - 'borderwidth'=>@scrbar_border, + @h_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, + 'borderwidth'=>@scrbar_border, 'orient'=>'horizontal', 'width'=>@scrbar_width) =end - @h_scroll = TkXScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, - 'borderwidth'=>@scrbar_border, + @h_scroll = TkXScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, + 'borderwidth'=>@scrbar_border, 'width'=>@scrbar_width) # create base flames - @c_title = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, + @c_title = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, 'width'=>@window_width) @f_title = TkFrame.new(@c_title, 'width'=>@width_total) - @w_title = TkcWindow.new(@c_title, 0, 0, + @w_title = TkcWindow.new(@c_title, 0, 0, 'window'=>@f_title, 'anchor'=>'nw') - @c_lbox = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, + @c_lbox = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, 'width'=>@window_width) @f_lbox = TkFrame.new(@c_lbox, 'width'=>@width_total) @w_lbox = TkcWindow.new(@c_lbox, 0, 0, 'window'=>@f_lbox, 'anchor'=>'nw') - @c_hscr = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, + @c_hscr = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, 'width'=>@window_width) @f_hscr = TkFrame.new(@c_hscr, 'width'=>@width_total) @w_hscr = TkcWindow.new(@c_hscr, 0, 0, 'window'=>@f_hscr, 'anchor'=>'nw') @@ -108,45 +108,45 @@ f = TkFrame.new(@f_title, 'width'=>width) base = [f] - title = TkLabel.new(f, 'text'=>label, 'borderwidth'=>@title_border, + title = TkLabel.new(f, 'text'=>label, 'borderwidth'=>@title_border, 'relief'=>'raised', 'highlightthickness'=>@h_l_thick) title_binding(title, idx) title.pack('fill'=>'x') @title_list << title - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, - 'relheight'=>1.0, + f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, + 'relheight'=>1.0, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx]) # listbox field f = TkFrame.new(@f_lbox, 'width'=>width) base << f - @lbox_list << TkListbox.new(f, 'highlightthickness'=>@h_l_thick, + @lbox_list << TkListbox.new(f, 'highlightthickness'=>@h_l_thick, 'borderwidth'=>@lbox_border ).pack('fill'=>'both', 'expand'=>true) - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, + f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0) # scrollbar field f = TkFrame.new(@f_hscr, 'width'=>width) base << f =begin - @hscr_list << TkScrollbar.new(f, 'orient'=>'horizontal', - 'width'=>@scrbar_width, - 'borderwidth'=>@scrbar_border, + @hscr_list << TkScrollbar.new(f, 'orient'=>'horizontal', + 'width'=>@scrbar_width, + 'borderwidth'=>@scrbar_border, 'highlightthickness'=>@h_l_thick ).pack('fill'=>'x', 'anchor'=>'w') =end - @hscr_list << TkXScrollbar.new(f, 'width'=>@scrbar_width, - 'borderwidth'=>@scrbar_border, + @hscr_list << TkXScrollbar.new(f, 'width'=>@scrbar_width, + 'borderwidth'=>@scrbar_border, 'highlightthickness'=>@h_l_thick ).pack('fill'=>'x', 'anchor'=>'w') - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, + f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx]) =begin - @lbox_list[idx].xscrollcommand proc{|first, last| + @lbox_list[idx].xscrollcommand proc{|first, last| @hscr_list[idx].set first, last } @hscr_list[idx].command proc{|*args| @lbox_list[idx].xview *args} @@ -159,23 +159,23 @@ # pad # @f_title_pad = TkFrame.new(@frame) - @f_title_pad = TkFrame.new(@frame, 'relief'=>'raised', - 'borderwidth'=>@title_border, + @f_title_pad = TkFrame.new(@frame, 'relief'=>'raised', + 'borderwidth'=>@title_border, 'highlightthickness'=>@h_l_thick) - @f_scr_pad = TkFrame.new(@frame, 'relief'=>'sunken', - 'borderwidth'=>1, + @f_scr_pad = TkFrame.new(@frame, 'relief'=>'sunken', + 'borderwidth'=>1, 'highlightthickness'=>@h_l_thick) # height check title_height = 0 - @title_list.each{|w| + @title_list.each{|w| h = w.winfo_reqheight title_height = h if title_height < h } hscr_height = 0 - @hscr_list.each{|w| + @hscr_list.each{|w| h = w.winfo_reqheight hscr_height = h if hscr_height < h } @@ -187,7 +187,7 @@ # set control procedure for virtical scroll =begin @lbox_list.each{|lbox| - lbox.yscrollcommand proc{|first, last| + lbox.yscrollcommand proc{|first, last| @v_scroll.set first, last } } @@ -197,16 +197,16 @@ # set control procedure for horizoncal scroll =begin - @c_title.xscrollcommand proc{|first, last| + @c_title.xscrollcommand proc{|first, last| @h_scroll.set first, last } - @c_lbox.xscrollcommand proc{|first, last| + @c_lbox.xscrollcommand proc{|first, last| @h_scroll.set first, last } - @c_hscr.xscrollcommand proc{|first, last| + @c_hscr.xscrollcommand proc{|first, last| @h_scroll.set first, last } - @h_scroll.command proc{|*args| + @h_scroll.command proc{|*args| @c_title.xview *args @c_lbox.xview *args @c_hscr.xview *args if @show_each_hscr @@ -221,17 +221,17 @@ @lbox_mode['extended'] = extended_mode_bindtag @lbox_mode['multiple'] = multiple_mode_bindtag @current_mode = 'browse' - @lbox_list.each_with_index{|l, idx| - l.bind('Shift-Key-Left', + @lbox_list.each_with_index{|l, idx| + l.bind('Shift-Key-Left', proc{|w| focus_shift(w, -1); Tk.callback_break}, '%W') - l.bind('Shift-Key-Right', + l.bind('Shift-Key-Right', proc{|w| focus_shift(w, 1); Tk.callback_break}, '%W') - l.bind('Button-2', proc{|x, y| + l.bind('Button-2', proc{|x, y| @lbox_mark_x = x @lbox_list.each{|lbox| lbox.scan_mark(x, y)} }, '%x %y') - l.bind('B2-Motion', proc{|x, y| + l.bind('B2-Motion', proc{|x, y| @lbox_list.each{|lbox| lbox.scan_dragto(@lbox_mark_x, y)} l.scan_dragto(x, y) }, '%x %y') @@ -270,8 +270,8 @@ @f_scr_pad.grid('row'=>2, 'rowspan'=>2, 'column'=>2, 'sticky'=>'news') # binding for 'Configure' event - @c_lbox.bind('Configure', - proc{|height, width| reconstruct(height, width)}, + @c_lbox.bind('Configure', + proc{|height, width| reconstruct(height, width)}, '%h %w') # set default receiver of method calls @@ -316,7 +316,7 @@ # set 'mode' option of listboxes def mode(sel_mode) - @lbox_list.each{|l| + @lbox_list.each{|l| tags = l.bindtags tags = tags - [ @lbox_mode[@current_mode] ] l.bindtags(tags.unshift(@lbox_mode[sel_mode])) @@ -395,7 +395,7 @@ def titlefont(font) @title_list.each{|label| label['font'] = font} title_height = 0 - @title_list.each{|w| + @title_list.each{|w| h = w.winfo_reqheight title_height = h if title_height < h } @@ -498,7 +498,7 @@ array[indices[0]] = line[label] else if line[label].kind_of? Array - indices.each_with_index{|index, num| + indices.each_with_index{|index, num| array[index] = line[label][num] } else @@ -516,9 +516,9 @@ indices.each{|index| lbox_ins[index] << line[index]} end } - } + } - @lbox_list.each_with_index{|lbox, index| + @lbox_list.each_with_index{|lbox, index| lbox.insert(idx, *lbox_ins[index]) if lbox_ins[index] } end @@ -560,7 +560,7 @@ (0..(@rel_list.size - 2)).each{|idx| title, lbox, hscr = @base_list[idx] title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx]) - lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0) hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx]) } @@ -587,11 +587,11 @@ # adjustment of rightside widget of the sash title, lbox, hscr = @base_list[idx] - title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relx'=>@rel_list[idx]) - lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relx'=>@rel_list[idx], 'relheight'=>1.0) - hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relx'=>@rel_list[idx]) # update reference position @@ -615,34 +615,34 @@ end def title_binding(title, index) - title.bind('Motion', proc{|w, x, idx| motion_cb(w, x, idx.to_i)}, + title.bind('Motion', proc{|w, x, idx| motion_cb(w, x, idx.to_i)}, "%W %x #{index}") - title.bind('Enter', proc{|w, x, idx| motion_cb(w, x, idx.to_i)}, + title.bind('Enter', proc{|w, x, idx| motion_cb(w, x, idx.to_i)}, "%W %x #{index}") title.bind('Leave', proc{|w| w.cursor ""}, "%W") - title.bind('Button-1', - proc{|w, x| + title.bind('Button-1', + proc{|w, x| if @mode == :sash @x = x @frame_width = TkWinfo.width(@f_title).to_f else title.relief 'sunken' end - }, + }, '%W %X') - title.bind('ButtonRelease-1', - proc{|w, x, idx| + title.bind('ButtonRelease-1', + proc{|w, x, idx| i = idx.to_i if @mode == :title && @title_cmd[i].kind_of?(Proc) @title_cmd[i].call end title.relief 'raised' motion_cb(w,x,i) - }, + }, "%W %x #{index}") title.bind('B1-Motion', proc{|x| resize(x) if @mode == :sash}, "%X") @@ -651,11 +651,11 @@ ################################# def browse_mode_bindtag t = TkBindTag.new - t.bind('Button-1', + t.bind('Button-1', proc{|w, y| w.focus; select_line(w, w.nearest(y))}, '%W %y') t.bind('B1-Motion', proc{|w, y| select_line(w, w.nearest(y))}, '%W %y') - t.bind('Shift-Button-1', + t.bind('Shift-Button-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W') @@ -666,7 +666,7 @@ t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W') t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Control-slash', + t.bind('Control-slash', proc{|w| select_line(w, w.index('active').to_i)}, '%W') t @@ -675,12 +675,12 @@ ######################## def single_mode_bindtag t = TkBindTag.new - t.bind('Button-1', + t.bind('Button-1', proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y') - t.bind('ButtonRelease-1', + t.bind('ButtonRelease-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') - t.bind('Shift-Button-1', + t.bind('Shift-Button-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W') @@ -691,9 +691,9 @@ t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W') t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Control-slash', + t.bind('Control-slash', proc{|w| select_line(w, w.index('active').to_i)}, '%W') - t.bind('Control-backslash', + t.bind('Control-backslash', proc{@lbox_list.each{|l| l.selection_clear(0, 'end')}}) t @@ -702,22 +702,22 @@ ######################## def extended_mode_bindtag t = TkBindTag.new - t.bind('Button-1', + t.bind('Button-1', proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y') t.bind('B1-Motion', proc{|w, y| select_range(w, w.nearest(y))}, '%W %y') - t.bind('ButtonRelease-1', + t.bind('ButtonRelease-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') - t.bind('Shift-Button-1', + t.bind('Shift-Button-1', proc{|w, y| select_range(w, w.nearest(y))}, '%W %y') - t.bind('Shift-B1-Motion', + t.bind('Shift-B1-Motion', proc{|w, y| select_range(w, w.nearest(y))}, '%W %y') - t.bind('Control-Button-1', + t.bind('Control-Button-1', proc{|w, y| select_toggle(w, w.nearest(y))}, '%W %y') - t.bind('Control-B1-Motion', + t.bind('Control-B1-Motion', proc{|w, y| select_drag(w, w.nearest(y))}, '%W %y') t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W') @@ -743,9 +743,9 @@ ######################## def multiple_mode_bindtag t = TkBindTag.new - t.bind('Button-1', + t.bind('Button-1', proc{|w, y| w.focus; select_line3(w, w.nearest(y))}, '%W %y') - t.bind('ButtonRelease-1', + t.bind('ButtonRelease-1', proc{|w, y| active_line(w, w.nearest(y))}, '%W %y') t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W') @@ -905,13 +905,13 @@ # test ################################################ if __FILE__ == $0 - l = TkMultiListFrame.new(nil, 200, - [ ['L1', 200, proc{p 'click L1'}], - ['L2', 100], - ['L3', 200] ], - 'width'=>350, - #'titleforeground'=>'yellow', - 'titleforeground'=>'white', + l = TkMultiListFrame.new(nil, 200, + [ ['L1', 200, proc{p 'click L1'}], + ['L2', 100], + ['L3', 200] ], + 'width'=>350, + #'titleforeground'=>'yellow', + 'titleforeground'=>'white', #'titlebackground'=>'navy', 'titlebackground'=>'blue', 'titlefont'=>'courier' @@ -919,7 +919,7 @@ l.insert('end', [1,2,3]) l.insert('end', [4,5,6]) l.insert('end', [4,5,6], [4,5,6]) - l.insert('end', ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + l.insert('end', ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', 'cccccccccccccccccccccccccccccccccccccccccccccccccccc']) l.insert('end', [1,2,3]) Index: ext/tk/sample/tkalignbox.rb =================================================================== --- ext/tk/sample/tkalignbox.rb (revision 23917) +++ ext/tk/sample/tkalignbox.rb (working copy) @@ -1,19 +1,19 @@ # # tkalignbox.rb : align widgets with same width/height -# +# # by Hidetoshi NAGAI # -# The box size depends on 'reqheight' and 'reqwidth' of contained widgets. -# If you want to give the box size when those requested sizes are 0, -# please set box.propagate = false (See the test routine at the tail of +# The box size depends on 'reqheight' and 'reqwidth' of contained widgets. +# If you want to give the box size when those requested sizes are 0, +# please set box.propagate = false (See the test routine at the tail of # this file). require 'tk' -class TkAlignBox < TkFrame +class Tk::AlignBox < TkFrame def initialize(*args) - if self.class == TkAlignBox - fail RuntimeError, "TkAlignBox is an abstract class" + if self.class == Tk::AlignBox + fail RuntimeError, "Tk::AlignBox is an abstract class" end @padx = 0 @pady = 0 @@ -31,12 +31,12 @@ end def _set_framesize - fail RuntimeError, "TkAlignBox is an abstract class" + fail RuntimeError, "Tk::AlignBox is an abstract class" end private :_set_framesize def _place_config(widget, idx, cnt) - fail RuntimeError, "TkAlignBox is an abstract class" + fail RuntimeError, "Tk::AlignBox is an abstract class" end private :_place_config @@ -117,7 +117,7 @@ attr_accessor :propagate end -class TkHBox < TkAlignBox +class Tk::HBox < Tk::AlignBox def _set_framesize bd = self.borderwidth self.width((@max_width + 2*@padx) * @widgets.size + 2*bd) @@ -126,28 +126,28 @@ private :_set_framesize def _place_config(widget, idx, cnt) - widget.place_in(self, - 'relx'=>idx/cnt, 'x'=>@padx, - 'rely'=>0, 'y'=>@pady, - 'relwidth'=>1.0/cnt, 'width'=>-2*@padx, + widget.place_in(self, + 'relx'=>idx/cnt, 'x'=>@padx, + 'rely'=>0, 'y'=>@pady, + 'relwidth'=>1.0/cnt, 'width'=>-2*@padx, 'relheight'=>1.0, 'height'=>-2*@pady) end private :_place_config end -TkHLBox = TkHBox +Tk::HLBox = Tk::HBox -class TkHRBox < TkHBox +class Tk::HRBox < Tk::HBox def _place_config(widget, idx, cnt) - widget.place_in(self, - 'relx'=>(cnt - idx - 1)/cnt, 'x'=>@padx, - 'rely'=>0, 'y'=>@pady, - 'relwidth'=>1.0/cnt, 'width'=>-2*@padx, + widget.place_in(self, + 'relx'=>(cnt - idx - 1)/cnt, 'x'=>@padx, + 'rely'=>0, 'y'=>@pady, + 'relwidth'=>1.0/cnt, 'width'=>-2*@padx, 'relheight'=>1.0, 'height'=>-2*@pady) end private :_place_config end -class TkVBox < TkAlignBox +class Tk::VBox < Tk::AlignBox def _set_framesize bd = self.borderwidth self.width(@max_width + 2*@padx + 2*bd) @@ -156,22 +156,22 @@ private :_set_framesize def _place_config(widget, idx, cnt) - widget.place_in(self, - 'relx'=>0, 'x'=>@padx, - 'rely'=>idx/cnt, 'y'=>@pady, - 'relwidth'=>1.0, 'width'=>-2*@padx, + widget.place_in(self, + 'relx'=>0, 'x'=>@padx, + 'rely'=>idx/cnt, 'y'=>@pady, + 'relwidth'=>1.0, 'width'=>-2*@padx, 'relheight'=>1.0/cnt, 'height'=>-2*@pady) end private :_place_config end -TkVTBox = TkVBox +Tk::VTBox = Tk::VBox -class TkVBBox < TkVBox +class Tk::VBBox < Tk::VBox def _place_config(widget, idx, cnt) - widget.place_in(self, - 'relx'=>0, 'x'=>@padx, - 'rely'=>(cnt - idx - 1)/cnt, 'y'=>@pady, - 'relwidth'=>1.0, 'width'=>-2*@padx, + widget.place_in(self, + 'relx'=>0, 'x'=>@padx, + 'rely'=>(cnt - idx - 1)/cnt, 'y'=>@pady, + 'relwidth'=>1.0, 'width'=>-2*@padx, 'relheight'=>1.0/cnt, 'height'=>-2*@pady) end private :_place_config @@ -181,43 +181,43 @@ # test ################################################ if __FILE__ == $0 - f = TkHBox.new(:borderwidth=>3, :relief=>'ridge').pack + f = Tk::HBox.new(:borderwidth=>3, :relief=>'ridge').pack f.add(TkButton.new(f, :text=>'a'), TkButton.new(f, :text=>'aa', :font=>'Helvetica 16'), TkButton.new(f, :text=>'aaa'), TkButton.new(f, :text=>'aaaa')) - f = TkHBox.new(:borderwidth=>3, :relief=>'ridge', + f = Tk::HBox.new(:borderwidth=>3, :relief=>'ridge', :padx=>7, :pady=>3, :background=>'yellow').pack f.add(TkButton.new(f, :text=>'a'), TkButton.new(f, :text=>'aa', :font=>'Helvetica 16'), TkButton.new(f, :text=>'aaa'), TkButton.new(f, :text=>'aaaa')) - f = TkVBox.new(:borderwidth=>5, :relief=>'groove').pack + f = Tk::VBox.new(:borderwidth=>5, :relief=>'groove').pack(:fill=>:y, :expand=>true) f.add(TkButton.new(f, :text=>'a'), TkButton.new(f, :text=>'aa', :font=>'Helvetica 30'), TkButton.new(f, :text=>'aaa'), TkButton.new(f, :text=>'aaaa')) - f = TkHRBox.new(:borderwidth=>3, :relief=>'raised').pack(:fill=>:x) + f = Tk::HRBox.new(:borderwidth=>3, :relief=>'raised').pack(:fill=>:x) f.add(TkButton.new(f, :text=>'a'), - TkButton.new(f, :text=>'aa'), + TkButton.new(f, :text=>'aa'), TkButton.new(f, :text=>'aaa')) - f = TkVBBox.new(:borderwidth=>3, :relief=>'ridge').pack(:fill=>:x) + f = Tk::VBBox.new(:borderwidth=>3, :relief=>'ridge').pack(:fill=>:x) f.propagate = false f.height 100 - f.add(TkFrame.new(f){|ff| - TkButton.new(ff, :text=>'a').pack(:pady=>4, :padx=>6, + f.add(TkFrame.new(f){|ff| + TkButton.new(ff, :text=>'a').pack(:pady=>4, :padx=>6, :fill=>:both, :expand=>true) - }, - TkFrame.new(f){|ff| - TkButton.new(ff, :text=>'aa').pack(:pady=>4, :padx=>6, + }, + TkFrame.new(f){|ff| + TkButton.new(ff, :text=>'aa').pack(:pady=>4, :padx=>6, :fill=>:both, :expand=>true) - }, - TkFrame.new(f){|ff| - TkButton.new(ff, :text=>'aaaa').pack(:pady=>4, :padx=>6, + }, + TkFrame.new(f){|ff| + TkButton.new(ff, :text=>'aaaa').pack(:pady=>4, :padx=>6, :fill=>:both, :expand=>true) }) Index: ext/tk/sample/tktimer3.rb =================================================================== --- ext/tk/sample/tktimer3.rb (revision 23917) +++ ext/tk/sample/tktimer3.rb (working copy) @@ -5,7 +5,7 @@ # new notation : # * symbols are acceptable as keys or values of the option hash -# * the parent widget can be given by :parent key on the option hash +# * the parent widget can be given by :parent key on the option hash root = TkRoot.new(:title=>'timer sample') label = TkLabel.new(:parent=>root, :relief=>:raised, :width=>10) \ .pack(:side=>:bottom, :fill=>:both) @@ -19,11 +19,11 @@ } timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 }) - # ==> repeat-interval : (about) 50 ms, - # repeat : infinite (-1) times, + # ==> repeat-interval : (about) 50 ms, + # repeat : infinite (-1) times, # repeat-procedure : tick (only one, in this case) # - # ==> wait-before-call-init-proc : 0 ms, + # ==> wait-before-call-init-proc : 0 ms, # init_proc : proc{ label.text('0.00'); 0 } # # (0ms)-> init_proc ->(50ms)-> tick ->(50ms)-> tick ->.... Index: ext/tk/sample/tkmulticolumnlist.rb =================================================================== --- ext/tk/sample/tkmulticolumnlist.rb (revision 23917) +++ ext/tk/sample/tkmulticolumnlist.rb (working copy) @@ -32,7 +32,7 @@ # decide total width @lbox_total = title_info.size @width_total = 0 - title_info.each{|title, width, cmd| + title_info.each{|title, width, cmd| @width_total += width.to_f @title_cmd << cmd } @@ -54,28 +54,28 @@ @command = nil # virtical scrollbar - @v_scroll = TkYScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, - 'borderwidth'=>@scrbar_border, + @v_scroll = TkYScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, + 'borderwidth'=>@scrbar_border, 'width'=>@scrbar_width) # horizontal scrollbar - @h_scroll = TkXScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, - 'borderwidth'=>@scrbar_border, + @h_scroll = TkXScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick, + 'borderwidth'=>@scrbar_border, 'width'=>@scrbar_width) # create base flames - @c_title = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, + @c_title = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, 'width'=>@window_width) @f_title = TkFrame.new(@c_title, 'width'=>@width_total) - @w_title = TkcWindow.new(@c_title, 0, 0, + @w_title = TkcWindow.new(@c_title, 0, 0, 'window'=>@f_title, 'anchor'=>'nw') - @c_lbox = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, + @c_lbox = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, 'width'=>@window_width) @f_lbox = TkFrame.new(@c_lbox, 'width'=>@width_total) @w_lbox = TkcWindow.new(@c_lbox, 0, 0, 'window'=>@f_lbox, 'anchor'=>'nw') - @c_hscr = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, + @c_hscr = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick, 'width'=>@window_width) @f_hscr = TkFrame.new(@c_hscr, 'width'=>@width_total) @w_hscr = TkcWindow.new(@c_hscr, 0, 0, 'window'=>@f_hscr, 'anchor'=>'nw') @@ -99,28 +99,28 @@ f = TkFrame.new(@f_title, 'width'=>width) base = [f] - title = TkLabel.new(f, 'text'=>label, 'borderwidth'=>@title_border, + title = TkLabel.new(f, 'text'=>label, 'borderwidth'=>@title_border, 'relief'=>'raised', 'highlightthickness'=>@h_l_thick) title_binding(title, idx) title.pack('fill'=>'x') @title_list << title - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, - 'relheight'=>1.0, + f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, + 'relheight'=>1.0, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx]) # listbox field f = TkFrame.new(@f_lbox, 'width'=>width) base << f - @lbox_list << TkText.new(f, 'highlightthickness'=>@h_l_thick, - 'borderwidth'=>@lbox_border, - 'takefocus'=>false, + @lbox_list << TkText.new(f, 'highlightthickness'=>@h_l_thick, + 'borderwidth'=>@lbox_border, + 'takefocus'=>false, 'wrap'=>'none') { bindtags(bindtags - [TkText]) - @seltag = TkTextTag.new(self, 'background'=>'#b3b3b3', + @seltag = TkTextTag.new(self, 'background'=>'#b3b3b3', 'borderwidth'=>1, 'relief'=>'raised') def self.nearest(y) self.index("@1,#{y}").split('.')[0].to_i @@ -151,17 +151,17 @@ pack('fill'=>'both', 'expand'=>true) } - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, + f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0) # scrollbar field f = TkFrame.new(@f_hscr, 'width'=>width) base << f - @hscr_list << TkXScrollbar.new(f, 'width'=>@scrbar_width, - 'borderwidth'=>@scrbar_border, + @hscr_list << TkXScrollbar.new(f, 'width'=>@scrbar_width, + 'borderwidth'=>@scrbar_border, 'highlightthickness'=>@h_l_thick ).pack('fill'=>'x', 'anchor'=>'w') - f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, + f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1, 'relwidth'=>@rel_list[idx+1] - @rel_list[idx]) @lbox_list[idx].xscrollbar(@hscr_list[idx]) @@ -171,23 +171,23 @@ } # pad - @f_title_pad = TkFrame.new(@frame, 'relief'=>'raised', - 'borderwidth'=>@title_border, + @f_title_pad = TkFrame.new(@frame, 'relief'=>'raised', + 'borderwidth'=>@title_border, 'highlightthickness'=>@h_l_thick) - @f_scr_pad = TkFrame.new(@frame, 'relief'=>'sunken', - 'borderwidth'=>1, + @f_scr_pad = TkFrame.new(@frame, 'relief'=>'sunken', + 'borderwidth'=>1, 'highlightthickness'=>@h_l_thick) # height check title_height = 0 - @title_list.each{|w| + @title_list.each{|w| h = w.winfo_reqheight title_height = h if title_height < h } hscr_height = 0 - @hscr_list.each{|w| + @hscr_list.each{|w| h = w.winfo_reqheight hscr_height = h if hscr_height < h } @@ -203,12 +203,12 @@ @h_scroll.assign(@c_title, @c_lbox, @c_hscr) # binding for listboxes - @lbox_list.each_with_index{|l, idx| - l.bind('Button-1', proc{|w, y| + @lbox_list.each_with_index{|l, idx| + l.bind('Button-1', proc{|w, y| @frame.focus select_line(w, w.nearest(y)) }, '%W %y') - l.bind('B1-Motion', proc{|w, y| + l.bind('B1-Motion', proc{|w, y| select_line(w, w.nearest(y)) }, '%W %y') l.bind('Double-Button-1', proc{ @@ -218,11 +218,11 @@ l.bind('Control-Home', proc{|w| select_line(w, 0)}, '%W') l.bind('Control-End', proc{|w| select_line(w, 'end')}, '%W') - l.bind('Button-2', proc{|x, y| + l.bind('Button-2', proc{|x, y| @lbox_mark_x = x @lbox_list.each{|lbox| lbox.scan_mark(x, y)} }, '%x %y') - l.bind('B2-Motion', proc{|x, y| + l.bind('B2-Motion', proc{|x, y| @lbox_list.each{|lbox| lbox.scan_dragto(@lbox_mark_x, y)} l.scan_dragto(x, y) }, '%x %y') @@ -265,8 +265,8 @@ @f_scr_pad.grid('row'=>2, 'rowspan'=>2, 'column'=>2, 'sticky'=>'news') # binding for 'Configure' event - @c_lbox.bind('Configure', - proc{|height, width| reconstruct(height, width)}, + @c_lbox.bind('Configure', + proc{|height, width| reconstruct(height, width)}, '%h %w') # set default receiver of method calls @@ -386,7 +386,7 @@ def titlefont(font) @title_list.each{|label| label['font'] = font} title_height = 0 - @title_list.each{|w| + @title_list.each{|w| h = w.winfo_reqheight title_height = h if title_height < h } @@ -523,7 +523,7 @@ array[indices[0]] = line[label] else if line[label].kind_of? Array - indices.each_with_index{|index, num| + indices.each_with_index{|index, num| array[index] = line[label][num] } else @@ -541,9 +541,9 @@ indices.each{|index| lbox_ins[index] << line[index]} end } - } + } - @lbox_list.each_with_index{|lbox, index| + @lbox_list.each_with_index{|lbox, index| lbox.insert(idx, cr + lbox_ins[index].join("\n")) if lbox_ins[index] } end @@ -581,7 +581,7 @@ (0..(@rel_list.size - 2)).each{|idx| title, lbox, hscr = @base_list[idx] title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx]) - lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0) hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx]) } @@ -608,11 +608,11 @@ # adjustment of rightside widget of the sash title, lbox, hscr = @base_list[idx] - title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relx'=>@rel_list[idx]) - lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relx'=>@rel_list[idx], 'relheight'=>1.0) - hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], + hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relx'=>@rel_list[idx]) # update reference position @@ -636,34 +636,34 @@ end def title_binding(title, index) - title.bind('Motion', proc{|w, x, idx| motion_cb(w, x, idx.to_i)}, + title.bind('Motion', proc{|w, x, idx| motion_cb(w, x, idx.to_i)}, "%W %x #{index}") - title.bind('Enter', proc{|w, x, idx| motion_cb(w, x, idx.to_i)}, + title.bind('Enter', proc{|w, x, idx| motion_cb(w, x, idx.to_i)}, "%W %x #{index}") title.bind('Leave', proc{|w| w.cursor ""}, "%W") - title.bind('Button-1', - proc{|w, x| + title.bind('Button-1', + proc{|w, x| if @mode == :sash @x = x @frame_width = TkWinfo.width(@f_title).to_f else title.relief 'sunken' end - }, + }, '%W %X') - title.bind('ButtonRelease-1', - proc{|w, x, idx| + title.bind('ButtonRelease-1', + proc{|w, x, idx| i = idx.to_i if @mode == :title && @title_cmd[i].kind_of?(Proc) @title_cmd[i].call end title.relief 'raised' motion_cb(w,x,i) - }, + }, "%W %x #{index}") title.bind('B1-Motion', proc{|x| resize(x) if @mode == :sash}, "%X") @@ -705,13 +705,13 @@ # test ################################################ if __FILE__ == $0 - l = TkMultiColumnList.new(nil, 200, - [ ['L1', 200, proc{p 'click L1'}], - ['L2', 100], - ['L3', 200] ], - 'width'=>350, - #'titleforeground'=>'yellow', - 'titleforeground'=>'white', + l = TkMultiColumnList.new(nil, 200, + [ ['L1', 200, proc{p 'click L1'}], + ['L2', 100], + ['L3', 200] ], + 'width'=>350, + #'titleforeground'=>'yellow', + 'titleforeground'=>'white', #'titlebackground'=>'navy', 'titlebackground'=>'blue', 'titlefont'=>'courier' @@ -719,7 +719,7 @@ l.insert('end', [1,2,3]) l.insert('end', [4,5,6]) l.insert('end', [4,5,6], [4,5,6]) - l.insert('end', ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + l.insert('end', ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', 'cccccccccccccccccccccccccccccccccccccccccccccccccccc']) l.insert('end', [1,2,3]) Index: ext/tk/sample/demos-en/plot.rb =================================================================== --- ext/tk/sample/demos-en/plot.rb (revision 23917) +++ ext/tk/sample/demos-en/plot.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($plot_demo) && $plot_demo - $plot_demo.destroy + $plot_demo.destroy $plot_demo = nil end @@ -22,7 +22,7 @@ base_frame = TkFrame.new($plot_demo).pack(:fill=>:both, :expand=>true) # label -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', 'text'=>"This window displays a canvas widget containing a simple 2-dimensional plot. You can doctor the data by dragging any of the points with mouse button 1."){ pack('side'=>'top') } @@ -45,55 +45,55 @@ } $plot_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# font +# font plotFont = '-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*' -# canvas +# canvas $plot_canvas = TkCanvas.new(base_frame,'relief'=>'raised','width'=>450,'height'=>300) $plot_canvas.pack('side'=>'top', 'fill'=>'x') -# plot +# plot TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2) TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2) -TkcText.new($plot_canvas, 225, 20, +TkcText.new($plot_canvas, 225, 20, 'text'=>"A Simple Plot", 'font'=>plotFont, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) TkcLine.new($plot_canvas, x, 250, x, 245, 'width'=>2) - TkcText.new($plot_canvas, x, 254, + TkcText.new($plot_canvas, x, 254, 'text'=>10*i, 'font'=>plotFont, 'anchor'=>'n') } (0..5).each {|i| y = 250 - (i * 40) TkcLine.new($plot_canvas, 100, y, 105, y, 'width'=>2) - TkcText.new($plot_canvas, 96, y, + TkcText.new($plot_canvas, 96, y, 'text'=>"#{i*50}.0", 'font'=>plotFont, 'anchor'=>'e') } for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] x = 100 + (3*xx) y = 250 - (4*yy)/5 - item = TkcOval.new($plot_canvas, x-6, y-6, x+6, y+6, + item = TkcOval.new($plot_canvas, x-6, y-6, x+6, y+6, 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') item.addtag 'point' end -$plot_canvas.itembind('point', 'Any-Enter', +$plot_canvas.itembind('point', 'Any-Enter', proc{$plot_canvas.itemconfigure 'current','fill','red'}) -$plot_canvas.itembind('point', 'Any-Leave', +$plot_canvas.itembind('point', 'Any-Leave', proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'}) -$plot_canvas.itembind('point', '1', +$plot_canvas.itembind('point', '1', proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y") -$plot_canvas.itembind('point', 'ButtonRelease-1', +$plot_canvas.itembind('point', 'ButtonRelease-1', proc{$plot_canvas.dtag 'selected'}) -$plot_canvas.bind('B1-Motion', +$plot_canvas.bind('B1-Motion', proc{|x,y| plotMove $plot_canvas,x,y}, "%x %y") $plot = {'lastX'=>0, 'lastY'=>0} # plotDown -- -# This method is invoked when the mouse is pressed over one of the +# This method is invoked when the mouse is pressed over one of the # data points. It sets up state to allow the point to be dragged. # # Arguments: Index: ext/tk/sample/demos-en/unicodeout.rb =================================================================== --- ext/tk/sample/demos-en/unicodeout.rb (revision 23917) +++ ext/tk/sample/demos-en/unicodeout.rb (working copy) @@ -6,7 +6,7 @@ # based on Tcl/Tk8.4.4 widget demos if defined?($unicodeout_demo) && $unicodeout_demo - $unicodeout_demo.destroy + $unicodeout_demo.destroy $unicodeout_demo = nil end @@ -18,8 +18,8 @@ base_frame = TkFrame.new($unicodeout_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'5.4i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'5.4i', :justify=>:left, :text=><:top) This is a sample of Tk's support for languages that use non-Western \ character sets. However, what you will actually see below depends \ @@ -32,10 +32,10 @@ The strings are written in Tcl using UNICODE characters \ using the \\uXXXX escape so as to do so in a portable fashion. -ATTENTION: +ATTENTION: The strings are converted to the encoded string objects \ (completed to rewrite Tcl's escapes) by Tk::UTF8_String method. \ -And the Tk::UTF8_String objects are passed to the label widgets. +And the Tk::UTF8_String objects are passed to the label widgets. EOL TkFrame.new(base_frame){|f| @@ -51,8 +51,8 @@ }).pack(:side=>:left, :expand=>true) } -wait_msg = TkLabel.new(base_frame, - :text=>"Please wait while loading fonts...", +wait_msg = TkLabel.new(base_frame, + :text=>"Please wait while loading fonts...", :font=>"Helvetica 12 italic").pack class Unicodeout_SampleFrame < TkFrame @@ -72,10 +72,10 @@ def add_sample(lang, *args) sample_txt = Tk::UTF8_String(args.join('')) - l = TkLabel.new(self, :font=>@@font, :text=>lang+':', + 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, + #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') @@ -91,23 +91,23 @@ $unicodeout_demo.cursor('watch') Tk.update -f.add_sample('Arabic', - '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94', +f.add_sample('Arabic', + '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94', '\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D') f.add_sample('Trad. Chinese', '\u4E2D\u570B\u7684\u6F22\u5B57') f.add_sample('Simpl. Chinese', '\u6C49\u8BED') -f.add_sample('Greek', - '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ', +f.add_sample('Greek', + '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ', '\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1') -f.add_sample('Hebrew', - '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ', +f.add_sample('Hebrew', + '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ', '\u05DC\u05D9\u05D0\u05E8\u05E9\u05D9') -f.add_sample('Japanese', - '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ', +f.add_sample('Japanese', + '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ', '\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA') f.add_sample('Korean', '\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00') -f.add_sample('Russian', - '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ', +f.add_sample('Russian', + '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ', '\u044F\u0437\u044B\u043A') wait_msg.destroy Index: ext/tk/sample/demos-en/items.rb =================================================================== --- ext/tk/sample/demos-en/items.rb (revision 23917) +++ ext/tk/sample/demos-en/items.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($items_demo) && $items_demo - $items_demo.destroy + $items_demo.destroy $items_demo = nil end @@ -49,7 +49,7 @@ # frame cvs = nil TkFrame.new(base_frame) {|cf| - # canvas + # canvas cvs = TkCanvas.new(cf) {|c| focus scrollregion '0c 0c 30c 24c' @@ -75,11 +75,11 @@ c.pack('in'=>cf, 'expand'=>'yes', 'fill'=>'both') else - c.grid('in'=>cf, 'row'=>0, 'column'=>0, + c.grid('in'=>cf, 'row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - vs.grid('row'=>0, 'column'=>1, + vs.grid('row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - hs.grid('row'=>1, 'column'=>0, + hs.grid('row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) TkGrid.columnconfigure(cf, 0, 'weight'=>1, 'minsize'=>0) @@ -115,13 +115,13 @@ green = 'black' end -# tag +# tag $tag_item = TkcGroup.new(cvs) # Set up demos within each of the areas of the grid. TkcText.new(cvs, '5c', '.2c', 'text'=>'Lines', 'anchor'=>'n') -TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c', - 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt', +TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c', + 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt', 'join'=>'miter', 'tags'=>$tag_item ) TkcLine.new(cvs, '4.67c','1c','4.67c','4c', 'arrow'=>'last', 'tags'=>$tag_item) TkcLine.new(cvs, '6.33c','1c','6.33c','4c', 'arrow'=>'both', 'tags'=>$tag_item) @@ -129,38 +129,38 @@ '4.8c','8.8c','1.2c','8.2c','1.2c','8.2c','4.6c','8.6c','4.6c', '8.6c','1.4c','8.4c','1.4c','8.4c','4.4c', 'width'=>3, 'fill'=>red, 'tags'=>$tag_item ) -TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c', +TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c', 'stipple'=>'@'+[$demo_dir,'..', - 'images','gray25.xbm'].join(File::Separator), + 'images','gray25.xbm'].join(File::Separator), 'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item ) TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c', - 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round', + 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round', 'tags'=>$tag_item ) -TkcText.new(cvs, '15c', '.2c', +TkcText.new(cvs, '15c', '.2c', 'text'=>'Curves (smoothed lines)', 'anchor'=>'n') -TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c', +TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c', 'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item ) -TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c', +TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c', 'smooth'=>'on', 'arrow'=>'both', 'width'=>3, 'tags'=>$tag_item ) -TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c', +TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c', '16.5c','4.5c','13.5c','7.5c','12c','6c', - 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round', + 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round', 'stipple'=>'@'+[$demo_dir, '..', - 'images', 'gray25.xbm'].join(File::Separator), + 'images', 'gray25.xbm'].join(File::Separator), 'fill'=>red, 'tags'=>$tag_item ) TkcText.new(cvs, '25c', '.2c', 'text'=>'Polygons', 'anchor'=>'n') TkcPolygon.new(cvs, '21c','1.0c','22.5c','1.75c','24c','1.0c','23.25c','2.5c', '24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c', - 'fill'=>'green', 'outline'=>'black', 'width'=>4, + 'fill'=>'green', 'outline'=>'black', 'width'=>4, 'tags'=>$tag_item ) TkcPolygon.new(cvs, '25c','4c','25c','4c','25c','1c','26c','1c','27c','4c', '28c','1c','29c','1c','29c','4c','29c','4c', 'fill'=>red, 'smooth'=>'on', 'tags'=> $tag_item) TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c', '28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c', - '7.5c','22c','7.5c', + '7.5c','22c','7.5c', 'stipple'=>'@' + [$demo_dir, '..', 'images', 'gray25.xbm'].join(File::Separator), 'outline'=>'black', 'tags'=>$tag_item ) @@ -168,7 +168,7 @@ TkcText.new(cvs, '5c', '8.2c', 'text'=>'Rectangles', 'anchor'=>'n') TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c', 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) -TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c', +TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c', 'fill'=>green, 'tags'=>$tag_item ) TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'', 'stipple'=>'@'+[$demo_dir,'..', @@ -178,7 +178,7 @@ TkcText.new(cvs, '15c', '8.2c', 'text'=>'Ovals', 'anchor'=>'n') TkcOval.new(cvs, '11c','9.5c','14c','12.5c', 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) -TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c', +TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c', 'fill'=>green, 'tags'=>$tag_item ) TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'', 'stipple'=>'@'+[$demo_dir,'..', @@ -187,40 +187,40 @@ TkcText.new(cvs, '25c', '8.2c', 'text'=>'Text', 'anchor'=>'n') TkcRectangle.new(cvs, '22.4c','8.9c','22.6c','9.1c') -TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c', +TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c', 'text'=>'A short string of text, word-wrapped, justified left, and anchored north (at the top). The rectangles show the anchor points for each piece of text.', 'tags'=>$tag_item ) TkcRectangle.new(cvs, '25.4c','10.9c','25.6c','11.1c') -TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue, +TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue, 'text'=>"Several lines,\n each centered\nindividually,\nand all anchored\nat the left edge.", 'justify'=>'center', 'tags'=>$tag_item ) TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c') if $tk_version =~ /^4\.[01]/ - TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, + TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, 'stipple'=>'@' + [$demo_dir, '..', 'images', 'grey.5'].join(File::Separator), 'text'=>'Stippled characters', 'tags'=>$tag_item ) else - TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, - 'stipple'=>'gray50', 'text'=>'Stippled characters', + TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, + 'stipple'=>'gray50', 'text'=>'Stippled characters', 'tags'=>$tag_item ) end TkcText.new(cvs, '5c', '16.2c', 'text'=>'Arcs', 'anchor'=>'n') -TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black', +TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black', 'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item) -#TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', -# 'outline'=>blue, 'start'=>135, 'extent'=>270, +#TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', +# 'outline'=>blue, 'start'=>135, 'extent'=>270, # 'outlinestipple'=>'@' + ['images', 'grey.25'].join(File::Separator), # 'tags'=>$tag_item) -TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', - 'outline'=>blue, 'start'=>135, 'extent'=>270, +TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', + 'outline'=>blue, 'start'=>135, 'extent'=>270, 'outlinestipple'=>'@'+[$demo_dir, '..', 'images','gray25.xbm'].join(File::Separator), 'tags'=>$tag_item) -TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice', - 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90, +TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice', + 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90, 'tags'=>$tag_item) TkcArc.new(cvs, '5.5c','20.5c','9.5c','23.5c', 'width'=>'4m', 'style'=>'chord', - 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270, + 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270, 'tags'=>$tag_item) TkcText.new(cvs, '15c', '16.2c', 'text'=>'Bitmaps', 'anchor'=>'n') @@ -241,7 +241,7 @@ #TkcBitmap.new(cvs, '17c','21.5c', # 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator), # 'tags'=>$tag_item) -# +# TkcBitmap.new(cvs, '17c','21.5c') { bitmap '@' + [$demo_dir, '..', 'images', 'letters.xbm'].join(File::Separator) tags $tag_item @@ -255,17 +255,17 @@ TkButton.new(cvs) {|b| text 'Press Me' command proc{butPress cvs, red} - TkcWindow.new(cvs, '21c','18c', + TkcWindow.new(cvs, '21c','18c', 'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item) } TkEntry.new(cvs, 'width'=>20, 'relief'=>'sunken') {|e| insert 'end', 'Edit this text' - TkcWindow.new(cvs, '21c','21c', + TkcWindow.new(cvs, '21c','21c', 'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item) } -TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c', +TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c', 'width'=>'.5c', 'tickinterval'=>0 ) {|scl| - TkcWindow.new(cvs, '28.5c','17.5c', + TkcWindow.new(cvs, '28.5c','17.5c', 'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item) } TkcText.new(cvs, '21c', '17.9c', 'text'=>'Button:', 'anchor'=>'sw') @@ -316,7 +316,7 @@ $restoreCmd.call if $restoreCmd end -# Utility methods for stroking out a rectangle and printing what's +# Utility methods for stroking out a rectangle and printing what's # underneath the rectangle's area. def itemMark(c,x,y) @@ -330,7 +330,7 @@ y = c.canvasy(y) if $areaX1 != x && $areaY1 != y c.delete 'area' - c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y, + c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y, '-outline', 'black') $areaX2 = x $areaY2 = y @@ -371,11 +371,11 @@ $lastY = y end -# Method that's invoked when the button embedded in the canvas +# Method that's invoked when the button embedded in the canvas # is invoked. def butPress(w,color) - i = TkcText.new(w, '25c', '18.1c', + i = TkcText.new(w, '25c', '18.1c', 'text'=>'Ouch!!', 'fill'=>color, 'anchor'=>'n') Tk.after(500, proc{w.delete i}) end Index: ext/tk/sample/demos-en/entry1.rb =================================================================== --- ext/tk/sample/demos-en/entry1.rb (revision 23917) +++ ext/tk/sample/demos-en/entry1.rb (working copy) @@ -4,7 +4,7 @@ # toplevel widget if defined?($entry1_demo) && $entry1_demo - $entry1_demo.destroy + $entry1_demo.destroy $entry1_demo = nil end @@ -43,13 +43,13 @@ }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# +# e1 = TkEntry.new(base_frame, 'relief'=>'sunken') e2 = TkEntry.new(base_frame, 'relief'=>'sunken') e3 = TkEntry.new(base_frame, 'relief'=>'sunken') [e1,e2,e3].each{|w| w.pack('side'=>'top', 'padx'=>10, 'pady'=>5, 'fill'=>'x')} -# +# e1.insert(0, 'Initial value') e2.insert('end', "This entry contains a long value, much too long ") e2.insert('end', "to fit in the window at one time, so long in fact ") Index: ext/tk/sample/demos-en/clrpick.rb =================================================================== --- ext/tk/sample/demos-en/clrpick.rb (revision 23917) +++ ext/tk/sample/demos-en/clrpick.rb (working copy) @@ -9,7 +9,7 @@ # toplevel widget if defined?($clrpick_demo) && $clrpick_demo - $clrpick_demo.destroy + $clrpick_demo.destroy $clrpick_demo = nil end @@ -47,10 +47,10 @@ }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# button +# button # TkButton.new($clrpick_demo, 'text'=>'Set background color ...') {|b| Tk::Button.new($clrpick_demo, 'text'=>'Set background color ...') {|b| - command(proc{setColor $clrpick_demo, b, 'background', + command(proc{setColor $clrpick_demo, b, 'background', ['background', 'highlightbackground']}) pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') } @@ -64,7 +64,7 @@ def setColor(w,button,name,options) w.grab initialColor = button[name] - color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w, + color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w, 'initialcolor'=>initialColor) if color != "" setColor_helper(w,options,color) Index: ext/tk/sample/demos-en/labelframe.rb =================================================================== --- ext/tk/sample/demos-en/labelframe.rb (revision 23917) +++ ext/tk/sample/demos-en/labelframe.rb (working copy) @@ -7,7 +7,7 @@ if defined?($labelframe_demo) && $labelframe_demo - $labelframe_demo.destroy + $labelframe_demo.destroy $labelframe_demo = nil end @@ -20,8 +20,8 @@ base_frame = TkFrame.new($labelframe_demo).pack(:fill=>:both, :expand=>true) # Some information -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'4i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top) Labelframes are used to group related widgets together. \ The label may be either plain text or another widget. \ @@ -45,17 +45,17 @@ } # Demo area -w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both, +w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both, :expand=>true) # A group of radiobuttons in a labelframe -TkLabelFrame.new(w, :text=>'Value', +TkLabelFrame.new(w, :text=>'Value', :padx=>2, :pady=>2) {|f| grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m') v = TkVariable.new (1..4).each{|i| - TkRadiobutton.new(f, :text=>"This is value #{i}", + TkRadiobutton.new(f, :text=>"This is value #{i}", :variable=>v, :value=>i) { pack(:side=>:top, :fill=>:x, :pady=>2) } @@ -78,7 +78,7 @@ end TkLabelFrame.new(w, :pady=>2, :padx=>2){|f| - TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy, + TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy, :text=>"Use this option.", :padx=>0) {|cb| command proc{lfEnableButtons(f)} f.labelwidget(cb) Index: ext/tk/sample/demos-en/mclist.rb =================================================================== --- ext/tk/sample/demos-en/mclist.rb (revision 23917) +++ ext/tk/sample/demos-en/mclist.rb (working copy) @@ -6,7 +6,7 @@ # based on "Id: mclist.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($mclist_demo) && $mclist_demo - $mclist_demo.destroy + $mclist_demo.destroy $mclist_demo = nil end @@ -19,8 +19,8 @@ base_frame = TkFrame.new($mclist_demo).pack(:fill=>:both, :expand=>true) ## Explanatory text -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', - :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', + :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], :text=><:x) Ttk is the new Tk themed widget set. \ One of the widgets it includes is a tree widget, \ @@ -36,23 +36,23 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'mclist'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'mclist'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $mclist_demo.destroy $mclist_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) } container = Ttk::Frame.new(base_frame) -tree = Ttk::Treeview.new(base_frame, :columns=>%w(country capital currency), +tree = Ttk::Treeview.new(base_frame, :columns=>%w(country capital currency), :show=>:headings) if Tk.windowingsystem != 'aqua' vsb = tree.yscrollbar(Ttk::Scrollbar.new(base_frame)) @@ -70,20 +70,20 @@ ## The data we're going to insert data = [ - ['Argentina', 'Buenos Aires', 'ARS'], - ['Australia', 'Canberra', 'AUD'], - ['Brazil', 'Brazilia', 'BRL'], - ['Canada', 'Ottawa', 'CAD'], - ['China', 'Beijing', 'CNY'], - ['France', 'Paris', 'EUR'], - ['Germany', 'Berlin', 'EUR'], - ['India', 'New Delhi', 'INR'], - ['Italy', 'Rome', 'EUR'], - ['Japan', 'Tokyo', 'JPY'], - ['Mexico', 'Mexico City', 'MXN'], - ['Russia', 'Moscow', 'RUB'], - ['South Africa', 'Pretoria', 'ZAR'], - ['United Kingdom', 'London', 'GBP'], + ['Argentina', 'Buenos Aires', 'ARS'], + ['Australia', 'Canberra', 'AUD'], + ['Brazil', 'Brazilia', 'BRL'], + ['Canada', 'Ottawa', 'CAD'], + ['China', 'Beijing', 'CNY'], + ['France', 'Paris', 'EUR'], + ['Germany', 'Berlin', 'EUR'], + ['India', 'New Delhi', 'INR'], + ['Italy', 'Rome', 'EUR'], + ['Japan', 'Tokyo', 'JPY'], + ['Mexico', 'Mexico City', 'MXN'], + ['Russia', 'Moscow', 'RUB'], + ['South Africa', 'Pretoria', 'ZAR'], + ['United Kingdom', 'London', 'GBP'], ['United States', 'Washington, D.C.', 'USD'], ] @@ -91,7 +91,7 @@ font = Ttk::Style.lookup(tree[:style], :font) cols = %w(country capital currency) cols.zip(%w(Country Capital Currency)).each{|col, name| - tree.heading_configure(col, :text=>name, + tree.heading_configure(col, :text=>name, :command=>proc{sort_by(tree, col, false)}) tree.column_configure(col, :width=>TkFont.measure(font, name)) } @@ -109,8 +109,8 @@ ## Code to do the sorting of the tree contents when clicked on def sort_by(tree, col, direction) - tree.children(nil).map!{|row| [tree.get(row, col), row.id]} . - sort(&((direction)? proc{|x, y| y <=> x}: proc{|x, y| x <=> y})) . + tree.children(nil).map!{|row| [tree.get(row, col), row.id]} . + sort(&((direction)? proc{|x, y| y <=> x}: proc{|x, y| x <=> y})) . each_with_index{|info, idx| tree.move(info[1], nil, idx)} tree.heading_configure(col, :command=>proc{sort_by(tree, col, ! direction)}) Index: ext/tk/sample/demos-en/tree.rb =================================================================== --- ext/tk/sample/demos-en/tree.rb (revision 23917) +++ ext/tk/sample/demos-en/tree.rb (working copy) @@ -6,7 +6,7 @@ # based on "Id: tree.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp" if defined?($tree_demo) && $tree_demo - $tree_demo.destroy + $tree_demo.destroy $tree_demo = nil end @@ -19,8 +19,8 @@ base_frame = TkFrame.new($tree_demo).pack(:fill=>:both, :expand=>true) ## Explanatory text -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', - :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', + :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], :text=><:x) Ttk is the new Tk themed widget set. \ One of the widgets it includes is a tree widget, \ @@ -37,16 +37,16 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'tree'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'tree'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $tree_demo.destroy $tree_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -55,7 +55,7 @@ ## Code to populate the roots of the tree (can be more than one on Windows) def populate_roots(tree) TkComm.simplelist(Tk.tk_call('file', 'volumes')).sort.each{|dir| - populate_tree(tree, tree.insert(nil, :end, :text=>dir, + populate_tree(tree, tree.insert(nil, :end, :text=>dir, :values=>[dir, 'directory'])) } end @@ -68,7 +68,7 @@ tree.delete(tree.children(node)) Dir.glob("#{path}/*").sort.each{|f| type = File.ftype(f) - id = tree.insert(node, :end, + id = tree.insert(node, :end, :text=>File.basename(f), :values=>[f, type]).id if type == 'directory' ## Make it so that this node is openable @@ -94,7 +94,7 @@ end ## Create the tree and set it up -tree = Ttk::Treeview.new(base_frame, :columns=>%w(fullpath type size), +tree = Ttk::Treeview.new(base_frame, :columns=>%w(fullpath type size), :displaycolumns=>['size']) if Tk.windowingsystem != 'aqua' vsb = tree.yscrollbar(Ttk::Scrollbar.new(base_frame)) Index: ext/tk/sample/demos-en/style.rb =================================================================== --- ext/tk/sample/demos-en/style.rb (revision 23917) +++ ext/tk/sample/demos-en/style.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($style_demo) && $style_demo - $style_demo.destroy + $style_demo.destroy $style_demo = nil end @@ -38,9 +38,9 @@ }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# text +# text txt = TkText.new(base_frame){|t| - # + # setgrid 'true' #width 70 #height 32 @@ -53,7 +53,7 @@ } pack('expand'=>'yes', 'fill'=>'both') - # + # family = 'Courier' if $tk_version =~ /^4.*/ @@ -76,44 +76,44 @@ # when /^8.*/ # unless $style_demo_do_first # $style_demo_do_first = true -# Tk.tk_call('font', 'create', '@bigascii', +# Tk.tk_call('font', 'create', '@bigascii', # '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*') -# Tk.tk_call('font', 'create', '@smallascii', +# Tk.tk_call('font', 'create', '@smallascii', # '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*') -# Tk.tk_call('font', 'create', '@cBigFont', +# Tk.tk_call('font', 'create', '@cBigFont', # '-compound', '@bigascii @msg_knj') -# Tk.tk_call('font', 'create', '@cSmallFont', +# Tk.tk_call('font', 'create', '@cSmallFont', # '-compound', '@smallascii @kanji') # end # style_tag_big = TkTextTag.new(t, 'font'=>'@cBigFont') # style_tag_small = TkTextTag.new(t, 'font'=>'@cSmallFont') # end - # + # if TkWinfo.depth($root).to_i > 1 style_tag_color1 = TkTextTag.new(t, 'background'=>'#a0b7ce') style_tag_color2 = TkTextTag.new(t, 'foreground'=>'red') style_tag_raised = TkTextTag.new(t, 'relief'=>'raised', 'borderwidth'=>1) style_tag_sunken = TkTextTag.new(t, 'relief'=>'sunken', 'borderwidth'=>1) else - style_tag_color1 = TkTextTag.new(t, 'background'=>'black', + style_tag_color1 = TkTextTag.new(t, 'background'=>'black', 'foreground'=>'white') - style_tag_color2 = TkTextTag.new(t, 'background'=>'black', + style_tag_color2 = TkTextTag.new(t, 'background'=>'black', 'foreground'=>'white') - style_tag_raised = TkTextTag.new(t, 'background'=>'white', + style_tag_raised = TkTextTag.new(t, 'background'=>'white', 'relief'=>'raised', 'borderwidth'=>1) - style_tag_sunken = TkTextTag.new(t, 'background'=>'white', + style_tag_sunken = TkTextTag.new(t, 'background'=>'white', 'relief'=>'sunken', 'borderwidth'=>1) end - # + # if $tk_version =~ /^4\.[01]/ - style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, + style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', + 'borderwidth'=>0, 'bgstipple'=>'gray25') else - style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', - 'borderwidth'=>0, + style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', + 'borderwidth'=>0, 'bgstipple'=>'gray12') end style_tag_fgstipple = TkTextTag.new(t, 'fgstipple'=>'gray50') @@ -134,7 +134,7 @@ 'lmargin1'=>'12m', 'lmargin2'=>'6m', 'rmargin'=>'10m') - # + # insert('end', 'Text widgets like this one allow you to display information in a variety of styles. Display styles are controlled using a mechanism called ') Index: ext/tk/sample/demos-en/cscroll.rb =================================================================== --- ext/tk/sample/demos-en/cscroll.rb (revision 23917) +++ ext/tk/sample/demos-en/cscroll.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($cscroll_demo) && $cscroll_demo - $cscroll_demo.destroy + $cscroll_demo.destroy $cscroll_demo = nil end @@ -22,7 +22,7 @@ base_frame = TkFrame.new($cscroll_demo).pack(:fill=>:both, :expand=>true) # label -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', 'text'=>"This window displays a canvas widget that can be scrolled either using the scrollbars or by dragging with button 2 in the canvas. If you click button 1 on one of the rectangles, its indices will be printed on stdout."){ pack('side'=>'top') } @@ -45,7 +45,7 @@ } $cscroll_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame +# frame unless $tk_version =~ /^4\.[01]/ $cscroll_grid = TkFrame.new(base_frame) { pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) @@ -55,14 +55,14 @@ end # canvas -$cscroll_canvas = TkCanvas.new(base_frame, +$cscroll_canvas = TkCanvas.new(base_frame, 'relief'=>'sunken', 'borderwidth'=>2, 'scrollregion'=>['-11c', '-11c', '50c', '20c'] ) {|c| if $tk_version =~ /^4\.[01]/ - pack('expand'=>'yes', 'fill'=>'both') + pack('expand'=>'yes', 'fill'=>'both') else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, + grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') end @@ -71,18 +71,18 @@ if $tk_version =~ /^4\.[01]/ pack('side'=>'right', 'fill'=>'y') else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, + grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') end } - TkScrollbar.new(base_frame, 'orient'=>'horiz', + TkScrollbar.new(base_frame, 'orient'=>'horiz', 'command'=>proc{|*args| c.xview(*args)}) {|hs| c.xscrollcommand(proc{|first,last| hs.set first,last}) if $tk_version =~ /^4\.[01]/ - pack('side'=>'bottom', 'fill'=>'x') + pack('side'=>'bottom', 'fill'=>'x') else - grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, + grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') end } @@ -93,9 +93,9 @@ x = -10+3*i y = -10 (0..9).each{|j| - TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c", + TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c", 'outline'=>'black', 'fill'=>bg, 'tags'=>'rect') - TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c", + TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c", 'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text') y += 3 } @@ -106,7 +106,7 @@ $cscroll_canvas.itembind('all', '1', proc{scrollButton $cscroll_canvas}) $cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas}) $cscroll_canvas.bind('2', proc{|x,y| $cscroll_canvas.scan_mark(x,y)}, '%x %y') -$cscroll_canvas.bind('B2-Motion', +$cscroll_canvas.bind('B2-Motion', proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y') def scrollEnter(c) Index: ext/tk/sample/demos-en/search.rb =================================================================== --- ext/tk/sample/demos-en/search.rb (revision 23917) +++ ext/tk/sample/demos-en/search.rb (working copy) @@ -62,13 +62,13 @@ def textToggle(cmd1,sleep1,cmd2,sleep2) sleep_list = [sleep2, sleep1] - TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep}, + TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep}, -1, cmd1, cmd2).start(sleep1) end # toplevel widget if defined?($search_demo) && $search_demo - $search_demo.destroy + $search_demo.destroy $search_demo = nil end @@ -101,35 +101,35 @@ # frame TkFrame.new(base_frame) {|f| - TkLabel.new(f, 'text'=>'File name:', + TkLabel.new(f, 'text'=>'File name:', 'width'=>13, 'anchor'=>'w').pack('side'=>'left') $search_fileName = TkVariable.new - TkEntry.new(f, 'width'=>40, + TkEntry.new(f, 'width'=>40, 'textvariable'=>$search_fileName) { pack('side'=>'left') bind('Return', proc{textLoadFile($search_text, $search_fileName.value) $search_string_entry.focus}) focus } - TkButton.new(f, 'text'=>'Load File', - 'command'=>proc{textLoadFile($search_text, + TkButton.new(f, 'text'=>'Load File', + 'command'=>proc{textLoadFile($search_text, $search_fileName.value)})\ .pack('side'=>'left', 'pady'=>5, 'padx'=>10) }.pack('side'=>'top', 'fill'=>'x') TkFrame.new(base_frame) {|f| - TkLabel.new(f, 'text'=>'Search string:', + TkLabel.new(f, 'text'=>'Search string:', 'width'=>13, 'anchor'=>'w').pack('side'=>'left') $search_searchString = TkVariable.new - $search_string_entry = TkEntry.new(f, 'width'=>40, + $search_string_entry = TkEntry.new(f, 'width'=>40, 'textvariable'=>$search_searchString) { pack('side'=>'left') - bind('Return', proc{textSearch($search_text, $search_searchString.value, + bind('Return', proc{textSearch($search_text, $search_searchString.value, $search_Tag)}) } - TkButton.new(f, 'text'=>'Highlight', - 'command'=>proc{textSearch($search_text, - $search_searchString.value, + TkButton.new(f, 'text'=>'Highlight', + 'command'=>proc{textSearch($search_text, + $search_searchString.value, $search_Tag)}) { pack('side'=>'left', 'pady'=>5, 'padx'=>10) } @@ -148,20 +148,20 @@ if TkWinfo.depth($search_demo) > 1 textToggle(proc{ - $search_Tag.configure('background'=>'#ce5555', + $search_Tag.configure('background'=>'#ce5555', 'foreground'=>'white') }, - 800, + 800, proc{ $search_Tag.configure('background'=>'', 'foreground'=>'') }, 200 ) else textToggle(proc{ - $search_Tag.configure('background'=>'black', + $search_Tag.configure('background'=>'black', 'foreground'=>'white') }, - 800, + 800, proc{ $search_Tag.configure('background'=>'', 'foreground'=>'') }, Index: ext/tk/sample/demos-en/image3.rb =================================================================== --- ext/tk/sample/demos-en/image3.rb (revision 23917) +++ ext/tk/sample/demos-en/image3.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($image3_demo) && $image3_demo - $image3_demo.destroy + $image3_demo.destroy $image3_demo = nil end @@ -21,7 +21,7 @@ base_frame = TkFrame.new($image3_demo).pack(:fill=>:both, :expand=>true) -# +# def loadDir3(w) w.delete(0,'end') Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f| @@ -37,10 +37,10 @@ # Arguments: # w - Name of the toplevel window of the demo. def selectAndLoadDir3(w, lbox) - dir = Tk.chooseDirectory(:initialdir=>$dirName.value, + dir = Tk.chooseDirectory(:initialdir=>$dirName.value, :parent=>w, :mustexist=>true) if dir.length > 0 - $dirName.value = dir + $dirName.value = dir loadDir3(lbox) end end @@ -92,11 +92,11 @@ image3_df = TkLabelFrame.new(base_frame, :text=>'Directory:') -image3_ff = TkLabelFrame.new(base_frame, :text=>'File:', +image3_ff = TkLabelFrame.new(base_frame, :text=>'File:', :padx=>'2m', :pady=>'2m') image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) { pack(:side=>:left, :fill=>:y, :expand=>true) - yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y, + yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y, :expand=>true)) insert(0, *(%w(earth.gif earthris.gif teapot.ppm))) bind('Double-1', proc{|x,y| loadImage(self, x, y)}, '%x %y') @@ -107,7 +107,7 @@ bind('Return', proc{loadDir3(image3_lbx)}) } -TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"Select Dir.", +TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"Select Dir.", :command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) { pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m') } @@ -119,7 +119,7 @@ Tk.grid(image3_df, '-', :sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f) -Tk.grid(image3_ff, image3_if, +Tk.grid(image3_ff, image3_if, :sticky=>:nw, :padx=>'1m', :pady=>'1m', :in=>image3_f) TkGrid.columnconfigure(image3_f, 1, :weight=>1) Index: ext/tk/sample/demos-en/sayings.rb =================================================================== --- ext/tk/sample/demos-en/sayings.rb (revision 23917) +++ ext/tk/sample/demos-en/sayings.rb (working copy) @@ -9,7 +9,7 @@ # toplevel widget if defined?($sayings_demo) && $sayings_demo - $sayings_demo.destroy + $sayings_demo.destroy $sayings_demo = nil end @@ -70,11 +70,11 @@ sayings_lbox.pack('expand'=>'yes', 'fill'=>'y') else - sayings_lbox.grid('row'=>0, 'column'=>0, + sayings_lbox.grid('row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - sv.grid('row'=>0, 'column'=>1, + sv.grid('row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - sh.grid('row'=>1, 'column'=>0, + sh.grid('row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(w, 0, 'weight'=>1, 'minsize'=>0) TkGrid.columnconfigure(w, 0, 'weight'=>1, 'minsize'=>0) Index: ext/tk/sample/demos-en/check.rb =================================================================== --- ext/tk/sample/demos-en/check.rb (revision 23917) +++ ext/tk/sample/demos-en/check.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($check_demo) && $check_demo - $check_demo.destroy + $check_demo.destroy $check_demo = nil end @@ -21,7 +21,7 @@ base_frame = TkFrame.new($check_demo).pack(:fill=>:both, :expand=>true) -# label +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' @@ -30,12 +30,12 @@ } msg.pack('side'=>'top') -# +# wipers = TkVariable.new(0) brakes = TkVariable.new(0) sober = TkVariable.new(0) -# frame +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { text 'Dismiss' @@ -56,7 +56,7 @@ TkButton.new(frame) { text 'See Variables' command proc{ - showVars(base_frame, + showVars(base_frame, ['wipers', wipers], ['brakes', brakes], ['sober', sober]) } }.pack('side'=>'left', 'expand'=>'yes') Index: ext/tk/sample/demos-en/radio3.rb =================================================================== --- ext/tk/sample/demos-en/radio3.rb (revision 23917) +++ ext/tk/sample/demos-en/radio3.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($radio3_demo) && $radio3_demo - $radio3_demo.destroy + $radio3_demo.destroy $radio3_demo = nil end @@ -21,7 +21,7 @@ base_frame = TkFrame.new($radio3_demo).pack(:fill=>:both, :expand=>true) -# label +# label msg = TkLabel.new(base_frame) { font $font wraplength '5i' @@ -35,50 +35,50 @@ color = TkVariable.new align = TkVariable.new -# frame +# frame TkFrame.new(base_frame) {|frame| - TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), + TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - TkButton.new(frame, :text=>'See Variables', - :image=>$image['view'], :compound=>:left, + TkGrid('x', + TkButton.new(frame, :text=>'See Variables', + :image=>$image['view'], :compound=>:left, :command=>proc{ - showVars(base_frame, ['size', size], + showVars(base_frame, ['size', size], ['color', color], ['compound', align]) - }), - TkButton.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'radio3'}), - TkButton.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + }), + TkButton.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'radio3'}), + TkButton.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $radio3_demo $radio3_demo = nil $showVarsWin[tmppath.path] = nil tmppath.destroy - }), + }), :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) TkGrid(frame, :row=>3, :column=>0, :columnspan=>3, :sticky=>'nsew') } -# frame -f_left = TkLabelFrame.new(base_frame, 'text'=>'Point Size', +# frame +f_left = TkLabelFrame.new(base_frame, 'text'=>'Point Size', 'pady'=>2, 'padx'=>2) -f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color', +f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color', 'pady'=>2, 'padx'=>2) -f_right = TkLabelFrame.new(base_frame, 'text'=>'Alignment', +f_right = TkLabelFrame.new(base_frame, 'text'=>'Alignment', 'pady'=>2, 'padx'=>2) f_left .grid('column'=>0, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2) f_mid .grid('column'=>1, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2) f_right.grid('column'=>2, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c') -TkButton.new(base_frame, 'text'=>'Tristate', +TkButton.new(base_frame, 'text'=>'Tristate', 'command'=>proc{size.value = 'multi'; color.value = 'multi'}){ grid('column'=>2, 'row'=>2, 'pady'=>'.5c', 'padx'=>'.5c') } -# radiobutton +# radiobutton [10, 12, 14, 18, 24].each {|sz| TkRadioButton.new(f_left) { text "Point Size #{sz}" @@ -101,14 +101,14 @@ }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x') } -# label = TkLabel.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead', -label = Tk::Label.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead', +# label = TkLabel.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead', +label = Tk::Label.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead', 'compound'=>'left') label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') label.height(TkWinfo.reqheight(label)) a_btn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a| - TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', - 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7, + TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', + 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7, 'command'=>proc{label.compound(align.value)}) } Index: ext/tk/sample/demos-en/text.rb =================================================================== --- ext/tk/sample/demos-en/text.rb (revision 23917) +++ ext/tk/sample/demos-en/text.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($text_demo) && $text_demo - $text_demo.destroy + $text_demo.destroy $text_demo = nil end @@ -45,7 +45,7 @@ }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# text +# text TkText.new(base_frame){|t| relief 'sunken' bd 2 @@ -62,7 +62,7 @@ } pack('expand'=>'yes', 'fill'=>'both') - # + # insert('0.0', <:both, :expand=>true) # label -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', 'text'=>"This window displays a string of text to demonstrate the text facilities of canvas widgets. You can click in the boxes to adjust the position of the text relative to its positioning point or change its justification. The text also supports the following simple bindings for editing: 1. You can point, click, and type. 2. You can also select with button 1. @@ -52,20 +52,20 @@ } $ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# canvas -$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat', +# canvas +$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat', 'borderwidth'=>0, 'width'=>500, 'height'=>350) $ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both') -# font +# font if $tk_version =~ /^4.*/ textFont = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*' else textFont = 'Helvetica 24' end -# canvas -TkcRectangle.new($ctext_canvas, 245, 195, 255, 205, +# canvas +TkcRectangle.new($ctext_canvas, 245, 195, 255, 205, 'outline'=>'black', 'fill'=>'red') ctag_text_param = { @@ -83,24 +83,24 @@ $ctag_text.bind('1', proc{|x,y| textB1Press $ctext_canvas,x,y}, "%x %y") $ctag_text.bind('B1-Motion', proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") -$ctag_text.bind('Shift-1', - proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"}, +$ctag_text.bind('Shift-1', + proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"}, "%x %y") -$ctag_text.bind('Shift-B1-Motion', +$ctag_text.bind('Shift-B1-Motion', proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y") $ctag_text.bind('KeyPress', proc{|a| textInsert $ctext_canvas,a}, "%A") $ctag_text.bind('Return', proc{textInsert $ctext_canvas,"\n"}) $ctag_text.bind('Control-h', proc{textBs $ctext_canvas}) $ctag_text.bind('BackSpace', proc{textBs $ctext_canvas}) $ctag_text.bind('Delete', proc{textDel $ctext_canvas}) -$ctag_text.bind('2', proc{|x,y| textPaste $ctext_canvas, "@#{x},#{y}"}, +$ctag_text.bind('2', proc{|x,y| textPaste $ctext_canvas, "@#{x},#{y}"}, "%x %y") -# Next, create some items that allow the text's anchor position +# Next, create some items that allow the text's anchor position # to be edited. def mkTextConfig(w,x,y,option,value,color) - item = TkcRectangle.new(w, x, y, x+30, y+30, + item = TkcRectangle.new(w, x, y, x+30, y+30, 'outline'=>'black', 'fill'=>color, 'width'=>1) item.bind('1', proc{$ctag_text.configure option, value}) w.addtag_withtag('config', item) @@ -118,15 +118,15 @@ mkTextConfig $ctext_canvas, x, y+60, 'anchor', 'ne', color mkTextConfig $ctext_canvas, x+30, y+60, 'anchor', 'n', color mkTextConfig $ctext_canvas, x+60, y+60, 'anchor', 'nw', color -item = TkcRectangle.new($ctext_canvas, x+40, y+40, x+50, y+50, +item = TkcRectangle.new($ctext_canvas, x+40, y+40, x+50, y+50, 'outline'=>'black', 'fill'=>'red') item.bind('1', proc{$ctag_text.configure 'anchor', 'center'}) if $tk_version =~ /^4.*/ - TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', + TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', + 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', 'anchor'=>'s', 'fill'=>'brown') else - TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', + TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position', 'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown') end @@ -140,18 +140,18 @@ mkTextConfig $ctext_canvas, x+30, y, 'justify', 'center', color mkTextConfig $ctext_canvas, x+60, y, 'justify', 'right', color if $tk_version =~ /^4.*/ - TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', - 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', + TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', + 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*', 'anchor'=>'s', 'fill'=>'brown') else - TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', + TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification', 'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown') end $ctext_canvas.itembind('config', 'Enter', proc{textEnter $ctext_canvas}) -$ctext_canvas.itembind('config', 'Leave', +$ctext_canvas.itembind('config', 'Leave', proc{$ctext_canvas\ - .itemconfigure('current', + .itemconfigure('current', 'fill'=>$textConfigFill)}) $textConfigFill = '' Index: ext/tk/sample/demos-en/ttkmenu.rb =================================================================== --- ext/tk/sample/demos-en/ttkmenu.rb (revision 23917) +++ ext/tk/sample/demos-en/ttkmenu.rb (working copy) @@ -6,7 +6,7 @@ # based on "Id: ttkmenu.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($ttkmenu_demo) && $ttkmenu_demo - $ttkmenu_demo.destroy + $ttkmenu_demo.destroy $ttkmenu_demo = nil end @@ -18,7 +18,7 @@ base_frame = Ttk::Frame.new($ttkmenu_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) Ttk is the new Tk themed widget set, \ and one widget that is available in themed form is the menubutton. \ @@ -39,16 +39,16 @@ Ttk::Frame.new($ttkmenu_demo) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttkmenu'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttkmenu'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttkmenu_demo.destroy $ttkmenu_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) Index: ext/tk/sample/demos-en/ttknote.rb =================================================================== --- ext/tk/sample/demos-en/ttknote.rb (revision 23917) +++ ext/tk/sample/demos-en/ttknote.rb (working copy) @@ -6,7 +6,7 @@ # based on "Id: ttknote.tcl,v 1.5 2007/12/13 15:27:07 dgp Exp" if defined?($ttknote_demo) && $ttknote_demo - $ttknote_demo.destroy + $ttknote_demo.destroy $ttknote_demo = nil end @@ -20,16 +20,16 @@ Ttk::Frame.new($ttknote_demo) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttknote'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttknote'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttknote_demo.destroy $ttknote_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -38,13 +38,13 @@ base_frame = Ttk::Frame.new($ttknote_demo).pack(:fill=>:both, :expand=>true) ## Make the notebook and set up Ctrl+Tab traversal -notebook = Ttk::Notebook.new(base_frame).pack(:fill=>:both, :expand=>true, +notebook = Ttk::Notebook.new(base_frame).pack(:fill=>:both, :expand=>true, :padx=>2, :pady=>3) notebook.enable_traversal ## Popuplate the first pane f_msg = Ttk::Frame.new(notebook) -msg_m = Ttk::Label.new(f_msg, :font=>$font, :wraplength=>'4i', +msg_m = Ttk::Label.new(f_msg, :font=>$font, :wraplength=>'4i', :justify=>:left, :anchor=>'n', :text=><'Neat!', :underline=>0, +msg_b = Ttk::Button.new(f_msg, :text=>'Neat!', :underline=>0, :command=>proc{ neat.value = 'Yeah, I know...' Tk.after_cancel(after_id) if after_id Index: ext/tk/sample/demos-en/ruler.rb =================================================================== --- ext/tk/sample/demos-en/ruler.rb (revision 23917) +++ ext/tk/sample/demos-en/ruler.rb (working copy) @@ -21,7 +21,7 @@ # toplevel widget if defined?($ruler_demo) && $ruler_demo - $ruler_demo.destroy + $ruler_demo.destroy $ruler_demo = nil end @@ -35,7 +35,7 @@ base_frame = TkFrame.new($ruler_demo).pack(:fill=>:both, :expand=>true) # label -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', 'text'=>"This canvas widget shows a mock-up of a ruler. You can create tab stops by dragging them out of the well to the right of the ruler. You can also drag existing tab stops. If you drag a tab stop far enough up or down so that it turns dim, it will be deleted when you release the mouse button."){ pack('side'=>'top') } @@ -58,14 +58,14 @@ } $ruler_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# canvas +# canvas $ruler_canvas = TkCanvas.new(base_frame, 'width'=>'14.8c', 'height'=>'2.5c') $ruler_canvas.pack('side'=>'top', 'fill'=>'x') -# +# unless Struct.const_defined?("RulerInfo") - $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y, - :top, :bottom, :size, :normalStyle, + $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y, + :top, :bottom, :size, :normalStyle, :activeStyle, :deleteStyle).new end $demo_rulerInfo.grid = '.25c' @@ -77,17 +77,17 @@ $demo_rulerInfo.normalStyle = {'fill'=>'black'} if TkWinfo.depth($ruler_canvas) > 1 $demo_rulerInfo.activeStyle = {'fill'=>'red', 'stipple'=>''} - $demo_rulerInfo.deleteStyle = {'fill'=>'red', - 'stipple'=>'@'+[$demo_dir, '..', + $demo_rulerInfo.deleteStyle = {'fill'=>'red', + 'stipple'=>'@'+[$demo_dir, '..', 'images', 'gray25.xbm'].join(File::Separator)} else $demo_rulerInfo.activeStyle = {'fill'=>'black', 'stipple'=>''} - $demo_rulerInfo.deleteStyle = {'fill'=>'black', - 'stipple'=>'@'+[$demo_dir, '..', + $demo_rulerInfo.deleteStyle = {'fill'=>'black', + 'stipple'=>'@'+[$demo_dir, '..', 'images', 'gray25.xbm'].join(File::Separator)} end -TkcLine.new($ruler_canvas, +TkcLine.new($ruler_canvas, '1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1) (0..11).each{|i| x = i+1 @@ -101,21 +101,21 @@ $rulerTag_well = TkcTag.new($ruler_canvas) $ruler_canvas\ .addtag_withtag($rulerTag_well, - TkcRectangle.new($ruler_canvas, - '13.2c', '1c', '13.8c', '0.5c', - 'outline'=>'black', + TkcRectangle.new($ruler_canvas, + '13.2c', '1c', '13.8c', '0.5c', + 'outline'=>'black', 'fill'=>($ruler_canvas\ .configinfo('background'))[4]) ) $ruler_canvas\ .addtag_withtag($rulerTag_well, - rulerMkTab($ruler_canvas, - TkWinfo.pixels($ruler_canvas, '13.5c'), + rulerMkTab($ruler_canvas, + TkWinfo.pixels($ruler_canvas, '13.5c'), TkWinfo.pixels($ruler_canvas, '.65c') ) ) $rulerTag_well.bind('1', proc{|x,y| rulerNewTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.itembind('tab', '1', +$ruler_canvas.itembind('tab', '1', proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y') -$ruler_canvas.bind('B1-Motion', +$ruler_canvas.bind('B1-Motion', proc{|x,y| rulerMoveTab($ruler_canvas,x,y)}, '%x %y') $ruler_canvas.bind('Any-ButtonRelease-1', proc{rulerReleaseTab($ruler_canvas)}) Index: ext/tk/sample/demos-en/arrow.rb =================================================================== --- ext/tk/sample/demos-en/arrow.rb (revision 23917) +++ ext/tk/sample/demos-en/arrow.rb (working copy) @@ -28,65 +28,65 @@ # Create the arrow and outline. c.delete('all') - TkcLine.new(c, v.x1, v.y, v.x2, v.y, - { 'width'=>10 * v.width, - 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c], - 'arrow'=>'last' + TkcLine.new(c, v.x1, v.y, v.x2, v.y, + { 'width'=>10 * v.width, + 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c], + 'arrow'=>'last' }.update(v.bigLineStyle) ) xtip = v.x2 - 10*v.b deltaY = 10*v.c + 5*v.width - TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY, - v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y, + TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY, + v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y, 'width'=>2, 'capstyle'=>'round', 'joinstyle'=>'round') # Create the boxes for reshaping the line and arrowhead. - TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5, + TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5, {'tags'=>['box1', $arrowTag_box]}.update(v.boxStyle) ) - TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5, + TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5, {'tags'=>['box2', $arrowTag_box]}.update(v.boxStyle) ) - TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5, + TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5, {'tags'=>['box3', $arrowTag_box]}.update(v.boxStyle) ) c.itemconfigure cur, v.activeStyle if cur # Create three arrows in actual size with the same parameters TkcLine.new(c, v.x2+50, 0, v.x2+50, 1000, 'width'=>2) tmp = v.x2+100 - TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width, + TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width, 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width, + TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width, 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width, + TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width, 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c]) - # Create a bunch of other arrows and text items showing the + # Create a bunch of other arrows and text items showing the # current dimensions. tmp = v.x2+10 - TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY, + TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY, 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x2+15, v.y-deltaY+5*v.c, 'text'=>v.c, 'anchor'=>'w') tmp = v.x1-10 - TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width, + TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width, 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x1-15, v.y, 'text'=>v.width, 'anchor'=>'e') tmp = v.y+5*v.width+10*v.c+10 - TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp, + TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp, 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x2-5*v.a, tmp+5, 'text'=>v.a, 'anchor'=>'n') tmp = tmp+25 - TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp, + TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp, 'arrow'=>'both', 'arrowshape'=>v.smallTips) TkcText.new(c, v.x2-5*v.b, tmp+5, 'text'=>v.b, 'anchor'=>'n') if $tk_version =~ /^4.*/ - TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', + TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') - TkcText.new(c, v.x1, 330, + TkcText.new(c, v.x1, 330, 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]",'anchor'=>'w', 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*') else - TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', + TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w', 'font'=>'Helvetica 18') - TkcText.new(c, v.x1, 330, + TkcText.new(c, v.x1, 330, 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]", 'anchor'=>'w', 'font'=>'Helvetica 18') end @@ -96,7 +96,7 @@ # toplevel widget if defined?($arrow_demo) && $arrow_demo - $arrow_demo.destroy + $arrow_demo.destroy $arrow_demo = nil end @@ -110,7 +110,7 @@ base_frame = TkFrame.new($arrow_demo).pack(:fill=>:both, :expand=>true) # label -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', 'text'=>"This widget allows you to experiment with different widths and arrowhead shapes for lines in canvases. To change the line width or the shape of the arrowhead, drag any of the three boxes attached to the oversized arrow. The arrows on the right give examples at normal scale. The text at the bottom shows the configuration options as you'd enter them for a canvas line item."){ pack('side'=>'top') } @@ -133,15 +133,15 @@ } $arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# canvas -$arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350, +# canvas +$arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350, 'relief'=>'sunken', 'borderwidth'=>2) $arrow_canvas.pack('expand'=>'yes', 'fill'=>'both') -# +# unless Struct.const_defined?("ArrowInfo") - $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc, - :x1, :x2, :y, :smallTips, :count, + $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc, + :x1, :x2, :y, :smallTips, :count, :bigLineStyle, :boxStyle, :activeStyle).new end $demo_arrowInfo.a = 8 @@ -159,7 +159,7 @@ $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1} $demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1} else - $demo_arrowInfo.bigLineStyle = {'fill'=>'black', + $demo_arrowInfo.bigLineStyle = {'fill'=>'black', 'stipple'=>'@'+[$demo_dir,'..','images','grey.25'].join(File::Separator)} $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1} $demo_arrowInfo.activeStyle = {'fill'=>'black','outline'=>'black','width'=>1} @@ -170,16 +170,16 @@ $arrowTag_box.bind('Leave', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.boxStyle)}) $arrowTag_box.bind('B1-Enter', proc{}) $arrowTag_box.bind('B1-Leave', proc{}) -$arrow_canvas.itembind('box1', '1', +$arrow_canvas.itembind('box1', '1', proc{$demo_arrowInfo.motionProc \ = proc{|x,y| arrowMove1 $arrow_canvas, x, y}}) -$arrow_canvas.itembind('box2', '1', +$arrow_canvas.itembind('box2', '1', proc{$demo_arrowInfo.motionProc \ = proc{|x,y| arrowMove2 $arrow_canvas, x, y}}) -$arrow_canvas.itembind('box3', '1', +$arrow_canvas.itembind('box3', '1', proc{$demo_arrowInfo.motionProc \ = proc{|x,y| arrowMove3 $arrow_canvas, x, y}}) -$arrowTag_box.bind('B1-Motion', +$arrowTag_box.bind('B1-Motion', proc{|x,y| $demo_arrowInfo.motionProc.call(x,y)}, "%x %y") $arrow_canvas.bind('Any-ButtonRelease-1', proc{arrowSetup $arrow_canvas}) Index: ext/tk/sample/demos-en/menubu.rb =================================================================== --- ext/tk/sample/demos-en/menubu.rb (revision 23917) +++ ext/tk/sample/demos-en/menubu.rb (working copy) @@ -21,7 +21,7 @@ for i in rest menu.add 'radio', 'label'=>i, 'variable'=>varName end - + return menu end @@ -188,7 +188,7 @@ TkFrame.new(center) {|f| menubuttonoptions = TkVariable.new mbutton = TkMenubutton.new(f) - options = optionMenu(mbutton, menubuttonoptions, + options = optionMenu(mbutton, menubuttonoptions, 'one', 'two', 'three') mbutton.pack('side'=>'left', 'padx'=>25, 'pady'=>25) paletteColor = TkVariable.new Index: ext/tk/sample/demos-en/textpeer.rb =================================================================== --- ext/tk/sample/demos-en/textpeer.rb (revision 23917) +++ ext/tk/sample/demos-en/textpeer.rb (working copy) @@ -4,7 +4,7 @@ # based on Tcl/Tk8.5.0 widget demos if defined?($textpeer_demo) && $textpeer_demo - $textpeer_demo.destroy + $textpeer_demo.destroy $textpeer_demo = nil end @@ -39,9 +39,9 @@ peer = TkText::Peer.new(txt, win, :widgetname=>"text#{cnt}") sbar = TkScrollbar.new(win, :widgetname=>"sb#{cnt}") peer.yscrollbar sbar - b1 = TkButton.new(win, :widgetname=>"clone#{cnt}", :text=>'Make Peer', + b1 = TkButton.new(win, :widgetname=>"clone#{cnt}", :text=>'Make Peer', :command=>proc{makeClone(count, win, peer)}) - b2 = TkButton.new(win, :widgetname=>"kill#{cnt}", :text=>'Delete Peer', + b2 = TkButton.new(win, :widgetname=>"kill#{cnt}", :text=>'Delete Peer', :command=>proc{killClone(win, cnt)}) row = cnt * 2 TkGrid.configure(peer, sbar, b1, :sticky=>'nsew', :row=>row) @@ -51,7 +51,7 @@ end def killClone(win, cnt) - Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}", + Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}", "#{win.path}.clone#{cnt}", "#{win.path}.kill#{cnt}") end Index: ext/tk/sample/demos-en/states.rb =================================================================== --- ext/tk/sample/demos-en/states.rb (revision 23917) +++ ext/tk/sample/demos-en/states.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($states_demo) && $states_demo - $states_demo.destroy + $states_demo.destroy $states_demo = nil end @@ -63,16 +63,16 @@ }.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y') ins_data = [ - 'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', - 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', - 'Hawaii', 'Idaho', 'Illinois', - 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', - 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', - 'Montana', 'Nebraska', 'Nevada', 'New_Hampshire', 'New_Jersey', 'New_Mexico', - 'New_York', 'North_Carolina', 'North_Dakota', - 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode_Island', - 'South_Carolina', 'South_Dakota', - 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', + 'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', + 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', + 'Hawaii', 'Idaho', 'Illinois', + 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', + 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', + 'Montana', 'Nebraska', 'Nevada', 'New_Hampshire', 'New_Jersey', 'New_Mexico', + 'New_York', 'North_Carolina', 'North_Dakota', + 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode_Island', + 'South_Carolina', 'South_Dakota', + 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West_Virginia', 'Wisconsin', 'Wyoming' ] Index: ext/tk/sample/demos-en/form.rb =================================================================== --- ext/tk/sample/demos-en/form.rb (revision 23917) +++ ext/tk/sample/demos-en/form.rb (working copy) @@ -4,7 +4,7 @@ # toplevel widget if defined?($form_demo) && $form_demo - $form_demo.destroy + $form_demo.destroy $form_demo = nil end @@ -43,7 +43,7 @@ }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# entry +# entry form_data = [] (1..5).each{|i| f = TkFrame.new(base_frame, 'bd'=>2) @@ -54,7 +54,7 @@ form_data[i] = {'frame'=>f, 'entry'=>e, 'label'=>l} } -# +# form_data[1]['label'].text('Name:') form_data[2]['label'].text('Address:') form_data[5]['label'].text('Phone:') Index: ext/tk/sample/demos-en/menu.rb =================================================================== --- ext/tk/sample/demos-en/menu.rb (revision 23917) +++ ext/tk/sample/demos-en/menu.rb (working copy) @@ -4,7 +4,7 @@ # toplevel widget if defined?($menu_demo) && $menu_demo - $menu_demo.destroy + $menu_demo.destroy $menu_demo = nil end @@ -54,7 +54,7 @@ }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# menu +# menu TkMenubutton.new($menu_frame, 'text'=>'File', 'underline'=>0) {|m| pack('side'=>'left') TkMenu.new(m, 'tearoff'=>false) {|file_menu| @@ -86,8 +86,8 @@ m.configure('menu'=>basic_menu) add('command', 'label'=>'Long entry that does nothing') ['A','B','C','D','E','F','G'].each{|c| - add('command', 'label'=>"Print letter \"#{c}\"", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", + add('command', 'label'=>"Print letter \"#{c}\"", + 'underline'=>14, 'accelerator'=>"Meta+#{c}", 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } @@ -98,17 +98,17 @@ pack('side'=>'left') TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| m.configure('menu'=>cascade_menu) - add('command', 'label'=>'Print hello', - 'command'=>proc{print "Hello\n"}, + add('command', 'label'=>'Print hello', + 'command'=>proc{print "Hello\n"}, 'accelerator'=>"#{modifier}+H", 'underline'=>6) $menu_demo.bind("#{modifier}-h", proc{print "Hello\n"}) - add('command', 'label'=>'Print goodbye', - 'command'=>proc{print "Goodbye\n"}, + add('command', 'label'=>'Print goodbye', + 'command'=>proc{print "Goodbye\n"}, 'accelerator'=>"#{modifier}+G", 'underline'=>6) $menu_demo.bind("#{modifier}-g", proc{print "Goodbye\n"}) TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_check| - cascade_menu.add('cascade', 'label'=>'Check buttons', + cascade_menu.add('cascade', 'label'=>'Check buttons', 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'Oil checked', 'variable'=>oil) @@ -119,18 +119,18 @@ lights = TkVariable.new(0) add('check', 'label'=>'Lights checked', 'variable'=>lights) add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu_demo, - ['oil', oil], - ['trans', trans], - ['brakes', brakes], + add('command', 'label'=>'Show current values', + 'command'=>proc{showVars($menu_demo, + ['oil', oil], + ['trans', trans], + ['brakes', brakes], ['lights', lights])} ) invoke 1 invoke 3 } TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_radio| - cascade_menu.add('cascade', 'label'=>'Radio buttons', + cascade_menu.add('cascade', 'label'=>'Radio buttons', 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10) @@ -144,9 +144,9 @@ add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold') add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu_demo, - ['pointSize', pointSize], + add('command', 'label'=>'Show current values', + 'command'=>proc{showVars($menu_demo, + ['pointSize', pointSize], ['style', style])} ) invoke 1 invoke 7 @@ -158,15 +158,15 @@ pack('side'=>'left') TkMenu.new(m, 'tearoff'=>false) {|icon_menu| m.configure('menu'=>icon_menu) - add('command', + add('command', 'bitmap'=>'@'+[$demo_dir,'..', 'images','pattern.xbm'].join(File::Separator), - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', + 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', 'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.', - 'bitmap'=>'', 'default'=>0, + 'bitmap'=>'', 'default'=>0, 'buttons'=>'Dismiss')} ) ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, + add('command', 'bitmap'=>icon, 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) } } @@ -178,7 +178,7 @@ m.configure('menu'=>more_menu) [ 'An entry','Another entry','Does nothing','Does almost nothing', 'Make life meaningful' ].each{|i| - add('command', 'label'=>i, + add('command', 'label'=>i, 'command'=>proc{print "You invoked \"#{i}\"\n"}) } } @@ -189,7 +189,7 @@ TkMenu.new(m) {|colors_menu| m.configure('menu'=>colors_menu) ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, + add('command', 'label'=>c, 'background'=>c, 'command'=>proc{print "You invoked \"#{c}\"\n"}) } } Index: ext/tk/sample/demos-en/image2.rb =================================================================== --- ext/tk/sample/demos-en/image2.rb (revision 23917) +++ ext/tk/sample/demos-en/image2.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($image2_demo) && $image2_demo - $image2_demo.destroy + $image2_demo.destroy $image2_demo = nil end @@ -87,13 +87,13 @@ }.pack('side'=>'top', 'anchor'=>'w') -# image +# image [ TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20), TkLabel.new(base_frame, 'text'=>'Image:'), TkLabel.new(base_frame, 'image'=>$image2a) ].each{|w| w.pack('side'=>'top', 'anchor'=>'w')} -# +# def loadDir(w) w.delete(0,'end') Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f| Index: ext/tk/sample/demos-en/paned2.rb =================================================================== --- ext/tk/sample/demos-en/paned2.rb (revision 23917) +++ ext/tk/sample/demos-en/paned2.rb (working copy) @@ -6,7 +6,7 @@ # based on "Id: paned2.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp" if defined?($paned2_demo) && $paned2_demo - $paned2_demo.destroy + $paned2_demo.destroy $paned2_demo = nil end @@ -18,8 +18,8 @@ base_frame = TkFrame.new($paned2_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'4i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top) The sash between the two scrolled windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.) If your Tk library linked to Ruby doesn't include a 'panedwindow', this demo doesn't work. Please use later version of Tk which supports a 'panedwindow'. @@ -42,23 +42,23 @@ paneList = TkVariable.new # define as normal variable (not array) paneList.value = [ # ruby's array --> tcl's list 'List of Ruby/Tk Widgets', - 'TkButton', - 'TkCanvas', - 'TkCheckbutton', - 'TkEntry', - 'TkFrame', - 'TkLabel', - 'TkLabelframe', - 'TkListbox', - 'TkMenu', - 'TkMenubutton', - 'TkMessage', - 'TkPanedwindow', - 'TkRadiobutton', - 'TkScale', - 'TkScrollbar', - 'TkSpinbox', - 'TkText', + 'TkButton', + 'TkCanvas', + 'TkCheckbutton', + 'TkEntry', + 'TkFrame', + 'TkLabel', + 'TkLabelframe', + 'TkListbox', + 'TkMenu', + 'TkMenubutton', + 'TkMessage', + 'TkPanedwindow', + 'TkRadiobutton', + 'TkScale', + 'TkScrollbar', + 'TkSpinbox', + 'TkText', 'TkToplevel' ] @@ -69,13 +69,13 @@ add(TkFrame.new(f){|paned2_top| TkListbox.new(paned2_top, :listvariable=>paneList) { # Invert the first item to highlight it - itemconfigure(0, :background=>self.cget(:foreground), + itemconfigure(0, :background=>self.cget(:foreground), :foreground=>self.cget(:background) ) - yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, + yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, :fill=>:y)) pack(:fill=>:both, :expand=>true) } - }, + }, TkFrame.new(f, :height=>120) {|paned2_bottom| # The bottom window is a text widget with scrollbar Index: ext/tk/sample/demos-en/bitmap.rb =================================================================== --- ext/tk/sample/demos-en/bitmap.rb (revision 23917) +++ ext/tk/sample/demos-en/bitmap.rb (working copy) @@ -17,7 +17,7 @@ def bitmapRow(w,*args) TkFrame.new(w){|row| pack('side'=>'top', 'fill'=>'both') - for bitmap in args + for bitmap in args TkFrame.new(row){|base| pack('side'=>'left', 'fill'=>'both', 'pady'=>'.25c', 'padx'=>'.25c') TkLabel.new(base, 'text'=>bitmap, 'width'=>9).pack('side'=>'bottom') @@ -29,7 +29,7 @@ # toplevel widget if defined?($bitmap_demo) && $bitmap_demo - $bitmap_demo.destroy + $bitmap_demo.destroy $bitmap_demo = nil end @@ -43,7 +43,7 @@ base_frame = TkFrame.new($bitmap_demo).pack(:fill=>:both, :expand=>true) # label -TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left', +TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left', 'text'=>"This window displays all of Tk's built-in bitmaps, along with the names you can use for them in Tcl scripts."){ pack('side'=>'top') } @@ -66,7 +66,7 @@ } $bitmap_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame +# frame TkFrame.new(base_frame){|f| bitmapRow(f,'error','gray25','gray50','hourglass') bitmapRow(f,'info','question','questhead','warning') Index: ext/tk/sample/demos-en/label.rb =================================================================== --- ext/tk/sample/demos-en/label.rb (revision 23917) +++ ext/tk/sample/demos-en/label.rb (working copy) @@ -8,11 +8,11 @@ # toplevel widget if defined?($label_demo) && $label_demo - $label_demo.destroy + $label_demo.destroy $label_demo = nil end -# demo toplevel widget +# demo toplevel widget $label_demo = TkToplevel.new {|w| title("Label Demonstration") iconname("label") @@ -21,7 +21,7 @@ base_frame = TkFrame.new($label_demo).pack(:fill=>:both, :expand=>true) -# label +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' @@ -30,7 +30,7 @@ } msg.pack('side'=>'top') -# frame +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { text 'Dismiss' @@ -48,15 +48,15 @@ }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# label demo +# label demo f_left = TkFrame.new(base_frame) f_right = TkFrame.new(base_frame) -[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes', +[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes', 'padx'=>10, 'pady'=>10, 'fill'=>'both')} -# label +# label [ TkLabel.new(f_left, 'text'=>'First label'), - TkLabel.new(f_left, 'text'=>'Second label, raised', + TkLabel.new(f_left, 'text'=>'Second label, raised', 'relief'=>'raised'), TkLabel.new(f_left, 'text'=>'Third label, sunken', 'relief'=>'sunken') ].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')} Index: ext/tk/sample/demos-en/radio2.rb =================================================================== --- ext/tk/sample/demos-en/radio2.rb (revision 23917) +++ ext/tk/sample/demos-en/radio2.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($radio2_demo) && $radio2_demo - $radio2_demo.destroy + $radio2_demo.destroy $radio2_demo = nil end @@ -21,7 +21,7 @@ base_frame = TkFrame.new($radio2_demo).pack(:fill=>:both, :expand=>true) -# label +# label msg = TkLabel.new(base_frame) { font $font wraplength '5i' @@ -30,12 +30,12 @@ } msg.pack('side'=>'top') -# +# size = TkVariable.new color = TkVariable.new align = TkVariable.new -# frame +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { text 'Dismiss' @@ -55,24 +55,24 @@ TkButton.new(frame) { text 'See Variables' command proc{ - showVars(base_frame, + showVars(base_frame, ['size', size], ['color', color], ['compound', align]) } }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame -f_left = TkLabelFrame.new(base_frame, 'text'=>'Point Size', +# frame +f_left = TkLabelFrame.new(base_frame, 'text'=>'Point Size', 'pady'=>2, 'padx'=>2) -f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color', +f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color', 'pady'=>2, 'padx'=>2) -f_right = TkLabelFrame.new(base_frame, 'text'=>'Alignment', +f_right = TkLabelFrame.new(base_frame, 'text'=>'Alignment', 'pady'=>2, 'padx'=>2) f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -# radiobutton +# radiobutton [10, 12, 18, 24].each {|sz| TkRadioButton.new(f_left) { text "Point Size #{sz}" @@ -92,15 +92,15 @@ }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x') } -# label = TkLabel.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead', -label = Tk::Label.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead', +# label = TkLabel.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead', +label = Tk::Label.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead', 'compound'=>'left') label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') label.height(TkWinfo.reqheight(label)) abtn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a| lower = a.downcase - TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', - 'value'=>lower, 'indicatoron'=>0, 'width'=>7, + TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat', + 'value'=>lower, 'indicatoron'=>0, 'width'=>7, 'command'=>proc{label.compound(align.value)}) } Index: ext/tk/sample/demos-en/knightstour.rb =================================================================== --- ext/tk/sample/demos-en/knightstour.rb (revision 23917) +++ ext/tk/sample/demos-en/knightstour.rb (working copy) @@ -155,16 +155,16 @@ frame = Ttk::Frame.new($knightstour) sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'knightstour'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'knightstour'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $knightstour.destroy $knightstour = nil - }), + }), :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) frame @@ -176,7 +176,7 @@ $knightstour.withdraw base_f = Ttk::Frame.new($knightstour) @board = Tk::Canvas.new(base_f, :width=>240, :height=>240) - @log = Tk::Text.new(base_f, :width=>12, :height=>1, + @log = Tk::Text.new(base_f, :width=>12, :height=>1, :font=>'Arial 8', :background=>'white') scr = @log.yscrollbar(Ttk::Scrollbar.new(base_f)) @@ -186,13 +186,13 @@ tool_f = Ttk::Frame.new($knightstour) label = Ttk::Label.new(tool_f, :text=>'Speed') - scale = Ttk::Scale.new(tool_f, :from=>8, :to=>2000, :variable=>@delay, + scale = Ttk::Scale.new(tool_f, :from=>8, :to=>2000, :variable=>@delay, :command=>proc{|n| set_delay(n)}) - check = Ttk::Checkbutton.new(tool_f, :text=>'Repeat', + check = Ttk::Checkbutton.new(tool_f, :text=>'Repeat', :variable=>@continuous) - @start_btn = Ttk::Button.new(tool_f, :text=>'Start', + @start_btn = Ttk::Button.new(tool_f, :text=>'Start', :command=>proc{tour()}) - @exit_btn = Ttk::Button.new(tool_f, :text=>'Exit', + @exit_btn = Ttk::Button.new(tool_f, :text=>'Exit', :command=>proc{_exit()}) 7.downto(0){|row| @@ -205,16 +205,16 @@ dfill = 'tan4' end coords = [col * 30 + 4, row * 30 + 4, col * 30 + 30, row * 30 + 30] - @board.create(TkcRectangle, coords, + @board.create(TkcRectangle, coords, :fill=>fill, :disabledfill=>dfill, :width=>2, :state=>:disabled) } } @knight_font = TkFont.new(:size=>-24) - @knight = TkcText.new(@board, 0, 0, :font=>@knight_font, - :text=>Tk::UTF8_String.new('\u265e'), - :anchor=>'nw', # :tags=>'knight', + @knight = TkcText.new(@board, 0, 0, :font=>@knight_font, + :text=>Tk::UTF8_String.new('\u265e'), + :anchor=>'nw', # :tags=>'knight', :fill=>'black', :activefill=>'#600000') @knight.coords(@board.coords(rand(64)+1)[0..1]) @knight.bind('ButtonPress-1', '%W %x %y'){|w,x,y| drag_start(w,x,y)} Index: ext/tk/sample/demos-en/floor.rb =================================================================== --- ext/tk/sample/demos-en/floor.rb (revision 23917) +++ ext/tk/sample/demos-en/floor.rb (working copy) @@ -21,7 +21,7 @@ w.delete('all') $activeFloor = active - # First go through the three floors, displaying the backgrounds for + # First go through the three floors, displaying the backgrounds for # each floor. floor_bg1(w,$floor_colors['bg1'],$floor_colors['outline1']) @@ -32,12 +32,12 @@ w.raise("floor#{active}") - # Create a dummy item just to mark this point in the display list, + # Create a dummy item just to mark this point in the display list, # so we can insert highlights here. TkcRectangle.new(w,0,100,1,101, 'fill'=>'', 'outline'=>'', 'tags'=>'marker') - # Add the walls and labels for the active floor, along with + # Add the walls and labels for the active floor, along with # transparent polygons that define the rooms on the floor. # Make sure that the room polygons are on top. @@ -302,7 +302,7 @@ TkcLine.new(w,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg']) TkcLine.new(w,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) TkcLine.new(w,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - TkcLine.new(w,107,300,159,300,159,248,107,248,107,300, + TkcLine.new(w,107,300,159,300,159,248,107,248,107,300, 'fill'=>outline, 'tags'=>['floor3','bg']) end @@ -316,316 +316,316 @@ # color - Color to use for drawing foreground information. def floor_fg1(w,color) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '101' $floorItems['101'] = i - TkcText.new(w,358,209, 'text'=>'101', 'fill'=>color, + TkcText.new(w,358,209, 'text'=>'101', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Pub Lift1' $floorItems['Pub Lift1'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift1', 'fill'=>color, + TkcText.new(w,323,223, 'text'=>'Pub Lift1', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Priv Lift1' $floorItems['Priv Lift1'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift1', 'fill'=>color, + TkcText.new(w,323,188, 'text'=>'Priv Lift1', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, + i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '110' $floorItems['110'] = i - TkcText.new(w,21.5,363, 'text'=>'110', 'fill'=>color, + TkcText.new(w,21.5,363, 'text'=>'110', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, + i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '109' $floorItems['109'] = i - TkcText.new(w,67,363, 'text'=>'109', 'fill'=>color, + TkcText.new(w,67,363, 'text'=>'109', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, + i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '111' $floorItems['111'] = i - TkcText.new(w,28.5,276.5, 'text'=>'111', 'fill'=>color, + TkcText.new(w,28.5,276.5, 'text'=>'111', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, + i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '117B' $floorItems['117B'] = i - TkcText.new(w,88.5,278.5, 'text'=>'117B', 'fill'=>color, + TkcText.new(w,88.5,278.5, 'text'=>'117B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, + i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '112' $floorItems['112'] = i - TkcText.new(w,28.5,227.5, 'text'=>'112', 'fill'=>color, + TkcText.new(w,28.5,227.5, 'text'=>'112', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, + i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '113' $floorItems['113'] = i - TkcText.new(w,28.5,179.5, 'text'=>'113', 'fill'=>color, + TkcText.new(w,28.5,179.5, 'text'=>'113', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, + i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '117A' $floorItems['117A'] = i - TkcText.new(w,82,180.5, 'text'=>'117A', 'fill'=>color, + TkcText.new(w,82,180.5, 'text'=>'117A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, + i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '117' $floorItems['117'] = i - TkcText.new(w,65,235, 'text'=>'117', 'fill'=>color, + TkcText.new(w,65,235, 'text'=>'117', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, + i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '114' $floorItems['114'] = i - TkcText.new(w,28.5,135, 'text'=>'114', 'fill'=>color, + TkcText.new(w,28.5,135, 'text'=>'114', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, + i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '115' $floorItems['115'] = i - TkcText.new(w,74,141.5, 'text'=>'115', 'fill'=>color, + TkcText.new(w,74,141.5, 'text'=>'115', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, + i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '116' $floorItems['116'] = i - TkcText.new(w,48.5,70, 'text'=>'116', 'fill'=>color, + TkcText.new(w,48.5,70, 'text'=>'116', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, + i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '118' $floorItems['118'] = i - TkcText.new(w,108.5,102, 'text'=>'118', 'fill'=>color, + TkcText.new(w,108.5,102, 'text'=>'118', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,178,128,178,132,216,132,216,91, - 163,91,163,112,149,112,149,128, + 163,91,163,112,149,112,149,128, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '120' $floorItems['120'] = i - TkcText.new(w,189.5,111.5, 'text'=>'120', 'fill'=>color, + TkcText.new(w,189.5,111.5, 'text'=>'120', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192, - 156,192,156,169,175,169,175,246,79,246, + 156,192,156,169,175,169,175,246,79,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '122' $floorItems['122'] = i - TkcText.new(w,131,207.5, 'text'=>'122', 'fill'=>color, + TkcText.new(w,131,207.5, 'text'=>'122', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, + i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '121' $floorItems['121'] = i - TkcText.new(w,146,180, 'text'=>'121', 'fill'=>color, + TkcText.new(w,146,180, 'text'=>'121', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, + i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '106A' $floorItems['106A'] = i - TkcText.new(w,112.5,304.5, 'text'=>'106A', 'fill'=>color, + TkcText.new(w,112.5,304.5, 'text'=>'106A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, + i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '105' $floorItems['105'] = i - TkcText.new(w,124.5,278.5, 'text'=>'105', 'fill'=>color, + TkcText.new(w,124.5,278.5, 'text'=>'105', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, + i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '106B' $floorItems['106B'] = i - TkcText.new(w,163,304.5, 'text'=>'106B', 'fill'=>color, + TkcText.new(w,163,304.5, 'text'=>'106B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, + i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '104' $floorItems['104'] = i - TkcText.new(w,184,278.5, 'text'=>'104', 'fill'=>color, + TkcText.new(w,184,278.5, 'text'=>'104', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, + i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '108' $floorItems['108'] = i - TkcText.new(w,114.5,361, 'text'=>'108', 'fill'=>color, + TkcText.new(w,114.5,361, 'text'=>'108', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, + i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '107' $floorItems['107'] = i - TkcText.new(w,198,361, 'text'=>'107', 'fill'=>color, + TkcText.new(w,198,361, 'text'=>'107', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, + i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Smoking' $floorItems['Smoking'] = i - TkcText.new(w,280,341, 'text'=>'Smoking', 'fill'=>color, + TkcText.new(w,280,341, 'text'=>'Smoking', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, + i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '123' $floorItems['123'] = i - TkcText.new(w,245.5,190.5, 'text'=>'123', 'fill'=>color, + TkcText.new(w,245.5,190.5, 'text'=>'123', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, + i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '103' $floorItems['103'] = i - TkcText.new(w,259,287, 'text'=>'103', 'fill'=>color, + TkcText.new(w,259,287, 'text'=>'103', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, + i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '124' $floorItems['124'] = i - TkcText.new(w,356,150, 'text'=>'124', 'fill'=>color, + TkcText.new(w,356,150, 'text'=>'124', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, + i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '125' $floorItems['125'] = i - TkcText.new(w,392,217.5, 'text'=>'125', 'fill'=>color, + TkcText.new(w,392,217.5, 'text'=>'125', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, + i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '126' $floorItems['126'] = i - TkcText.new(w,436.5,185.5, 'text'=>'126', 'fill'=>color, + TkcText.new(w,436.5,185.5, 'text'=>'126', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,409,209,409,229,399,229,399,253, - 486,253,486,239,474,239,474,209, + 486,253,486,239,474,239,474,209, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '127' $floorItems['127'] = i - TkcText.new(w,436.5,'231', 'text'=>'127', 'fill'=>color, + TkcText.new(w,436.5,'231', 'text'=>'127', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,501,164,501,174,495,174,495,188, - 490,188,490,204,476,204,476,164, + 490,188,490,204,476,204,476,164, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'MShower' $floorItems['MShower'] = i - TkcText.new(w,488.5,'184', 'text'=>'MShower', 'fill'=>color, + TkcText.new(w,488.5,'184', 'text'=>'MShower', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, + i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Closet' $floorItems['Closet'] = i - TkcText.new(w,502.5,190, 'text'=>'Closet', 'fill'=>color, + TkcText.new(w,502.5,190, 'text'=>'Closet', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, + i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'WShower' $floorItems['WShower'] = i - TkcText.new(w,494.5,230, 'text'=>'WShower', 'fill'=>color, + TkcText.new(w,494.5,230, 'text'=>'WShower', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166, 697,166,697,275,553,275,531,254,515,254, - 515,174,503,174,503,161,486,161, + 515,174,503,174,503,161,486,161, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '130' $floorItems['130'] = i - TkcText.new(w,638.5,205, 'text'=>'130', 'fill'=>color, + TkcText.new(w,638.5,205, 'text'=>'130', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,308,242,339,242,339,248,342,248, 342,246,397,246,397,276,393,276, - 393,309,300,309,300,248,308,248, + 393,309,300,309,300,248,308,248, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '102' $floorItems['102'] = i - TkcText.new(w,367.5,278.5, 'text'=>'102', 'fill'=>color, + TkcText.new(w,367.5,278.5, 'text'=>'102', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, + i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '128' $floorItems['128'] = i - TkcText.new(w,441.5,265.5, 'text'=>'128', 'fill'=>color, + TkcText.new(w,441.5,265.5, 'text'=>'128', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,510,309,486,309,486,255,530,255, 552,277,561,277,561,325,510,325, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '129' $floorItems['129'] = i - TkcText.new(w,535.5,293, 'text'=>'129', 'fill'=>color, + TkcText.new(w,535.5,293, 'text'=>'129', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,696,281,740,281,740,387,642,387, - 642,389,561,389,561,277,696,277, + 642,389,561,389,561,277,696,277, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '133' $floorItems['133'] = i - TkcText.new(w,628.5,335, 'text'=>'133', 'fill'=>color, + TkcText.new(w,628.5,335, 'text'=>'133', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, + i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '132' $floorItems['132'] = i - TkcText.new(w,771,334, 'text'=>'132', 'fill'=>color, + TkcText.new(w,771,334, 'text'=>'132', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, + i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '134' $floorItems['134'] = i - TkcText.new(w,749.5,224, 'text'=>'134', 'fill'=>color, + TkcText.new(w,749.5,224, 'text'=>'134', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, + i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '135' $floorItems['135'] = i - TkcText.new(w,763,148.5, 'text'=>'135', 'fill'=>color, + TkcText.new(w,763,148.5, 'text'=>'135', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366, 304,312,396,312,396,288,400,288,404,288, 409,290,413,292,418,297,421,302,422,309, 421,318,417,325,411,330,405,332,397,333, 344,333,340,334,336,336,335,338,332,342, - 331,347,332,351,334,354,336,357,341,359, + 331,347,332,351,334,354,336,357,341,359, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Ramona Stair' $floorItems['Ramona Stair'] = i - TkcText.new(w,368,323, 'text'=>'Ramona Stair', 'fill'=>color, + TkcText.new(w,368,323, 'text'=>'Ramona Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20, - 122,28,123,32,123,68,220,68,220,87,90,87,90,23, + 122,28,123,32,123,68,220,68,220,87,90,87,90,23, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'University Stair' $floorItems['University Stair'] = i - TkcText.new(w,155,77.5, 'text'=>'University Stair', 'fill'=>color, + TkcText.new(w,155,77.5, 'text'=>'University Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56, 358,48,363,39,365,29,348,25,335,22,321,14, 300,5,283,1,260,0,246,0,242,2,236,4,231,8, - 227,13,223,17,221,22,220,34,260,34, + 227,13,223,17,221,22,220,34,260,34, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Plaza Stair' $floorItems['Plaza Stair'] = i - TkcText.new(w,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, + TkcText.new(w,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49, 323,56,337,70,350,83,365,94,377,100, - 386,104,386,128,220,128, + 386,104,386,128,220,128, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = 'Plaza Deck' $floorItems['Plaza Deck'] = i - TkcText.new(w,303,81, 'text'=>'Plaza Deck', 'fill'=>color, + TkcText.new(w,303,81, 'text'=>'Plaza Deck', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '106' $floorItems['106'] = i - TkcText.new(w,131.5,318.5, 'text'=>'106', 'fill'=>color, + TkcText.new(w,131.5,318.5, 'text'=>'106', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115, 95,128,114,128,114,151,157,151,157,153,112,153, - 112,130,97,130,97,168,175,168,175,131,146,131, + 112,130,97,130,97,168,175,168,175,131,146,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels[i.id] = '119' $floorItems['119'] = i - TkcText.new(w,143.5,133, 'text'=>'119', 'fill'=>color, + TkcText.new(w,143.5,133, 'text'=>'119', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) TkcLine.new(w,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall']) TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall']) @@ -798,321 +798,321 @@ def floor_fg2(w,color) i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222, - 800,222,800,168,748,168, + 800,222,800,168,748,168, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '238' $floorItems['238'] = i - TkcText.new(w,774,195, 'text'=>'238', 'fill'=>color, + TkcText.new(w,774,195, 'text'=>'238', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '237' $floorItems['237'] = i - TkcText.new(w,763,148.5, 'text'=>'237', 'fill'=>color, + TkcText.new(w,763,148.5, 'text'=>'237', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324, 643,324,643,291,641,291,641,205,696,205, 696,291,694,291,694,314,715,314,715,291, - 715,205,755,205,755,190,724,190,724,187, + 715,205,755,205,755,190,724,190,724,187, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '246' $floorItems['246'] = i - TkcText.new(w,600,264, 'text'=>'246', 'fill'=>color, + TkcText.new(w,600,264, 'text'=>'246', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, + i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '247' $floorItems['247'] = i - TkcText.new(w,668.5,296.5, 'text'=>'247', 'fill'=>color, + TkcText.new(w,668.5,296.5, 'text'=>'247', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246, 397,246,397,255,476,255,476,250,482,250,559,250, - 559,274,482,274,482,278,396,278,396,274,232,274, + 559,274,482,274,482,278,396,278,396,274,232,274, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '202' $floorItems['202'] = i - TkcText.new(w,285.5,260, 'text'=>'202', 'fill'=>color, + TkcText.new(w,285.5,260, 'text'=>'202', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196, 306,196,306,180,175,180,175,169,156,169, - 156,196,176,196,176,228, + 156,196,176,196,176,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '206' $floorItems['206'] = i - TkcText.new(w,143,267, 'text'=>'206', 'fill'=>color, + TkcText.new(w,143,267, 'text'=>'206', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, + i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '212' $floorItems['212'] = i - TkcText.new(w,28.5,307.5, 'text'=>'212', 'fill'=>color, + TkcText.new(w,28.5,307.5, 'text'=>'212', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, + i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '245' $floorItems['245'] = i - TkcText.new(w,521.5,300.5, 'text'=>'245', 'fill'=>color, + TkcText.new(w,521.5,300.5, 'text'=>'245', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, + i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '244' $floorItems['244'] = i - TkcText.new(w,579.5,357.5, 'text'=>'244', 'fill'=>color, + TkcText.new(w,579.5,357.5, 'text'=>'244', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, + i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '243' $floorItems['243'] = i - TkcText.new(w,622,357.5, 'text'=>'243', 'fill'=>color, + TkcText.new(w,622,357.5, 'text'=>'243', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, + i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '242' $floorItems['242'] = i - TkcText.new(w,666.5,340.5, 'text'=>'242', 'fill'=>color, + TkcText.new(w,666.5,340.5, 'text'=>'242', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, + i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = 'Barbecue Deck' $floorItems['Barbecue Deck'] = i - TkcText.new(w,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, + TkcText.new(w,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, + i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '240' $floorItems['240'] = i - TkcText.new(w,736,288, 'text'=>'240', 'fill'=>color, + TkcText.new(w,736,288, 'text'=>'240', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, + i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '241' $floorItems['241'] = i - TkcText.new(w,722,340.5, 'text'=>'241', 'fill'=>color, + TkcText.new(w,722,340.5, 'text'=>'241', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, + i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '239' $floorItems['239'] = i - TkcText.new(w,736,233.5, 'text'=>'239', 'fill'=>color, + TkcText.new(w,736,233.5, 'text'=>'239', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, + i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '248' $floorItems['248'] = i - TkcText.new(w,669,241.5, 'text'=>'248', 'fill'=>color, + TkcText.new(w,669,241.5, 'text'=>'248', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, + i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '236' $floorItems['236'] = i - TkcText.new(w,700,160, 'text'=>'236', 'fill'=>color, + TkcText.new(w,700,160, 'text'=>'236', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, + i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '235' $floorItems['235'] = i - TkcText.new(w,651.5,160, 'text'=>'235', 'fill'=>color, + TkcText.new(w,651.5,160, 'text'=>'235', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,626,143,633,143,633,135,572,135, - 572,143,579,143,579,185,626,185, + 572,143,579,143,579,185,626,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '234' $floorItems['234'] = i - TkcText.new(w,606,160, 'text'=>'234', 'fill'=>color, + TkcText.new(w,606,160, 'text'=>'234', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,557,135,571,135,571,145,578,145, - 578,185,527,185,527,131,557,131, + 578,185,527,185,527,131,557,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '233' $floorItems['233'] = i - TkcText.new(w,552.5,158, 'text'=>'233', 'fill'=>color, + TkcText.new(w,552.5,158, 'text'=>'233', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,249,557,249,557,205,476,205, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '230' $floorItems['230'] = i - TkcText.new(w,516.5,227, 'text'=>'230', 'fill'=>color, + TkcText.new(w,516.5,227, 'text'=>'230', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, + i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '232' $floorItems['232'] = i - TkcText.new(w,500.5,158, 'text'=>'232', 'fill'=>color, + TkcText.new(w,500.5,158, 'text'=>'232', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, + i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '229' $floorItems['229'] = i - TkcText.new(w,485.5,195, 'text'=>'229', 'fill'=>color, + TkcText.new(w,485.5,195, 'text'=>'229', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, + i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '227' $floorItems['227'] = i - TkcText.new(w,436.5,185.5, 'text'=>'227', 'fill'=>color, + TkcText.new(w,436.5,185.5, 'text'=>'227', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, + i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '228' $floorItems['228'] = i - TkcText.new(w,436.5,231, 'text'=>'228', 'fill'=>color, + TkcText.new(w,436.5,231, 'text'=>'228', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, + i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '226' $floorItems['226'] = i - TkcText.new(w,392,217.5, 'text'=>'226', 'fill'=>color, + TkcText.new(w,392,217.5, 'text'=>'226', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, + i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '225' $floorItems['225'] = i - TkcText.new(w,356.5,150, 'text'=>'225', 'fill'=>color, + TkcText.new(w,356.5,150, 'text'=>'225', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, + i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '224' $floorItems['224'] = i - TkcText.new(w,270,223.5, 'text'=>'224', 'fill'=>color, + TkcText.new(w,270,223.5, 'text'=>'224', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, + i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '223' $floorItems['223'] = i - TkcText.new(w,292,157, 'text'=>'223', 'fill'=>color, + TkcText.new(w,292,157, 'text'=>'223', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, + i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '222' $floorItems['222'] = i - TkcText.new(w,244.5,157, 'text'=>'222', 'fill'=>color, + TkcText.new(w,244.5,157, 'text'=>'222', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, + i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '221' $floorItems['221'] = i - TkcText.new(w,198,157, 'text'=>'221', 'fill'=>color, + TkcText.new(w,198,157, 'text'=>'221', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, + i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '204' $floorItems['204'] = i - TkcText.new(w,324,301.5, 'text'=>'204', 'fill'=>color, + TkcText.new(w,324,301.5, 'text'=>'204', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, + i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '205' $floorItems['205'] = i - TkcText.new(w,265.5,307, 'text'=>'205', 'fill'=>color, + TkcText.new(w,265.5,307, 'text'=>'205', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,256,385,256,340,212,340,212,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '207' $floorItems['207'] = i - TkcText.new(w,234,362.5, 'text'=>'207', 'fill'=>color, + TkcText.new(w,234,362.5, 'text'=>'207', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, + i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '208' $floorItems['208'] = i - TkcText.new(w,187,362.5, 'text'=>'208', 'fill'=>color, + TkcText.new(w,187,362.5, 'text'=>'208', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, + i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '209' $floorItems['209'] = i - TkcText.new(w,138.5,362.5, 'text'=>'209', 'fill'=>color, + TkcText.new(w,138.5,362.5, 'text'=>'209', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, + i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '217' $floorItems['217'] = i - TkcText.new(w,71,192, 'text'=>'217', 'fill'=>color, + TkcText.new(w,71,192, 'text'=>'217', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, + i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '217A' $floorItems['217A'] = i - TkcText.new(w,93,179.5, 'text'=>'217A', 'fill'=>color, + TkcText.new(w,93,179.5, 'text'=>'217A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, + i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '216' $floorItems['216'] = i - TkcText.new(w,71,145.5, 'text'=>'216', 'fill'=>color, + TkcText.new(w,71,145.5, 'text'=>'216', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, + i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '215' $floorItems['215'] = i - TkcText.new(w,28.5,157, 'text'=>'215', 'fill'=>color, + TkcText.new(w,28.5,157, 'text'=>'215', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, + i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '214' $floorItems['214'] = i - TkcText.new(w,28.5,203.5, 'text'=>'214', 'fill'=>color, + TkcText.new(w,28.5,203.5, 'text'=>'214', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, + i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '213' $floorItems['213'] = i - TkcText.new(w,28.5,252, 'text'=>'213', 'fill'=>color, + TkcText.new(w,28.5,252, 'text'=>'213', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, + i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '210' $floorItems['210'] = i - TkcText.new(w,90.5,362.5, 'text'=>'210', 'fill'=>color, + TkcText.new(w,90.5,362.5, 'text'=>'210', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, + i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '211' $floorItems['211'] = i - TkcText.new(w,33,364.5, 'text'=>'211', 'fill'=>color, + TkcText.new(w,33,364.5, 'text'=>'211', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, + i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '203' $floorItems['203'] = i - TkcText.new(w,367.5,292.5, 'text'=>'203', 'fill'=>color, + TkcText.new(w,367.5,292.5, 'text'=>'203', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198, - 154,198,154,192,109,192,109,169,99,169, + 154,198,154,192,109,192,109,169,99,169, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '220' $floorItems['220'] = i - TkcText.new(w,132.5,208.5, 'text'=>'220', 'fill'=>color, + TkcText.new(w,132.5,208.5, 'text'=>'220', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = 'Priv Lift2' $floorItems['Priv Lift2'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift2', 'fill'=>color, + TkcText.new(w,323,188, 'text'=>'Priv Lift2', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = 'Pub Lift 2' $floorItems['Pub Lift 2'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, + TkcText.new(w,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, + i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '218' $floorItems['218'] = i - TkcText.new(w,136,149.5, 'text'=>'218', 'fill'=>color, + TkcText.new(w,136,149.5, 'text'=>'218', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, + i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '219' $floorItems['219'] = i - TkcText.new(w,132.5,180, 'text'=>'219', 'fill'=>color, + TkcText.new(w,132.5,180, 'text'=>'219', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels[i.id] = '201' $floorItems['201'] = i - TkcText.new(w,358,209, 'text'=>'201', 'fill'=>color, + TkcText.new(w,358,209, 'text'=>'201', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) TkcLine.new(w,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall']) TkcLine.new(w,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall']) @@ -1283,206 +1283,206 @@ 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '316' $floorItems['316'] = i - TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color, + TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, + i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '309' $floorItems['309'] = i - TkcText.new(w,138.5,345.5, 'text'=>'309', 'fill'=>color, + TkcText.new(w,138.5,345.5, 'text'=>'309', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, + i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '308' $floorItems['308'] = i - TkcText.new(w,187.5,345.5, 'text'=>'308', 'fill'=>color, + TkcText.new(w,187.5,345.5, 'text'=>'308', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, + i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '307' $floorItems['307'] = i - TkcText.new(w,234,345.5, 'text'=>'307', 'fill'=>color, + TkcText.new(w,234,345.5, 'text'=>'307', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, + i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '305' $floorItems['305'] = i - TkcText.new(w,270.5,301.5, 'text'=>'305', 'fill'=>color, + TkcText.new(w,270.5,301.5, 'text'=>'305', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,251,219,251,203,244,203,244,219, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '324B' $floorItems['324B'] = i - TkcText.new(w,247.5,211, 'text'=>'324B', 'fill'=>color, + TkcText.new(w,247.5,211, 'text'=>'324B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, + i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '324A' $floorItems['324A'] = i - TkcText.new(w,247.5,240.5, 'text'=>'324A', 'fill'=>color, + TkcText.new(w,247.5,240.5, 'text'=>'324A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, + i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '320' $floorItems['320'] = i - TkcText.new(w,200,157, 'text'=>'320', 'fill'=>color, + TkcText.new(w,200,157, 'text'=>'320', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, + i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '310' $floorItems['310'] = i - TkcText.new(w,90.5,345.5, 'text'=>'310', 'fill'=>color, + TkcText.new(w,90.5,345.5, 'text'=>'310', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, + i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '312' $floorItems['312'] = i - TkcText.new(w,45.5,299, 'text'=>'312', 'fill'=>color, + TkcText.new(w,45.5,299, 'text'=>'312', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, + i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '313' $floorItems['313'] = i - TkcText.new(w,45.5,252, 'text'=>'313', 'fill'=>color, + TkcText.new(w,45.5,252, 'text'=>'313', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, + i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '314' $floorItems['314'] = i - TkcText.new(w,40.5,203.5, 'text'=>'314', 'fill'=>color, + TkcText.new(w,40.5,203.5, 'text'=>'314', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, + i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '315' $floorItems['315'] = i - TkcText.new(w,59,157, 'text'=>'315', 'fill'=>color, + TkcText.new(w,59,157, 'text'=>'315', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, + i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '316B' $floorItems['316B'] = i - TkcText.new(w,95,215, 'text'=>'316B', 'fill'=>color, + TkcText.new(w,95,215, 'text'=>'316B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, + i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '316A' $floorItems['316A'] = i - TkcText.new(w,95,191, 'text'=>'316A', 'fill'=>color, + TkcText.new(w,95,191, 'text'=>'316A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198, - 174,198,174,226,101,226,101,179,97,179, + 174,198,174,226,101,226,101,179,97,179, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '319' $floorItems['319'] = i - TkcText.new(w,141.5,209, 'text'=>'319', 'fill'=>color, + TkcText.new(w,141.5,209, 'text'=>'319', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, + i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '311' $floorItems['311'] = i - TkcText.new(w,29.5,361, 'text'=>'311', 'fill'=>color, + TkcText.new(w,29.5,361, 'text'=>'311', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, + i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '318' $floorItems['318'] = i - TkcText.new(w,132.5,180, 'text'=>'318', 'fill'=>color, + TkcText.new(w,132.5,180, 'text'=>'318', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, + i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '317' $floorItems['317'] = i - TkcText.new(w,136,149.5, 'text'=>'317', 'fill'=>color, + TkcText.new(w,136,149.5, 'text'=>'317', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, + i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '323' $floorItems['323'] = i - TkcText.new(w,290,207.5, 'text'=>'323', 'fill'=>color, + TkcText.new(w,290,207.5, 'text'=>'323', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, + i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '325' $floorItems['325'] = i - TkcText.new(w,290,235.5, 'text'=>'325', 'fill'=>color, + TkcText.new(w,290,235.5, 'text'=>'325', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, + i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '321' $floorItems['321'] = i - TkcText.new(w,243.5,157, 'text'=>'321', 'fill'=>color, + TkcText.new(w,243.5,157, 'text'=>'321', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,314,169,306,169,306,192,273,192, - 264,181,264,135,314,135, + 264,181,264,135,314,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '322' $floorItems['322'] = i - TkcText.new(w,293.5,163.5, 'text'=>'322', 'fill'=>color, + TkcText.new(w,293.5,163.5, 'text'=>'322', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = 'Pub Lift3' $floorItems['Pub Lift3'] = i - TkcText.new(w,323,223, 'text'=>'Pub Lift3', 'fill'=>color, + TkcText.new(w,323,223, 'text'=>'Pub Lift3', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = 'Priv Lift3' $floorItems['Priv Lift3'] = i - TkcText.new(w,323,188, 'text'=>'Priv Lift3', 'fill'=>color, + TkcText.new(w,323,188, 'text'=>'Priv Lift3', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, + i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '303' $floorItems['303'] = i - TkcText.new(w,373.5,292.5, 'text'=>'303', 'fill'=>color, + TkcText.new(w,373.5,292.5, 'text'=>'303', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,272,203,272,249,252,249,252,230, - 244,230,244,221,252,221,252,203, + 244,230,244,221,252,221,252,203, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '324' $floorItems['324'] = i - TkcText.new(w,262,226, 'text'=>'324', 'fill'=>color, + TkcText.new(w,262,226, 'text'=>'324', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, + i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '304' $floorItems['304'] = i - TkcText.new(w,324,301.5, 'text'=>'304', 'fill'=>color, + TkcText.new(w,324,301.5, 'text'=>'304', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '301' $floorItems['301'] = i - TkcText.new(w,358,209, 'text'=>'301', 'fill'=>color, + TkcText.new(w,358,209, 'text'=>'301', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, + i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '327' $floorItems['327'] = i - TkcText.new(w,387,215.5, 'text'=>'327', 'fill'=>color, + TkcText.new(w,387,215.5, 'text'=>'327', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, + i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '326' $floorItems['326'] = i - TkcText.new(w,365.5,150, 'text'=>'326', 'fill'=>color, + TkcText.new(w,365.5,150, 'text'=>'326', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282, - 375,274,397,274,397,248,339,248,339,242,308,242, + 375,274,397,274,397,248,339,248,339,242,308,242, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '302' $floorItems['302'] = i - TkcText.new(w,319.5,261, 'text'=>'302', 'fill'=>color, + TkcText.new(w,319.5,261, 'text'=>'302', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203, 272,193,263,180,242,180,175,180,175,169,156,169, 156,196,177,196,177,228,107,228,70,228,70,275,107,275, - 107,248,160,248,160,301,107,301,107,275,70,275, + 107,248,160,248,160,301,107,301,107,275,70,275, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels[i.id] = '306' $floorItems['306'] = i - TkcText.new(w,200.5,284.5, 'text'=>'306', 'fill'=>color, + TkcText.new(w,200.5,284.5, 'text'=>'306', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall']) TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall']) @@ -1577,7 +1577,7 @@ # toplevel widget if defined?($floor_demo) && $floor_demo - $floor_demo.destroy + $floor_demo.destroy $floor_demo = nil end @@ -1593,7 +1593,7 @@ base_frame = TkFrame.new($floor_demo).pack(:fill=>:both, :expand=>true) # label -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', 'text'=>"This window contains a canvas widget showing the floorplan of Digital Equipment Corporation's Western Research Laboratory. It has three levels. At any given time one of the levels is active, meaning that you can see its room structure. To activate a level, click the left mouse button anywhere on it. As the mouse moves over the active level, the room under the mouse lights up and its room number appears in the \"Room:\" entry. You can also type a room number in the entry and the room will light up."){ pack('side'=>'top') } @@ -1616,18 +1616,18 @@ } $floor_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# +# $floorLabels = {} $floorItems = {} -# canvas +# canvas if $tk_version =~ /^4\.[01]/ $floor_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken', 'highlightthickness'=>2) - $floor_canvas = TkCanvas.new($floor_canvas_frame, - 'width'=>900, 'height'=>500, 'borderwidth'=>0, + $floor_canvas = TkCanvas.new($floor_canvas_frame, + 'width'=>900, 'height'=>500, 'borderwidth'=>0, 'highlightthickness'=>0) {|c| - TkScrollbar.new(base_frame, 'orient'=>'horiz', + TkScrollbar.new(base_frame, 'orient'=>'horiz', 'command'=>proc{|*args| c.xview(*args)}){|hs| c.xscrollcommand(proc{|first,last| hs.set first,last}) pack('side'=>'bottom', 'fill'=>'x') @@ -1648,20 +1648,20 @@ v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical') TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1| - $floor_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, - 'borderwidth'=>0, + $floor_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, + 'borderwidth'=>0, 'highlightthickness'=>0) { xscrollcommand(proc{|first,last| h.set first,last}) yscrollcommand(proc{|first,last| v.set first,last}) pack('expand'=>'yes', 'fill'=>'both') } - grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, + grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') } - v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, + v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, + h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) @@ -1678,7 +1678,7 @@ # Create an entry for displaying and typing in current room. $currentRoom = TkVariable.new -$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken', +$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken', 'bd'=>2, 'textvariable'=>$currentRoom) # Choose colors, then fill in the floorplan. @@ -1715,7 +1715,7 @@ $floor_canvas.itembind('room', 'Enter', proc{newRoom $floor_canvas}) $floor_canvas.itembind('room', 'Leave', proc{$currentRoom.value = ''}) $floor_canvas.bind('2', proc{|x,y| $floor_canvas.scan_mark x,y}, '%x %y') -$floor_canvas.bind('B2-Motion', +$floor_canvas.bind('B2-Motion', proc{|x,y| $floor_canvas.scan_dragto x,y}, '%x %y') $floor_canvas.bind('Destroy', proc{$currentRoom.unset}) $currentRoom.value = '' Index: ext/tk/sample/demos-en/widget =================================================================== --- ext/tk/sample/demos-en/widget (revision 23917) +++ ext/tk/sample/demos-en/widget (working copy) @@ -170,9 +170,12 @@ } scr.command(proc{|*args| txt.yview(*args)}) # txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both', 'padx'=>1) - txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both') +# txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both') # textFrame.pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>2) textFrame.pack('expand'=>'yes', 'fill'=>'both') + # $root.withdraw.deiconify + Tk.update_idletasks + txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both') statusBar = TkFrame.new($root) {|f| if $tk_version =~ /^4.*/ @@ -1035,7 +1038,7 @@ # def aboutBox Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo', - 'message'=>"Ruby/Tk widget demonstration Ver.1.7.0-en\n\n" + + 'message'=>"Ruby/Tk widget demonstration Ver.1.7.1-en\n\n" + "based on demos of Tk8.1 -- 8.5 " + "( Copyright of Tcl/Tk demos:: " + "(c) 1996-1997 Sun Microsystems, Inc. / " + Index: ext/tk/sample/demos-en/entry3.rb =================================================================== --- ext/tk/sample/demos-en/entry3.rb (revision 23917) +++ ext/tk/sample/demos-en/entry3.rb (working copy) @@ -7,7 +7,7 @@ # based on Tcl/Tk8.4.4 widget demos if defined?($entry3_demo) && $entry3_demo - $entry3_demo.destroy + $entry3_demo.destroy $entry3_demo = nil end @@ -19,8 +19,8 @@ base_frame = TkFrame.new($entry3_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'5i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'5i', :justify=>:left, :text=><:top) Four different entries are displayed below. You can add characters \ by pointing, clicking and typing, though each is constrained in what \ @@ -63,8 +63,8 @@ def focusAndFlash(widget, fg, bg, count=5) return if count <= 0 if fg && !fg.empty? && bg && !bg.empty? - TkTimer.new(200, count, - proc{widget.configure(:foreground=>bg, :background=>fg)}, + TkTimer.new(200, count, + proc{widget.configure(:foreground=>bg, :background=>fg)}, proc{widget.configure(:foreground=>fg, :background=>bg)} ).start else @@ -86,7 +86,7 @@ end l1 = TkLabelFrame.new(base_frame, :text=>"Integer Entry") -TkEntry.new(l1, :validate=>:focus, +TkEntry.new(l1, :validate=>:focus, :vcmd=>[ proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' ]) {|e| @@ -97,7 +97,7 @@ } l2 = TkLabelFrame.new(base_frame, :text=>"Length-Constrained Entry") -TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell}, +TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell}, :vcmd=>[proc{|s| s.length < 10}, '%P'] ).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') @@ -171,7 +171,7 @@ def validatePhoneChange(widget, vmode, idx, char) return true if idx == nil - Tk.after_idle(proc{widget.configure(:validate=>vmode, + Tk.after_idle(proc{widget.configure(:validate=>vmode, :invcmd=>proc{Tk.bell})}) if !(idx<3 || idx==6 || idx==7 || idx==11 || idx>15) && char =~ /[0-9A-Za-z]/ widget.delete(idx) @@ -179,17 +179,17 @@ Tk.after_idle(proc{phoneSkipRight(widget, -1)}) return true # Tk.update(true) # <- Don't work 'update' inter validation callback. - # It depends on Tcl/Tk side (tested on Tcl/Tk8.5a1). + # It depends on Tcl/Tk side (tested on Tcl/Tk8.5a1). end return false end l3 = TkLabelFrame.new(base_frame, :text=>"US Phone-Number Entry") -TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, - :textvariable=>entry3content, +TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, + :textvariable=>entry3content, :vcmd=>[ - proc{|w,v,i,s| validatePhoneChange(w,v,i,s)}, + proc{|w,v,i,s| validatePhoneChange(w,v,i,s)}, "%W %v %i %S" ]){|e| # Click to focus goes to the first editable character... @@ -205,9 +205,9 @@ } l4 = TkLabelFrame.new(base_frame, :text=>"Password Entry") -TkEntry.new(l4, :validate=>:key, :show=>'*', +TkEntry.new(l4, :validate=>:key, :show=>'*', :vcmd=>[ - proc{|s| s.length <= 8}, + proc{|s| s.length <= 8}, '%P' ]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') Index: ext/tk/sample/demos-en/twind.rb =================================================================== --- ext/tk/sample/demos-en/twind.rb (revision 23917) +++ ext/tk/sample/demos-en/twind.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($twind_demo) && $twind_demo - $twind_demo.destroy + $twind_demo.destroy $twind_demo = nil end @@ -41,10 +41,10 @@ # frame $twind_text = nil -TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, +TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, 'relief'=>'sunken') {|f| - $twind_text = TkText.new(f, 'setgrid'=>'true', 'font'=>$font, - 'width'=>'70', 'height'=>35, 'wrap'=>'word', + $twind_text = TkText.new(f, 'setgrid'=>'true', 'font'=>$font, + 'width'=>'70', 'height'=>35, 'wrap'=>'word', 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| TkScrollbar.new(f) {|s| command proc{|*args| t.yview(*args)} @@ -53,12 +53,12 @@ }.pack('expand'=>'yes', 'fill'=>'both') }.pack('expand'=>'yes', 'fill'=>'both') -# -$tag_center = TkTextTag.new($twind_text, +# +$tag_center = TkTextTag.new($twind_text, 'justify' =>'center', 'spacing1'=>'5m', 'spacing3'=>'5m' ) -$tag_buttons = TkTextTag.new($twind_text, +$tag_buttons = TkTextTag.new($twind_text, 'lmargin1'=>'1c', 'lmargin2'=>'1c', 'rmargin' =>'1c', @@ -71,7 +71,7 @@ $twind_text.insert('end', "and they can consist of arbitrary widgets. ") $twind_text.insert('end', "For example, here are two embedded button ") $twind_text.insert('end', "widgets. You can click on the first button to ") -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { #text 'ON' text 'Turn On' @@ -81,7 +81,7 @@ $twind_text.insert('end', " horizontal scrolling, which also turns off ") $twind_text.insert('end', "word wrapping. Or, you can click on the second ") $twind_text.insert('end', "button to\n") -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { #text 'OFF' text 'Turn Off' @@ -91,7 +91,7 @@ $twind_text.insert('end', " horizontal scrolling and turn back on word wrapping.\n\n") $twind_text.insert('end', "Or, here is another example. If you ") -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { text 'Click Here' command proc{textWindPlot $twind_text} @@ -102,7 +102,7 @@ $mark_plot.gravity='left' $twind_text.insert('end', " You can drag the data points around with the mouse, ") $twind_text.insert('end', "or you can click here to ") -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { text 'Delete' command proc{textWindDel $twind_text} @@ -124,7 +124,7 @@ $twind_text.insert('end', "to restore the short string.\n") -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) {|b| text 'Default' command proc{embDefBg $twind_text} @@ -133,7 +133,7 @@ }, 'padx'=>3 ) embToggle = TkVariable.new('Short') -TkTextWindow.new($twind_text, 'end', +TkTextWindow.new($twind_text, 'end', 'window'=>TkCheckButton.new($twind_text) { textvariable embToggle indicatoron 0 @@ -144,25 +144,25 @@ pady 5 padx 2 }, - 'padx'=>3, + 'padx'=>3, 'pady'=>2 ) -[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', - 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', - 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', - 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' +[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', + 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', + 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', + 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' ].each{|twind_color| - TkTextWindow.new($twind_text, 'end', + TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { text twind_color cursor 'top_left_arrow' command proc{$twind_text.bg twind_color} }, - 'padx'=>3, + 'padx'=>3, 'pady'=>2 ) } -# +# def textWindOn (w,f) if defined? $twind_scroll begin @@ -216,39 +216,39 @@ TkcLine.new($twind_plot, 100, 250, 400, 250, 'width'=>2) TkcLine.new($twind_plot, 100, 250, 100, 50, 'width'=>2) - TkcText.new($twind_plot, 225, 20, + TkcText.new($twind_plot, 225, 20, 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) TkcLine.new($twind_plot, x, 250, x, 245, 'width'=>2) - TkcText.new($twind_plot, x, 254, + TkcText.new($twind_plot, x, 254, 'text'=>10*i, 'font'=>font, 'anchor'=>'n') } (0..5).each {|i| y = 250 - (i * 40) TkcLine.new($twind_plot, 100, y, 105, y, 'width'=>2) - TkcText.new($twind_plot, 96, y, + TkcText.new($twind_plot, 96, y, 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') } for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] x = 100 + (3*xx) y = 250 - (4*yy)/5 - item = TkcOval.new($twind_plot, x-6, y-6, x+6, y+6, + item = TkcOval.new($twind_plot, x-6, y-6, x+6, y+6, 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') item.addtag 'point' end - $twind_plot.itembind('point', 'Any-Enter', + $twind_plot.itembind('point', 'Any-Enter', proc{$twind_plot.itemconfigure 'current', 'fill', 'red'}) - $twind_plot.itembind('point', 'Any-Leave', + $twind_plot.itembind('point', 'Any-Leave', proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) - $twind_plot.itembind('point', '1', + $twind_plot.itembind('point', '1', proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y") - $twind_plot.itembind('point', 'ButtonRelease-1', + $twind_plot.itembind('point', 'ButtonRelease-1', proc{$twind_plot.dtag 'selected'}) - $twind_plot.bind('B1-Motion', + $twind_plot.bind('B1-Motion', proc{|x,y| embPlotMove $twind_plot,x,y}, "%x %y") while ($twind_text.get($mark_plot) =~ /[ \t\n]/) $twind_text.delete $mark_plot Index: ext/tk/sample/demos-en/ttkprogress.rb =================================================================== --- ext/tk/sample/demos-en/ttkprogress.rb (revision 23917) +++ ext/tk/sample/demos-en/ttkprogress.rb (working copy) @@ -5,7 +5,7 @@ # based on "Id: ttkprogress.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($ttkprogress_demo) && $ttkprogress_demo - $ttkprogress_demo.destroy + $ttkprogress_demo.destroy $ttkprogress_demo = nil end @@ -17,7 +17,7 @@ base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=>Tk::UTF8_String.new(<:top, :fill=>:x) Below are two progress bars. \ The top one is a \\u201Cdeterminate\\u201D progress bar, \ @@ -32,16 +32,16 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttkprogress'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttkprogress'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttkprogress_demo.destroy $ttkprogress_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -52,9 +52,9 @@ p1 = Ttk::Progressbar.new(frame, :mode=>:determinate) p2 = Ttk::Progressbar.new(frame, :mode=>:indeterminate) -start = Ttk::Button.new(frame, :text=>'Start Progress', +start = Ttk::Button.new(frame, :text=>'Start Progress', :command=>proc{ p1.start; p2.start }) -stop = Ttk::Button.new(frame, :text=>'Stop Progress', +stop = Ttk::Button.new(frame, :text=>'Stop Progress', :command=>proc{ p1.stop; p2.stop }) Tk.grid(p1, '-', :pady=>5, :padx=>10) Index: ext/tk/sample/demos-en/icon.rb =================================================================== --- ext/tk/sample/demos-en/icon.rb (revision 23917) +++ ext/tk/sample/demos-en/icon.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($icon_demo) && $icon_demo - $icon_demo.destroy + $icon_demo.destroy $icon_demo = nil end @@ -48,7 +48,7 @@ }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# image +# image flagup = \ TkBitmapImage.new('file'=>[$demo_dir,'..', 'images','flagup.xbm'].join(File::Separator), Index: ext/tk/sample/demos-en/check2.rb =================================================================== --- ext/tk/sample/demos-en/check2.rb (revision 23917) +++ ext/tk/sample/demos-en/check2.rb (working copy) @@ -4,7 +4,7 @@ # delete old toplevel widget if defined?($check2_demo) && $check2_demo - $check2_demo.destroy + $check2_demo.destroy $check2_demo = nil end @@ -34,35 +34,35 @@ # frame TkFrame.new(base_frame) {|frame| - TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), + TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - TkButton.new(frame, :text=>'See Variables', - :image=>$image['view'], :compound=>:left, + TkGrid('x', + TkButton.new(frame, :text=>'See Variables', + :image=>$image['view'], :compound=>:left, :command=>proc{ - showVars($check2_demo, - ['safety', safety], ['wipers', wipers], + showVars($check2_demo, + ['safety', safety], ['wipers', wipers], ['brakes', brakes], ['sober', sober]) - }), - TkButton.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'check2'}), - TkButton.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + }), + TkButton.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'check2'}), + TkButton.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $check2_demo $check2_demo = nil $showVarsWin[tmppath.path] = nil tmppath.destroy - }), + }), :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) }.pack('side'=>'bottom', 'fill'=>'x') # checkbutton -TkCheckButton.new(base_frame, :text=>'Safety Check', :variable=>safety, - :relief=>:flat, :onvalue=>'all', :offvalue=>'none', +TkCheckButton.new(base_frame, :text=>'Safety Check', :variable=>safety, + :relief=>:flat, :onvalue=>'all', :offvalue=>'none', :tristatevalue=>'partial'){ pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') } @@ -70,7 +70,7 @@ [ TkCheckButton.new(base_frame, 'text'=>'Wipers OK', 'variable'=>wipers), TkCheckButton.new(base_frame, 'text'=>'Brakes OK', 'variable'=>brakes), TkCheckButton.new(base_frame, 'text'=>'Driver Sober', 'variable'=>sober) -].each{|w| +].each{|w| w.relief('flat') w.pack('side'=>'top', 'padx'=>15, 'pady'=>2, 'anchor'=>'w') } Index: ext/tk/sample/demos-en/toolbar.rb =================================================================== --- ext/tk/sample/demos-en/toolbar.rb (revision 23917) +++ ext/tk/sample/demos-en/toolbar.rb (working copy) @@ -5,7 +5,7 @@ # based on "Id: toolbar.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($toolbar_demo) && $toolbar_demo - $toolbar_demo.destroy + $toolbar_demo.destroy $toolbar_demo = nil end @@ -18,7 +18,7 @@ base_frame = Ttk::Frame.new($toolbar_demo).pack(:fill=>:both, :expand=>true) if Tk.windowingsystem != 'aqua' - msg = Ttk::Label.new(base_frame, :wraplength=>'4i', + msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=>Tk::UTF8_String.new(<'4i', + msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=>Tk::UTF8_String.new(<40, :height=>10) ## Toolbar contents -tb_btn = Ttk::Button.new(tbar_base, :text=>'Button', :style=>'Toolbutton', +tb_btn = Ttk::Button.new(tbar_base, :text=>'Button', :style=>'Toolbutton', :command=>proc{text.insert(:end, "Button Pressed\n")}) -tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'Check', :style=>'Toolbutton', - :variable=>(check = TkVariable.new), +tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'Check', :style=>'Toolbutton', + :variable=>(check = TkVariable.new), :command=>proc{ text.insert(:end, "Check is #{check.value}\n") }) tb_mbtn = Ttk::Menubutton.new(tbar_base, :text=>'Menu') -tb_combo = Ttk::Combobox.new(tbar_base, :value=>TkFont.families, +tb_combo = Ttk::Combobox.new(tbar_base, :value=>TkFont.families, :state=>:readonly) tb_mbtn.menu(menu = Tk::Menu.new(tb_mbtn)) menu.add(:command, :label=>'Just', :command=>proc{text.insert(:end, "Just\n")}) menu.add(:command, :label=>'An', :command=>proc{text.insert(:end, "An\n")}) -menu.add(:command, :label=>'Example', +menu.add(:command, :label=>'Example', :command=>proc{text.insert(:end, "Example\n")}) tb_combo.bind(''){ text.font.family = tb_combo.get } ## Arrange contents -Tk.grid(tb_btn, tb_chk, tb_mbtn, tb_combo, +Tk.grid(tb_btn, tb_chk, tb_mbtn, tb_combo, :in=>contents, :padx=>2, :sticky=>'ns') Tk.grid(tbar_base, :sticky=>'ew') Tk.grid(sep, :sticky=>'ew') @@ -114,16 +114,16 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'toolbar'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'toolbar'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $toolbar_demo.destroy $toolbar_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) Tk.grid(frame, :sticky=>'ew') Index: ext/tk/sample/demos-en/image1.rb =================================================================== --- ext/tk/sample/demos-en/image1.rb (revision 23917) +++ ext/tk/sample/demos-en/image1.rb (working copy) @@ -7,7 +7,7 @@ # toplevel widget if defined?($image1_demo) && $image1_demo - $image1_demo.destroy + $image1_demo.destroy $image1_demo = nil end Index: ext/tk/sample/demos-en/ttkpane.rb =================================================================== --- ext/tk/sample/demos-en/ttkpane.rb (revision 23917) +++ ext/tk/sample/demos-en/ttkpane.rb (working copy) @@ -5,7 +5,7 @@ # based on "Id: ttkpane.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($ttkpane_demo) && $ttkpane_demo - $ttkpane_demo.destroy + $ttkpane_demo.destroy $ttkpane_demo = nil end @@ -17,7 +17,7 @@ base_frame = TkFrame.new($ttkpane_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) This demonstration shows off a nested set of themed paned windows. \ Their sizes can be changed by grabbing the area \ @@ -30,16 +30,16 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttkpane'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttkpane'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttkpane_demo.destroy $ttkpane_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -59,25 +59,25 @@ end # Fill the button pane -Ttk::Button.new(left_top, :text=>'Press Me', +Ttk::Button.new(left_top, :text=>'Press Me', :command=>proc{ - Tk.messageBox(:type=>'ok', :icon=>'info', :message=>'Ouch!', - :detail=>'That hurt...', :parent=>base_frame, + Tk.messageBox(:type=>'ok', :icon=>'info', :message=>'Ouch!', + :detail=>'That hurt...', :parent=>base_frame, :title=>'Button Pressed') }).pack(:padx=>2, :pady=>5) zones_list = [ - [':Europe/Berlin'], - [':America/Argentina/Buenos_Aires', ':America/Buenos_Aires'], - [':Africa/Johannesburg'], - [':Europe/London'], - [':America/Los_Angeles'], + [':Europe/Berlin'], + [':America/Argentina/Buenos_Aires', ':America/Buenos_Aires'], + [':Africa/Johannesburg'], + [':Europe/London'], + [':America/Los_Angeles'], [':Europe/Moscow'], - [':America/New_York'], - [':Asia/Singapore'], - [':Australia/Sydney'], - [':Asia/Tokyo'], + [':America/New_York'], + [':Asia/Singapore'], + [':Australia/Sydney'], + [':Asia/Tokyo'], ] zones = [] @@ -155,7 +155,7 @@ case tzinfo when :tcl update_proc = proc{|now, tz, label| - time[label] = Tk.tk_call('clock', 'format', now.tv_sec, + time[label] = Tk.tk_call('clock', 'format', now.tv_sec, '-timezone', tz, '-format', '%T') } when :tzinfo @@ -176,7 +176,7 @@ zones.each_with_index{|(zone, label), idx| Ttk::Separator.new(left_bot).pack(:fill=>:x) if idx > 0 Ttk::Label.new(left_bot, :text=>label, :anchor=>'w').pack(:fill=>:x) - Ttk::Label.new(left_bot, :textvariable=>time.ref(label), + Ttk::Label.new(left_bot, :textvariable=>time.ref(label), :anchor=>'w').pack(:fill=>:x) } Index: ext/tk/sample/demos-en/paned1.rb =================================================================== --- ext/tk/sample/demos-en/paned1.rb (revision 23917) +++ ext/tk/sample/demos-en/paned1.rb (working copy) @@ -6,7 +6,7 @@ # based on "Id: paned1.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp" if defined?($paned1_demo) && $paned1_demo - $paned1_demo.destroy + $paned1_demo.destroy $paned1_demo = nil end @@ -18,8 +18,8 @@ base_frame = TkFrame.new($paned1_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'4i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top) The sash between the two coloured windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.) If your Tk library linked to Ruby doesn't include a 'panedwindow', this demo doesn't work. Please use later version of Tk which supports a 'panedwindow'. @@ -40,7 +40,7 @@ } TkPanedwindow.new(base_frame, :orient=>:horizontal){|f| - add(Tk::Label.new(f, :text=>"This is the\nleft side", :bg=>'yellow'), + add(Tk::Label.new(f, :text=>"This is the\nleft side", :bg=>'yellow'), Tk::Label.new(f, :text=>"This is the\nright side", :bg=>'cyan')) pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m') Index: ext/tk/sample/demos-en/ttkbut.rb =================================================================== --- ext/tk/sample/demos-en/ttkbut.rb (revision 23917) +++ ext/tk/sample/demos-en/ttkbut.rb (working copy) @@ -7,7 +7,7 @@ # based on "Id: ttkbut.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp" if defined?($ttkbut_demo) && $ttkbut_demo - $ttkbut_demo.destroy + $ttkbut_demo.destroy $ttkbut_demo = nil end @@ -19,7 +19,7 @@ base_frame = TkFrame.new($ttkbut_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) Ttk is the new Tk themed widget set. This is a Ttk themed label, \ and below are three groups of Ttk widgets in Ttk labelframes. \ @@ -34,11 +34,11 @@ ## Add buttons for setting the theme buttons = Ttk::Labelframe.new(base_frame, :text=>'Buttons') # Ttk::Style.theme_names.each{|theme| -# Ttk::Button.new(buttons, :text=>theme, +# Ttk::Button.new(buttons, :text=>theme, # :command=>proc{Ttk::Style.theme_use theme}).pack(:pady=>2) # } Ttk.themes.each{|theme| - Ttk::Button.new(buttons, :text=>theme, + Ttk::Button.new(buttons, :text=>theme, :command=>proc{Ttk.set_theme theme}).pack(:pady=>2) } @@ -62,9 +62,9 @@ ## Set up the checkbutton group checks = Ttk::Labelframe.new(base_frame, :text=>'Checkbuttons') enabled = TkVariable.new(true) -e = Ttk::Checkbutton.new(checks, :text=>'Enabled', :variable=>enabled, +e = Ttk::Checkbutton.new(checks, :text=>'Enabled', :variable=>enabled, :command=>proc{ - setState($ttkbut_demo, + setState($ttkbut_demo, ((enabled.bool)? "!disabled" : "disabled"), e) }) @@ -90,15 +90,15 @@ happyness = TkVariable.new -r1 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r1 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Great', :value=>'great') -r2 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r2 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Good', :value=>'good') -r3 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r3 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Ok', :value=>'ok') -r4 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r4 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Poor', :value=>'poor') -r5 = Ttk::Radiobutton.new(radios, :variable=>happyness, +r5 = Ttk::Radiobutton.new(radios, :variable=>happyness, :text=>'Awful', :value=>'awful') Tk.pack(r1, r2, r3, r4, r5, :fill=>:x, :padx=>3, :pady=>2) @@ -107,26 +107,26 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Variables', - :image=>$image['view'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Variables', + :image=>$image['view'], :compound=>:left, :command=>proc{ - showVars(base_frame, ['enabled', enabled], - ['cheese', cheese], ['tomato', tomato], - ['basil', basil], ['oregano', oregano], + showVars(base_frame, ['enabled', enabled], + ['cheese', cheese], ['tomato', tomato], + ['basil', basil], ['oregano', oregano], ['happyness', happyness]) - }), - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'ttkbut'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + }), + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'ttkbut'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $ttkbut_demo $ttkbut_demo = nil $showVarsWin[tmppath.path] = nil tmppath.destroy - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x, :expand=>true) Index: ext/tk/sample/demos-en/menu84.rb =================================================================== --- ext/tk/sample/demos-en/menu84.rb (revision 23917) +++ ext/tk/sample/demos-en/menu84.rb (working copy) @@ -4,7 +4,7 @@ # toplevel widget if defined?($menu84_demo) && $menu84_demo - $menu84_demo.destroy + $menu84_demo.destroy $menu84_demo = nil end @@ -36,9 +36,9 @@ menustatus = TkVariable.new(" ") TkFrame.new(base_frame) {|frame| - TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken', - 'bd'=>1, 'font'=>['Helvetica', '10'], - 'anchor'=>'w').pack('side'=>'left', 'padx'=>2, + TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken', + 'bd'=>1, 'font'=>['Helvetica', '10'], + 'anchor'=>'w').pack('side'=>'left', 'padx'=>2, 'expand'=>true, 'fill'=>'both') pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) } @@ -92,8 +92,8 @@ $menu84_frame.add('cascade', 'label'=>'Basic', 'menu'=>m, 'underline'=>0) add('command', 'label'=>'Long entry that does nothing') ['A','B','C','D','E','F','G'].each{|c| - add('command', 'label'=>"Print letter \"#{c}\"", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", + add('command', 'label'=>"Print letter \"#{c}\"", + 'underline'=>14, 'accelerator'=>"Meta+#{c}", 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } @@ -101,17 +101,17 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| $menu84_frame.add('cascade', 'label'=>'Cascades', 'menu'=>m, 'underline'=>0) - add('command', 'label'=>'Print hello', - 'command'=>proc{print "Hello\n"}, + add('command', 'label'=>'Print hello', + 'command'=>proc{print "Hello\n"}, 'accelerator'=>"#{modifier}+H", 'underline'=>6) $menu84_demo.bind("#{modifier}-h", proc{print "Hello\n"}) - add('command', 'label'=>'Print goodbye', - 'command'=>proc{print "Goodbye\n"}, + add('command', 'label'=>'Print goodbye', + 'command'=>proc{print "Goodbye\n"}, 'accelerator'=>"#{modifier}+G", 'underline'=>6) $menu84_demo.bind("#{modifier}-g", proc{print "Goodbye\n"}) TkMenu.new(m, 'tearoff'=>false) {|cascade_check| - m.add('cascade', 'label'=>'Check buttons', + m.add('cascade', 'label'=>'Check buttons', 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'Oil checked', 'variable'=>oil) @@ -122,18 +122,18 @@ lights = TkVariable.new(0) add('check', 'label'=>'Lights checked', 'variable'=>lights) add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['oil', oil], - ['trans', trans], - ['brakes', brakes], + add('command', 'label'=>'Show current values', + 'command'=>proc{showVars($menu84_demo, + ['oil', oil], + ['trans', trans], + ['brakes', brakes], ['lights', lights])} ) invoke 1 invoke 3 } TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| - m.add('cascade', 'label'=>'Radio buttons', + m.add('cascade', 'label'=>'Radio buttons', 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10) @@ -147,9 +147,9 @@ add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold') add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') add('separator') - add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['pointSize', pointSize], + add('command', 'label'=>'Show current values', + 'command'=>proc{showVars($menu84_demo, + ['pointSize', pointSize], ['style', style])} ) invoke 1 invoke 7 @@ -158,15 +158,15 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| $menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0) - add('command', 'hidemargin'=>1, + add('command', 'hidemargin'=>1, 'bitmap'=>'@'+[$demo_dir,'..', 'images','pattern.xbm'].join(File::Separator), - 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', + 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', 'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.', - 'bitmap'=>'', 'default'=>0, + 'bitmap'=>'', 'default'=>0, 'buttons'=>'Dismiss')} ) ['info', 'questhead', 'error'].each{|icon| - add('command', 'bitmap'=>icon, 'hidemargin'=>1, + add('command', 'bitmap'=>icon, 'hidemargin'=>1, 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) } @@ -177,19 +177,19 @@ $menu84_frame.add('cascade', 'label'=>'More', 'menu'=>m, 'underline'=>0) [ 'An entry','Another entry','Does nothing','Does almost nothing', 'Make life meaningful' ].each{|i| - add('command', 'label'=>i, + add('command', 'label'=>i, 'command'=>proc{print "You invoked \"#{i}\"\n"}) } - m.entryconfigure('Does almost nothing', - 'bitmap'=>'questhead', 'compound'=>'left', + m.entryconfigure('Does almost nothing', + 'bitmap'=>'questhead', 'compound'=>'left', 'command'=>proc{ - TkDialog.new('title'=>'Compound Menu Entry', + TkDialog.new('title'=>'Compound Menu Entry', 'message'=>'The menu entry you invoked'+ 'displays both a bitmap and '+ 'a text string. Other than '+ 'this, it isjust like any '+ - 'other menu entry.', + 'other menu entry.', 'buttons'=>['OK'], 'bitmap'=>'') }) } @@ -197,7 +197,7 @@ TkMenu.new($menu84_frame) {|m| $menu84_frame.add('cascade', 'label'=>'Colors', 'menu'=>m, 'underline'=>0) ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| - add('command', 'label'=>c, 'background'=>c, + add('command', 'label'=>c, 'background'=>c, 'command'=>proc{print "You invoked \"#{c}\"\n"}) } } Index: ext/tk/sample/demos-en/msgbox2.rb =================================================================== --- ext/tk/sample/demos-en/msgbox2.rb (revision 23917) +++ ext/tk/sample/demos-en/msgbox2.rb (working copy) @@ -7,7 +7,7 @@ # toplevel widget if defined?($msgbox2_demo) && $msgbox2_demo - $msgbox2_demo.destroy + $msgbox2_demo.destroy $msgbox2_demo = nil end @@ -49,9 +49,9 @@ # frame $msgbox_leftframe = TkFrame.new(base_frame) $msgbox_rightframe = TkFrame.new(base_frame) -$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', +$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') -$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', +$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') TkLabel.new($msgbox_leftframe, 'text'=>'Icon').pack('side'=>'top') @@ -60,9 +60,9 @@ $msgboxIcon = TkVariable.new('info') ['error', 'info', 'question', 'warning'].each {|icon| - TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, - 'relief'=>'flat', 'value'=>icon, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, + 'relief'=>'flat', 'value'=>icon, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') } @@ -71,21 +71,21 @@ .pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') $msgboxType = TkVariable.new('ok') -['abortretryignore', 'ok', 'okcancel', +['abortretryignore', 'ok', 'okcancel', 'retrycancel', 'yesno', 'yesnocancel'].each {|type| - TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, - 'relief'=>'flat', 'value'=>type, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, + 'relief'=>'flat', 'value'=>type, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') } def showMessageBox2(w) - button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, + button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, 'title'=>'Message', 'parent'=>w, 'message'=>"\"#{$msgboxType.value}\" Type MessageBox", 'detail'=>"This is a \"#{$msgboxType.value}\" type messagebox with the \"#{$msgboxIcon.value}\" icon. Please click one of the following button.") - Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, + Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, 'message'=>"You have selected \"#{button}\"") end Index: ext/tk/sample/demos-en/entry2.rb =================================================================== --- ext/tk/sample/demos-en/entry2.rb (revision 23917) +++ ext/tk/sample/demos-en/entry2.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($entry2_demo) && $entry2_demo - $entry2_demo.destroy + $entry2_demo.destroy $entry2_demo = nil end @@ -82,7 +82,7 @@ e3.pack('side'=>'top', 'fill'=>'x') s3.pack('side'=>'top', 'fill'=>'x') - # + # e1.insert(0, 'Initial value') e2.insert('end', "This entry contains a long value, much too long ") e2.insert('end', "to fit in the window at one time, so long in fact ") Index: ext/tk/sample/demos-en/goldberg.rb =================================================================== --- ext/tk/sample/demos-en/goldberg.rb (revision 23917) +++ ext/tk/sample/demos-en/goldberg.rb (working copy) @@ -43,7 +43,7 @@ #>># lots of canvas create and move calls. if defined?($goldberg_demo) && $goldberg_demo - $goldberg_demo.destroy + $goldberg_demo.destroy $goldberg_demo = nil end @@ -101,7 +101,7 @@ @S['pause'] = TkVariable.new @S['details'] = TkVariable.new(true) - @S['mode'] = TkVariable.new(:MSTART, :symbol) + @S['mode'] = TkVariable.new(:MSTART, :symbol) # :MSTART, :MGO, :MPAUSE, :MSSTEP, :MBSTEP, :MDONE, :MDEBUG # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 @@ -132,19 +132,19 @@ @XY = {} @XY6 = { - '-1'=>[366, 207], '-2'=>[349, 204], '-3'=>[359, 193], '-4'=>[375, 192], + '-1'=>[366, 207], '-2'=>[349, 204], '-3'=>[359, 193], '-4'=>[375, 192], '-5'=>[340, 190], '-6'=>[349, 177], '-7'=>[366, 177], '-8'=>[380, 176], - '-9'=>[332, 172], '-10'=>[342, 161], '-11'=>[357, 164], - '-12'=>[372, 163], '-13'=>[381, 149], '-14'=>[364, 151], - '-15'=>[349, 146], '-16'=>[333, 148], '0'=>[357, 219], - '1'=>[359, 261], '2'=>[359, 291], '3'=>[359, 318], '4'=>[361, 324], - '5'=>[365, 329], '6'=>[367, 334], '7'=>[367, 340], '8'=>[366, 346], - '9'=>[364, 350], '10'=>[361, 355], '11'=>[359, 370], '12'=>[359, 391], - '13,0'=>[360, 456], '13,1'=>[376, 456], '13,2'=>[346, 456], - '13,3'=>[330, 456], '13,4'=>[353, 444], '13,5'=>[368, 443], - '13,6'=>[339, 442], '13,7'=>[359, 431], '13,8'=>[380, 437], - '13,9'=>[345, 428], '13,10'=>[328, 434], '13,11'=>[373, 424], - '13,12'=>[331, 420], '13,13'=>[360, 417], '13,14'=>[345, 412], + '-9'=>[332, 172], '-10'=>[342, 161], '-11'=>[357, 164], + '-12'=>[372, 163], '-13'=>[381, 149], '-14'=>[364, 151], + '-15'=>[349, 146], '-16'=>[333, 148], '0'=>[357, 219], + '1'=>[359, 261], '2'=>[359, 291], '3'=>[359, 318], '4'=>[361, 324], + '5'=>[365, 329], '6'=>[367, 334], '7'=>[367, 340], '8'=>[366, 346], + '9'=>[364, 350], '10'=>[361, 355], '11'=>[359, 370], '12'=>[359, 391], + '13,0'=>[360, 456], '13,1'=>[376, 456], '13,2'=>[346, 456], + '13,3'=>[330, 456], '13,4'=>[353, 444], '13,5'=>[368, 443], + '13,6'=>[339, 442], '13,7'=>[359, 431], '13,8'=>[380, 437], + '13,9'=>[345, 428], '13,10'=>[328, 434], '13,11'=>[373, 424], + '13,12'=>[331, 420], '13,13'=>[360, 417], '13,14'=>[345, 412], '13,15'=>[376, 410], '13,16'=>[360, 403] } @@ -161,11 +161,11 @@ def do_display() @ctrl = TkFrame.new(@parent, :relief=>:ridge, :bd=>2, :padx=>5, :pady=>5) - @screen = TkFrame.new(@parent, :bd=>2, - :relief=>:raised).pack(:side=>:left, :fill=>:both, + @screen = TkFrame.new(@parent, :bd=>2, + :relief=>:raised).pack(:side=>:left, :fill=>:both, :expand=>true) - @canvas = TkCanvas.new(@parent, :width=>850, :height=>700, + @canvas = TkCanvas.new(@parent, :width=>850, :height=>700, :bg=>@C['bg'], :highlightthickness=>0){ scrollregion([0, 0, 1000, 1000]) # Kludge to move everything up yview_moveto(0.05) @@ -204,8 +204,8 @@ command proc{showCode 'goldberg'} }.pack('side'=>'left', 'padx'=>5) - # @show = TkButton.new(frame, :text=>'>>', :command=>proc{show_ctrl}, - @show = Tk::Button.new(frame, :text=>'>>', :command=>proc{show_ctrl}, + # @show = TkButton.new(frame, :text=>'>>', :command=>proc{show_ctrl}, + @show = Tk::Button.new(frame, :text=>'>>', :command=>proc{show_ctrl}, :bg=>@C['bg'], :activebackground=>@C['bg']) @show.pack('side'=>'left') frame.place(:in=>@canvas, :relx=>1, :rely=>0, :anchor=>:ne) @@ -214,34 +214,34 @@ end def do_ctrl_frame - @start = Tk::Button.new(@parent, :text=>'Start', :bd=>6, + @start = Tk::Button.new(@parent, :text=>'Start', :bd=>6, :command=>proc{do_button(0)}) if font = @start['font'] @start.font(font.weight('bold')) end - @pause = TkCheckbutton.new(@parent, :text=>'Pause', :font=>font, - :command=>proc{do_button(1)}, :relief=>:raised, + @pause = TkCheckbutton.new(@parent, :text=>'Pause', :font=>font, + :command=>proc{do_button(1)}, :relief=>:raised, :variable=>@S['pause']) - @step = TkButton.new(@parent, :text=>'Single Step', :font=>font, + @step = TkButton.new(@parent, :text=>'Single Step', :font=>font, :command=>proc{do_button(2)}) - @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font, + @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font, :command=>proc{do_button(4)}) - @reset = TkButton.new(@parent, :text=>'Reset', :font=>font, + @reset = TkButton.new(@parent, :text=>'Reset', :font=>font, :command=>proc{do_button(3)}) @details = TkFrame.new(@parent, :bd=>2, :relief=>:ridge) - @detail = TkCheckbutton.new(@parent, :text=>'Details', :font=>font, + @detail = TkCheckbutton.new(@parent, :text=>'Details', :font=>font, :relief=>:raised, :variable=>@S['details']) - @msg_entry = TkEntry.new(@parent, :textvariable=>@S['message'], + @msg_entry = TkEntry.new(@parent, :textvariable=>@S['message'], :justify=>:center) - @speed_scale = TkScale.new(@parent, :orient=>:horizontal, - :from=>1, :to=>10, :font=>font, - :variable=>@S['speed'], :bd=>2, + @speed_scale = TkScale.new(@parent, :orient=>:horizontal, + :from=>1, :to=>10, :font=>font, + :variable=>@S['speed'], :bd=>2, :relief=>:ridge, :showvalue=>false) - @about = TkButton.new(@parent, :text=>'About', + @about = TkButton.new(@parent, :text=>'About', :command=>proc{about}, :font=>font) Tk.grid(@start, :in=>@ctrl, :row=>0, :sticky=>:ew) @@ -269,17 +269,17 @@ def do_detail_frame @f_details = TkFrame.new(@details) - @label = TkLabel.new(@f_details, :textvariable=>@S['cnt'], + @label = TkLabel.new(@f_details, :textvariable=>@S['cnt'], :bd=>1, :relief=>:solid, :bg=>'white') Tk.grid(@label, '-', '-', '-', :sticky=>:ew, :row=>0) idx = 1 loop { break unless respond_to?("move#{idx}") - l = TkLabel.new(@f_details, :text=>idx, :anchor=>:e, + l = TkLabel.new(@f_details, :text=>idx, :anchor=>:e, :width=>2, :bd=>1, :relief=>:solid, :bg=>'white') @STEP[idx] = 0 - ll = TkLabel.new(@f_details, :textvariable=>@STEP.ref(idx), + ll = TkLabel.new(@f_details, :textvariable=>@STEP.ref(idx), :width=>5, :bd=>1, :relief=>:solid, :bg=>'white') row = (idx + 1)/2 col = ((idx + 1) & 1) * 2 @@ -383,7 +383,7 @@ who = who.to_i n = send("move#{who}") if (n & 1).nonzero? # This guy still alive - alive << who + alive << who end if (n & 2).nonzero? # Next guy is active alive << (who + 1) @@ -416,10 +416,10 @@ # START HERE! banner def draw0 color = @C['0'] - TkcText.new(@canvas, [579, 119], :text=>'START HERE!', - :fill=>color, :anchor=>:w, + TkcText.new(@canvas, [579, 119], :text=>'START HERE!', + :fill=>color, :anchor=>:w, :tag=>'I0', :font=>['Times Roman', 12, :italic, :bold]) - TkcLine.new(@canvas, [719, 119, 763, 119], :tag=>'I0', :fill=>color, + TkcLine.new(@canvas, [719, 119, 763, 119], :tag=>'I0', :fill=>color, :width=>5, :arrow=>:last, :arrowshape=>[18, 18, 5]) @canvas.itembind('I0', '1'){ start } end @@ -433,7 +433,7 @@ end pos = [ - [673, 119], [678, 119], [683, 119], [688, 119], + [673, 119], [678, 119], [683, 119], [688, 119], [693, 119], [688, 119], [683, 119], [678, 119] ] step = step % pos.length @@ -445,15 +445,15 @@ def draw1 color = @C['1a'] color2 = @C['1b'] - TkcPolygon.new(@canvas, - [ 844, 133, 800, 133, 800, 346, 820, 346, - 820, 168, 844, 168, 844, 133 ], + TkcPolygon.new(@canvas, + [ 844, 133, 800, 133, 800, 346, 820, 346, + 820, 168, 844, 168, 844, 133 ], :width=>3, :fill=>color, :outline=>'') - TkcPolygon.new(@canvas, - [ 771, 133, 685, 133, 685, 168, 751, 168, - 751, 346, 771, 346, 771, 133 ], + TkcPolygon.new(@canvas, + [ 771, 133, 685, 133, 685, 168, 751, 168, + 751, 346, 771, 346, 771, 133 ], :width=>3, :fill=>color, :outline=>'') - TkcOval.new(@canvas, box(812, 122, 9), + TkcOval.new(@canvas, box(812, 122, 9), :tag=>'I1', :fill=>color2, :outline=>'') @canvas.itembind('I1', '1'){ start } @@ -462,9 +462,9 @@ def move1(step = nil) step = get_step(1, step) pos = [ - [807, 122], [802, 122], [797, 123], [793, 124], [789, 129], [785, 153], - [785, 203], [785, 278, :x], [785, 367], [810, 392], [816, 438], - [821, 503], [824, 585, :y], [838, 587], [848, 593], [857, 601], + [807, 122], [802, 122], [797, 123], [793, 124], [789, 129], [785, 153], + [785, 203], [785, 278, :x], [785, 367], [810, 392], [816, 438], + [821, 503], [824, 585, :y], [838, 587], [848, 593], [857, 601], [-100, -100] ] return 0 if step >= pos.length @@ -480,40 +480,40 @@ color = @C['2'] # Fulcrum - TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392], + TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392], :fill=>@C['fg'], :outline=>@C['fg']) # Strike box - TkcRectangle.new(@canvas, [628, 335, 660, 383], + TkcRectangle.new(@canvas, [628, 335, 660, 383], :fill=>'', :outline=>@C['fg']) (0..2).each{|y| yy = 335 + y*16 - TkcBitmap.new(@canvas, [628, yy], :bitmap=>'gray25', + TkcBitmap.new(@canvas, [628, yy], :bitmap=>'gray25', :anchor=>:nw, :foreground=>@C['fg']) - TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25', + TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25', :anchor=>:nw, :foreground=>@C['fg']) } # Lever - TkcLine.new(@canvas, [702, 366, 798, 366], + TkcLine.new(@canvas, [702, 366, 798, 366], :fill=>@C['fg'], :width=>6, :tag=>'I2_0') # R strap - TkcLine.new(@canvas, [712, 363, 712, 355], + TkcLine.new(@canvas, [712, 363, 712, 355], :fill=>@C['fg'], :width=>3, :tag=>'I2_1') # L strap - TkcLine.new(@canvas, [705, 363, 705, 355], + TkcLine.new(@canvas, [705, 363, 705, 355], :fill=>@C['fg'], :width=>3, :tag=>'I2_2') # Match stick - TkcLine.new(@canvas, [679, 356, 679, 360, 717, 360, 717, 356, 679, 356], + TkcLine.new(@canvas, [679, 356, 679, 360, 717, 360, 717, 356, 679, 356], :fill=>@C['fg'], :width=>3, :tag=>'I2_3') # Match head - TkcPolygon.new(@canvas, - [ 671, 352, 677.4, 353.9, 680, 358.5, 677.4, 363.1, - 671, 365, 664.6, 363.1, 662, 358.5, 664.6, 353.9 ], + TkcPolygon.new(@canvas, + [ 671, 352, 677.4, 353.9, 680, 358.5, 677.4, 363.1, + 671, 365, 664.6, 363.1, 662, 358.5, 664.6, 353.9 ], :fill=>color, :outline=>color, :tag=>'I2_4') end @@ -523,15 +523,15 @@ stages = [0, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1] xy = [] xy[0] = [ - 686, 333, 692, 323, 682, 316, 674, 309, 671, 295, 668, 307, + 686, 333, 692, 323, 682, 316, 674, 309, 671, 295, 668, 307, 662, 318, 662, 328, 671, 336 ] xy[1] = [ - 687, 331, 698, 322, 703, 295, 680, 320, 668, 297, 663, 311, + 687, 331, 698, 322, 703, 295, 680, 320, 668, 297, 663, 311, 661, 327, 671, 335 ] xy[2] = [ - 686, 331, 704, 322, 688, 300, 678, 283, 678, 283, 674, 298, + 686, 331, 704, 322, 688, 300, 678, 283, 678, 283, 674, 298, 666, 309, 660, 324, 672, 336 ] @@ -542,7 +542,7 @@ if step == 0 # Rotate the match beta = 20 - + ox, oy = anchor('I2_0', :s) # Where to pivot i = 0 @@ -567,23 +567,23 @@ xy = [ [602, 296], [577, 174], [518, 174] ] xy.each{|x, y| # 3 Pulleys - TkcOval.new(@canvas, box(x, y, 13), + TkcOval.new(@canvas, box(x, y, 13), :fill=>color, :outline=>@C['fg'], :width=>3) TkcOval.new(@canvas, box(x, y, 2), :fill=>@C['fg'], :outline=>@C['fg']) } # Wall to flame - TkcLine.new(@canvas, [750, 309, 670, 309], :tag=>'I3_s', + TkcLine.new(@canvas, [750, 309, 670, 309], :tag=>'I3_s', :width=>3, :fill=>@C['fg'], :smooth=>true) # Flame to pulley 1 - TkcLine.new(@canvas, [670, 309, 650, 309], :tag=>'I3_0', + TkcLine.new(@canvas, [670, 309, 650, 309], :tag=>'I3_0', :width=>3, :fill=>@C['fg'], :smooth=>true) - TkcLine.new(@canvas, [650, 309, 600, 309], :tag=>'I3_1', + TkcLine.new(@canvas, [650, 309, 600, 309], :tag=>'I3_1', :width=>3, :fill=>@C['fg'], :smooth=>true) # Pulley 1 half way to 2 - TkcLine.new(@canvas, [589, 296, 589, 235], :tag=>'I3_2', + TkcLine.new(@canvas, [589, 296, 589, 235], :tag=>'I3_2', :width=>3, :fill=>@C['fg']) # Pulley 1 other half to 2 @@ -593,26 +593,26 @@ TkcLine.new(@canvas, [577, 161, 518, 161], :width=>3, :fill=>@C['fg']) # Down to weight - TkcLine.new(@canvas, [505, 174, 505, 205], :tag=>'I3_w', + TkcLine.new(@canvas, [505, 174, 505, 205], :tag=>'I3_w', :width=>3, :fill=>@C['fg']) # Draw the weight as 2 circles, two rectangles and 1 rounded rectangle x1, y1, x2, y2 = [515, 207, 495, 207] - TkcOval.new(@canvas, box(x1, y1, 6), + TkcOval.new(@canvas, box(x1, y1, 6), :tag=>'I3_', :fill=>color2, :outline=>color2) - TkcOval.new(@canvas, box(x2, y2, 6), + TkcOval.new(@canvas, box(x2, y2, 6), :tag=>'I3_', :fill=>color2, :outline=>color2) - TkcRectangle.new(@canvas, x1, y1 - 6, x2, y2 + 6, + TkcRectangle.new(@canvas, x1, y1 - 6, x2, y2 + 6, :tag=>'I3_', :fill=>color2, :outline=>color2) - - TkcPolygon.new(@canvas, round_rect([492, 220, 518, 263], 15), + + TkcPolygon.new(@canvas, round_rect([492, 220, 518, 263], 15), :smooth=>true, :tag=>'I3_', :fill=>color2, :outline=>color2) - TkcLine.new(@canvas, [500, 217, 511, 217], + TkcLine.new(@canvas, [500, 217, 511, 217], :tag=>'I3_', :fill=>color2, :width=>10) # Bottom weight target - TkcLine.new(@canvas, [502, 393, 522, 393, 522, 465], + TkcLine.new(@canvas, [502, 393, 522, 393, 522, 465], :tag=>'I3__', :fill=>@C['fg'], :joinstyle=>:miter, :width=>10) end @@ -655,7 +655,7 @@ } # Swing gate - TkcLine.new(@canvas, [518, 464, 518, 428], + TkcLine.new(@canvas, [518, 464, 518, 428], :tag=>'I4', :fill=>color, :width=>1) end @@ -682,7 +682,7 @@ TkcPolygon.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'], :width=>3) xy = [ - 534.5, 445.5, 541, 440, 552, 436, 560, 436, 569, 440, 574, 446, + 534.5, 445.5, 541, 440, 552, 436, 560, 436, 569, 440, 574, 446, 575, 452, 574, 454, 566, 456, 554, 456, 545, 456, 537, 454, 530, 452 ] TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_0'], :fill=>color) @@ -692,7 +692,7 @@ xy = box(540, 446, 2) # Eye xy = [540, 444, 541, 445, 541, 447, 540, 448, 538, 447, 538, 445] - TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_2'], :fill=>@C['bg'], + TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_2'], :fill=>@C['bg'], :outline=>'', :smooth=>true) xy = [538, 454, 535, 461] # Front leg @@ -712,9 +712,9 @@ step = get_step(5, step) pos = [ - [553, 452], [533, 452], [513, 452], [493, 452], [473, 452], - [463, 442, 30], [445.5, 441.5, 30], [425.5, 434.5, 30], [422, 414], - [422, 394], [422, 374], [422, 354], [422, 334], [422, 314], [422, 294], + [553, 452], [533, 452], [513, 452], [493, 452], [473, 452], + [463, 442, 30], [445.5, 441.5, 30], [425.5, 434.5, 30], [422, 414], + [422, 394], [422, 374], [422, 354], [422, 334], [422, 314], [422, 294], [422, 274, -30], [422, 260.5, -30, :x], [422.5, 248.5, -28], [425, 237] ] @@ -735,16 +735,16 @@ color = @C['6'] xy = [324, 130, 391, 204] # Ball holder xy = round_rect(xy, 10) - TkcPolygon.new(@canvas, xy, :smooth=>true, + TkcPolygon.new(@canvas, xy, :smooth=>true, :outline=>@C['fg'], :width=>3, :fill=>color) xy = [339, 204, 376, 253] # Below the ball holder - TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>3, + TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>color, :tag=>'I6c') xy = box(346, 339, 28) TkcOval.new(@canvas, xy, :fill=>color, :outline=>'') # Roter - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc, :start=>80, :extent=>205) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc, :start=>-41, :extent=>85) xy = box(346, 339, 15) # Center of rotor @@ -759,10 +759,10 @@ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'') xy = [ - 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403, + 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403, 352, 403, 352, 366 ] - TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', + TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2) # Below rotor TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2) xy = box(275, 342, 7) # On/off rotor @@ -787,7 +787,7 @@ loc = -i color = colors[i] x, y = @XY6["#{loc}"] - TkcOval.new(@canvas, box(x, y, 5), + TkcOval.new(@canvas, box(x, y, 5), :fill=>color, :outline=>color, :tag=>"I6_b#{i}") } draw6a(12) # The wheel @@ -813,7 +813,7 @@ @canvas.move('I6_', -7, 0) if step == 1 # Poke a hole xy = [348, 226, 365, 240] - TkcRectangle.new(@canvas, xy, :fill=>@canvas.itemcget('I6c', :fill), + TkcRectangle.new(@canvas, xy, :fill=>@canvas.itemcget('I6c', :fill), :outline=>'') end return 1 @@ -853,24 +853,24 @@ def draw7 color = @C['7'] xy = [198, 306, 277, 374] # Box - TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>2, + TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :fill=>color, :tag=>'I7z') @canvas.lower('I7z') xy = [275, 343, 230, 349] - TkcLine.new(@canvas, xy, :tag=>'I7', :fill=>@C['fg'], :arrow=>:last, + TkcLine.new(@canvas, xy, :tag=>'I7', :fill=>@C['fg'], :arrow=>:last, :arrowshape=>[23, 23, 8], :width=>6) xy = [225, 324] # On button x, y = xy TkcOval.new(@canvas, box(x, y, 3), :fill=>@C['fg'], :outline=>@C['fg']) xy = [218, 323] # On text font = ['Times Roman', 8] - TkcText.new(@canvas, xy, :text=>'on', :anchor=>:e, + TkcText.new(@canvas, xy, :text=>'on', :anchor=>:e, :fill=>@C['fg'], :font=>font) xy = [225, 350] # Off button x, y = xy TkcOval.new(@canvas, box(x, y, 3), :fill=>@C['fg'], :outline=>@C['fg']) xy = [218, 349] # Off text - TkcText.new(@canvas, xy, :text=>'off', :anchor=>:e, + TkcText.new(@canvas, xy, :text=>'off', :anchor=>:e, :fill=>@C['fg'], :font=>font) end @@ -915,7 +915,7 @@ xy = [280, 209, 296, 248] TkcOval.new(@canvas, xy, :outline=>color, :fill=>color) xy = [ - 288, 249, 252, 249, 260, 240, 280, 234, + 288, 249, 252, 249, 260, 240, 280, 234, 296, 234, 316, 240, 324, 249, 288, 249 ] TkcPolygon.new(@canvas, xy, :fill=>color, :smooth=>true) @@ -924,16 +924,16 @@ TkcPolygon.new(@canvas, xy, :fill=>color) xy = [255, 206, 265, 234] # Fan blades - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>3, :tag=>'I9_0') xy = [255, 176, 265, 204] - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>3, :tag=>'I9_0') xy = [255, 206, 265, 220] - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>1, :tag=>'I9_1') xy = [255, 190, 265, 204] - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>1, :tag=>'I9_1') end @@ -958,17 +958,17 @@ color = @C['10a'] color2 = @C['10b'] xy = [191, 230, 233, 230, 233, 178, 191, 178] # Sail - TkcPolygon.new(@canvas, xy, :fill=>color, :width=>3, :outline=>@C['fg'], + TkcPolygon.new(@canvas, xy, :fill=>color, :width=>3, :outline=>@C['fg'], :tag=>'I10') xy = box(209, 204, 31) # Front - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :style=>:pie, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :style=>:pie, :start=>120, :extent=>120, :tag=>'I10') - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>120, :extent=>120, :tag=>'I10') xy = box(249, 204, 31) # Back - TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>3, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>3, :style=>:pie, :start=>120, :extent=>120, :tag=>'I10') - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>120, :extent=>120, :tag=>'I10') xy = [200, 171, 200, 249] # Mast @@ -988,10 +988,10 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3) xy = box(239, 262, 17) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>95, :extent=>103) xy = box(76, 266, 21) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :extent=>190) end @@ -999,9 +999,9 @@ step = get_step(10, step) pos = [ - [195, 212], [193, 212], [190, 212], [186, 212], [181, 212], [176, 212], - [171, 212], [166, 212], [161, 212], [156, 212], [151, 212], [147, 212], - [142, 212], [137, 212], [132, 212, :x], [127, 212], [121, 212], + [195, 212], [193, 212], [190, 212], [186, 212], [181, 212], [176, 212], + [171, 212], [166, 212], [161, 212], [156, 212], [151, 212], [147, 212], + [142, 212], [137, 212], [132, 212, :x], [127, 212], [121, 212], [116, 212], [111, 212] ] @@ -1028,21 +1028,21 @@ xy = [55, 504, 55, 591] # Bottom right side TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3) xy = box(71, 460, 48) # Outer loop - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>110, :extent=>-290, :tag=>'I11i') xy = box(71, 460, 16) # Inner loop - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>'', + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>'', :width=>3, :tag=>'I11i') TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>@C['bg'], :width=>3) xy = [23, 264, 23, 591] # Left side TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3) xy = box(1, 266, 23) # Top left curve - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :extent=>90) xy = box(75, 235, 9) # The ball - TkcOval.new(@canvas, xy, :fill=>color2, :outline=>'', + TkcOval.new(@canvas, xy, :fill=>color2, :outline=>'', :width=>3, :tag=>'I11') end @@ -1050,8 +1050,8 @@ step = get_step(11, step) pos = [ - [75, 235], [70, 235], [65, 237], [56, 240], [46, 247], [38, 266], - [38, 296], [38, 333], [38, 399], [38, 475], [74, 496], [105, 472], + [75, 235], [70, 235], [65, 237], [56, 240], [46, 247], [38, 266], + [38, 296], [38, 333], [38, 399], [38, 475], [74, 496], [105, 472], [100, 437], [65, 423], [-100, -100], [38, 505], [38, 527, :x], [38, 591] ] @@ -1065,11 +1065,11 @@ # Hand def draw12 xy = [ - 20, 637, 20, 617, 20, 610, 20, 590, 40, 590, 40, 590, + 20, 637, 20, 617, 20, 610, 20, 590, 40, 590, 40, 590, 60, 590, 60, 610, 60, 610 ] xy.concat([60, 610, 65, 620, 60, 631]) # Thumb - xy.concat([60, 631, 60, 637, 60, 662, 60, 669, 52, 669, + xy.concat([60, 631, 60, 637, 60, 662, 60, 669, 52, 669, 56, 669, 50, 669, 50, 662, 50, 637]) y0 = 637 # Bumps for fingers @@ -1079,7 +1079,7 @@ x2 = x - 10 xy << x << y0 << x1 << y1 << x2 << y0 } - TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'], + TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'], :smooth=>true, :tag=>'I12', :width=>3) end @@ -1103,25 +1103,25 @@ ] radii = [2, 9, 9, 8, 5, 5, 2] - round_poly(@canvas, xy, radii, :width=>3, + round_poly(@canvas, xy, radii, :width=>3, :outline=>@C['fg'], :fill=>color) - round_poly(@canvas, xy2, radii, :width=>3, + round_poly(@canvas, xy2, radii, :width=>3, :outline=>@C['fg'], :fill=>color) xy = [56, 677] x, y = xy - TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'], + TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'], :width=>3, :tag=>'I13') xy = [809, 677] x, y = xy - TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'], + TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'], :width=>3, :tag=>'I13R') xy = [112, 687] # Label - TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'], + TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'], :font=>['Times Roman', 12, :bold]) xy = [762, 687] - TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'], + TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'], :font=>['Times Roman', 12, :bold]) xy = [138, 663, 148, 636, 178, 636] # Paper guide @@ -1129,7 +1129,7 @@ xy = [732, 663, 722, 636, 692, 636] TkcLine.new(@canvas, xy, :smooth=>true, :fill=>@C['fg'], :width=>3) - sine([149, 688, 720, 688], 5, 15, + sine([149, 688, 720, 688], 5, 15, :tag=>'I13_s', :fill=>@C['fg'], :width=>3) end @@ -1159,17 +1159,17 @@ def draw14 color = @C['14'] xy = [102, 661, 113, 632, 130, 618] # Left paper edge - TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, + TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, :width=>3, :tag=>'I14L_0') xy = [148, 629, 125, 640, 124, 662] # Right paper edge - TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, + TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, :width=>3, :tag=>'I14L_1') draw14a('L') xy = [ 768.0, 662.5, 767.991316225, 662.433786215, 767.926187912, 662.396880171 ] - TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, + TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, :width=>3, :tag=>'I14R_0') @canvas.lower('I14R_0') # NB. these numbers are VERY sensitive, you must start with final size @@ -1177,7 +1177,7 @@ xy = [ 745.947897349, 662.428358855, 745.997829056, 662.452239237, 746.0, 662.5 ] - TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, + TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color, :width=>3, :tag=>'I14R_1') @canvas.lower('I14R_1') end @@ -1190,11 +1190,11 @@ x3, y3, x4, y4, x5, y5 = xy2 zz = [ - x0, y0, x0, y0, xy, x2, y2, x2, y2, + x0, y0, x0, y0, xy, x2, y2, x2, y2, x3, y3, x3, y3, xy2, x5, y5, x5, y5 ].flatten @canvas.delete("I14#{side}") - TkcPolygon.new(@canvas, zz, :tag=>"I14#{side}", :smooth=>true, + TkcPolygon.new(@canvas, zz, :tag=>"I14#{side}", :smooth=>true, :fill=>color, :outline=>color, :width=>3) @canvas.lower("I14#{side}") end @@ -1247,7 +1247,7 @@ xy = [765, 557, 784, 583] TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2) - sine([658, 580, 765, 580], 3, 15, + sine([658, 580, 765, 580], 3, 15, :tag=>'I15_s', :fill=>@C['fg'], :width=>3) end @@ -1286,7 +1286,7 @@ xy = [722, 485, 791, 556] TkcRectangle.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>3) xy = box(752, 515, 25) # Bell - TkcOval.new(@canvas, xy, :fill=>color, :outline=>'black', + TkcOval.new(@canvas, xy, :fill=>color, :outline=>'black', :tag=>'I16b', :width=>2) xy = box(752, 515, 5) # Bell button TkcOval.new(@canvas, xy, :fill=>'black', :outline=>'black', :tag=>'I16b') @@ -1325,24 +1325,24 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3) xy = [664, 523, 717, 549] # Body - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3, :style=>:chord, :start=>128, :extent=>260, :tag=>'I17') xy = [709, 554, 690, 543] # Paw - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3, :tag=>'I17') xy = [657, 544, 676, 555] - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3, :tag=>'I17') xy = box(660, 535, 15) # Lower face - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc, :start=>150, :extent=>240, :tag=>'I17_') - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, :style=>:chord, :start=>150, :extent=>240, :tag=>'I17_') xy = [674, 529, 670, 513, 662, 521, 658, 521, 650, 513, 647, 529] # Ears TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') - TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', :width=>1, + TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', :width=>1, :tag=>['I17_', 'I17_c']) xy = [652, 542, 628, 539] # Whiskers TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') @@ -1352,23 +1352,23 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') xy = [668, 543, 687, 538] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>['I17_', 'I17_w']) xy = [668, 544, 688, 546] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>['I17_', 'I17_w']) xy = [668, 547, 688, 553] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>['I17_', 'I17_w']) xy = [649, 530, 654, 538, 659, 530] # Left eye - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :smooth=>true, :tag=>'I17') xy = [671, 530, 666, 538, 661, 530] # Right eye - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :smooth=>true, :tag=>'I17') xy = [655, 543, 660, 551, 665, 543] # Mouth - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :smooth=>true, :tag=>'I17') end @@ -1381,10 +1381,10 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :smooth=>true, :tag=>'I17_') xy = box(654, 530, 4) # Left eye - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'', + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'', :tag=>'I17_') xy = box(666, 530, 4) # Right eye - TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'', + TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'', :tag=>'I17_') @canvas.move('I17_', 0, -20) # Move face up @@ -1394,19 +1394,19 @@ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') xy = [ # Body - 675, 506, 694, 489, 715, 513, 715, 513, 715, 513, 716, 525, - 716, 525, 716, 525, 706, 530, 695, 530, 679, 535, 668, 527, + 675, 506, 694, 489, 715, 513, 715, 513, 715, 513, 716, 525, + 716, 525, 716, 525, 706, 530, 695, 530, 679, 535, 668, 527, 668, 527, 668, 527, 675, 522, 676, 517, 677, 512 ] - TkcPolygon.new(@canvas, xy, :fill=>@canvas.itemcget('I17_c', :fill), - :outline=>@C['fg'], :width=>3, :smooth=>true, + TkcPolygon.new(@canvas, xy, :fill=>@canvas.itemcget('I17_c', :fill), + :outline=>@C['fg'], :width=>3, :smooth=>true, :tag=>'I17_') xy = [716, 514, 716, 554] # Back leg TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') xy = [694, 532, 694, 554] # 2nd back leg TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_') xy = [715, 514, 718, 506, 719, 495, 716, 488] # Tail - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :smooth=>true, :tag=>'I17_') @canvas.raise('I17w') # Make whiskers visible @@ -1435,14 +1435,14 @@ step = get_step(18, step) pos = [ - [587, 506], [537, 506], [466, 506], [376, 506], [266, 506, :x], + [587, 506], [537, 506], [466, 506], [376, 506], [266, 506, :x], [136, 506], [16, 506], [-100, -100] ] b = [] b[0] = [490, 502, 719, 507, 524, 512] # Band collapsing b[1] = [ - 491, 503, 524, 557, 563, 505, 559, 496, 546, 506, 551, 525, + 491, 503, 524, 557, 563, 505, 559, 496, 546, 506, 551, 525, 553, 536, 538, 534, 532, 519, 529, 499 ] b[2] = [ @@ -1473,54 +1473,54 @@ color = @C['19'] xx = [[249, 181], [155, 118], [86, 55], [22, 0]] xx.each{|x1, x2| - TkcRectangle.new(@canvas, x1, 453, x2, 467, + TkcRectangle.new(@canvas, x1, 453, x2, 467, :fill=>color, :outline=>'', :tag=>'I19') - TkcLine.new(@canvas, x1, 453, x2, 453, + TkcLine.new(@canvas, x1, 453, x2, 453, :fill=>@C['fg'], :width=>1) # Pipe top - TkcLine.new(@canvas, x1, 467, x2, 467, + TkcLine.new(@canvas, x1, 467, x2, 467, :fill=>@C['fg'], :width=>1) # Pipe bottom } @canvas.raise('I11i') xy = box(168, 460, 16) # Bulge by the joint TkcOval.new(@canvas, xy, :fill=>color, :outline=>'') - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>21, :extent=>136) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>-21, :extent=>-130) xy = [249, 447, 255, 473] # First joint 26x6 TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1) xy = box(257, 433, 34) # Bend up - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, :style=>:pie, :start=>0, :extent=>-91) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>0, :extent=>-90) xy = box(257, 433, 20) - TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, :style=>:pie, :start=>0, :extent=>-92) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>0, :extent=>-90) xy = box(257, 421, 34) # Bend left - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, :style=>:pie, :start=>0, :extent=>91) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>0, :extent=>90) xy = box(257, 421, 20) - TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, :style=>:pie, :start=>0, :extent=>90) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>0, :extent=>90) xy = box(243, 421, 34) # Bend down - TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1, :style=>:pie, :start=>90, :extent=>90) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>90, :extent=>90) xy = box(243, 421, 20) - TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1, :style=>:pie, :start=>90, :extent=>90) - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc, :start=>90, :extent=>90) xy = [270, 427, 296, 433] # 2nd joint bottom @@ -1562,7 +1562,7 @@ pos = [451, 462, 473, 484, 496, 504, 513, 523, 532] freq = [20, 40, 40, 40, 40, 40, 40, 40, 40] pos = [ - [451, 20], [462, 40], [473, 40], [484, 40], [496, 40], + [451, 20], [462, 40], [473, 40], [484, 40], [496, 40], [504, 40], [513, 40], [523, 40], [532, 40, :x] ] return 0 if step >= pos.length @@ -1579,11 +1579,11 @@ color = @C['20'] @canvas.delete('I20') - sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'], + sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'], :width=>3, :fill=>color, :smooth=>true) - TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3, + TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3, :fill=>color, :smooth=>1, :tag=>['I20', 'I20a']) - TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3, + TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3, :fill=>color, :smooth=>1, :tag=>['I20', 'I20b']) @canvas.move('I20a', 8, 0) @canvas.move('I20b', 16, 0) @@ -1599,18 +1599,18 @@ xy = [245, 490, 237, 535] # Right side xy2 = [189, 535, 181, 490] # Left side - TkcPolygon.new(@canvas, xy + xy2, :fill=>color, :outline=>'', + TkcPolygon.new(@canvas, xy + xy2, :fill=>color, :outline=>'', :tag=>['I21', 'I21f']) TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :tag=>'I21') TkcLine.new(@canvas, xy2, :fill=>@C['fg'], :width=>2, :tag=>'I21') xy = [182, 486, 244, 498] # Top - TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2, + TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2, :tag=>['I21', 'I21f']) - TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>2, + TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>2, :tag=>['I21', 'I21t']) xy = [189, 532, 237, 540] # Bottom - TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2, + TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2, :tag=>['I21', 'I21b']) end @@ -1633,7 +1633,7 @@ @canvas.itemconfigure('I21b', :fill=>@C['20']) @canvas.delete('I21w') - TkcPolygon.new(@canvas, x2, y2, x1, y1, xx1, yy1, xx2, yy1, + TkcPolygon.new(@canvas, x2, y2, x1, y1, xx1, yy1, xx2, yy1, :tag=>['I21', 'I21w'], :outline=>'', :fill=>@C['20']) @canvas.lower('I21w', 'I21') @canvas.raise('I21b') @@ -1669,21 +1669,21 @@ color3 = @C['23c'] xy = [185, 623, 253, 650] # Block - TkcRectangle.new(@canvas, xy, :fill=>'black', :outline=>@C['fg'], + TkcRectangle.new(@canvas, xy, :fill=>'black', :outline=>@C['fg'], :width=>2, :tag=>'I23a') xy = [187, 592, 241, 623] # Balloon TkcOval.new(@canvas, xy, :outline=>'', :fill=>color, :tag=>'I23b') - TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :tag=>'I23b', + TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :tag=>'I23b', :style=>:arc, :start=>12, :extent=>336) xy = [239, 604, 258, 589, 258, 625, 239, 610] # Balloon nozzle TkcPolygon.new(@canvas, xy, :outline=>'', :fill=>color, :tag=>'I23b') TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23b') xy = [285, 611, 250, 603] # Dart body - TkcOval.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'], :width=>3, :tag=>'I23d') xy = [249, 596, 249, 618, 264, 607, 249, 596] # Dart tail - TkcPolygon.new(@canvas, xy, :fill=>color3, :outline=>@C['fg'], + TkcPolygon.new(@canvas, xy, :fill=>color3, :outline=>@C['fg'], :width=>3, :tag=>'I23d') xy = [249, 607, 268, 607] # Dart detail TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23d') @@ -1695,7 +1695,7 @@ step = get_step(23, step) pos = [ - [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607], + [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607], [487, 607], [587, 607], [687, 607], [787, 607], [-100, -100] ] @@ -1715,7 +1715,7 @@ def draw24 color = @C['24a'] xy = [366, 518, 462, 665] # Balloon - TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], + TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3, :tag=>'I24') xy = [414, 666, 414, 729] # String TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I24') @@ -1724,16 +1724,16 @@ :width=>3, :tag=>'I24') xy = [387, 567, 390, 549, 404, 542] # Reflections - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, :width=>2, :tag=>'I24') xy = [395, 568, 399, 554, 413, 547] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, :width=>2, :tag=>'I24') xy = [403, 570, 396, 555, 381, 553] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, :width=>2, :tag=>'I24') xy = [408, 564, 402, 547, 386, 545] - TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, + TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true, :width=>2, :tag=>'I24') end @@ -1746,16 +1746,16 @@ if step == 0 @canvas.delete('I24') # Exploding balloon xy = [ - 347, 465, 361, 557, 271, 503, 272, 503, 342, 574, 259, 594, - 259, 593, 362, 626, 320, 737, 320, 740, 398, 691, 436, 738, - 436, 739, 476, 679, 528, 701, 527, 702, 494, 627, 548, 613, - 548, 613, 480, 574, 577, 473, 577, 473, 474, 538, 445, 508, + 347, 465, 361, 557, 271, 503, 272, 503, 342, 574, 259, 594, + 259, 593, 362, 626, 320, 737, 320, 740, 398, 691, 436, 738, + 436, 739, 476, 679, 528, 701, 527, 702, 494, 627, 548, 613, + 548, 613, 480, 574, 577, 473, 577, 473, 474, 538, 445, 508, 431, 441, 431, 440, 400, 502, 347, 465, 347, 465 ] - TkcPolygon.new(@canvas, xy, :tag=>'I24', :fill=>@C['24b'], + TkcPolygon.new(@canvas, xy, :tag=>'I24', :fill=>@C['24b'], :outline=>@C['24a'], :width=>10, :smooth=>true) msg = Tk.subst(@S['message'].value) - TkcText.new(@canvas, centroid('I24'), :text=>msg, :tag=>['I24', 'I24t'], + TkcText.new(@canvas, centroid('I24'), :text=>msg, :tag=>['I24', 'I24t'], :justify=>:center, :font=>['Times Roman', 18, :bold]) return 1 end @@ -1786,8 +1786,8 @@ if step >= 3 @canvas.delete('I24', 'I26') - TkcText.new(@canvas, 430, 740, :anchor=>:s, :tag=>'I26', - :text=>'click to continue', + TkcText.new(@canvas, 430, 740, :anchor=>:s, :tag=>'I26', + :text=>'click to continue', :font=>['Times Roman', 24, :bold]) @canvas.bind('1', proc{reset}) return 4 @@ -1967,11 +1967,11 @@ def sparkle(oxy, tag) xy = [ - [299, 283], [298, 302], [295, 314], [271, 331], + [299, 283], [298, 302], [295, 314], [271, 331], [239, 310], [242, 292], [256, 274], [281, 273] ] xy.each{|x, y| - TkcLine.new(@canvas, 271, 304, x, y, + TkcLine.new(@canvas, 271, 304, x, y, :fill=>'white', :width=>3, :tag=>tag) } move_abs(tag, oxy) Index: ext/tk/sample/demos-en/filebox.rb =================================================================== --- ext/tk/sample/demos-en/filebox.rb (revision 23917) +++ ext/tk/sample/demos-en/filebox.rb (working copy) @@ -6,7 +6,7 @@ # toplevel widget if defined?($filebox_demo) && $filebox_demo - $filebox_demo.destroy + $filebox_demo.destroy $filebox_demo = nil end @@ -49,7 +49,7 @@ TkEntry.new(f, 'width'=>20) {|e| pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x') - TkButton.new(f, 'text'=>'Browse ...', + TkButton.new(f, 'text'=>'Browse ...', 'command'=>proc{fileDialog base_frame,e,type})\ .pack('side'=>'left') } @@ -60,9 +60,9 @@ $tk_strictMotif = TkVarAccess.new('tk_strictMotif') if ($tk_platform['platform'] == 'unix') - TkCheckButton.new(base_frame, - 'text'=>'Use Motif Style Dialog', - 'variable'=>$tk_strictMotif, + TkCheckButton.new(base_frame, + 'text'=>'Use Motif Style Dialog', + 'variable'=>$tk_strictMotif, 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c') end @@ -71,23 +71,23 @@ # #-------------------------------------------------------- types = [ - ['Text files', ['.txt','.doc'] ], - ['Text files', [], 'TEXT' ], - ['Ruby Scripts', ['.rb'], 'TEXT' ], - ['Tcl Scripts', ['.tcl'], 'TEXT' ], - ['C Source Files', ['.c','.h'] ], - ['All Source Files', ['.rb','.tcl','.c','.h'] ], - ['Image Files', ['.gif'] ], - ['Image Files', ['.jpeg','.jpg'] ], - ['Image Files', [], ['GIFF','JPEG']], + ['Text files', ['.txt','.doc'] ], + ['Text files', [], 'TEXT' ], + ['Ruby Scripts', ['.rb'], 'TEXT' ], + ['Tcl Scripts', ['.tcl'], 'TEXT' ], + ['C Source Files', ['.c','.h'] ], + ['All Source Files', ['.rb','.tcl','.c','.h'] ], + ['Image Files', ['.gif'] ], + ['Image Files', ['.jpeg','.jpg'] ], + ['Image Files', [], ['GIFF','JPEG']], ['All files', '*' ] ] if operation == 'open' file = Tk.getOpenFile('filetypes'=>types, 'parent'=>w) else - file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w, - 'initialfile'=>'Untitled', + file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w, + 'initialfile'=>'Untitled', 'defaultextension'=>'.txt') end if file != "" Index: ext/tk/sample/demos-en/pendulum.rb =================================================================== --- ext/tk/sample/demos-en/pendulum.rb (revision 23917) +++ ext/tk/sample/demos-en/pendulum.rb (working copy) @@ -7,7 +7,7 @@ # destroy toplevel widget for this demo script if defined?($pendulum_demo) && $pendulum_demo - $pendulum_demo.destroy + $pendulum_demo.destroy $pendulum_demo = nil end @@ -59,14 +59,14 @@ # Create the canvas containing the graphical representation of the # simulated system. - @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white', + @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white', :borderwidth=>2, :relief=>:sunken) - TkcText.new(@c, 5, 5, :anchor=>:nw, + TkcText.new(@c, 5, 5, :anchor=>:nw, :text=>'Click to Adjust Bob Start Position') # Coordinates of these items don't matter; they will be set properly below @plate = TkcLine.new(@c, 0, 25, 320, 25, :width=>2, :fill=>'grey50') @rod = TkcLine.new(@c, 1, 1, 1, 1, :width=>3, :fill=>'black') - @bob = TkcOval.new(@c, 1, 1, 2, 2, + @bob = TkcOval.new(@c, 1, 1, 2, 2, :width=>3, :fill=>'yellow', :outline=>'black') TkcOval.new(@c, 155, 20, 165, 30, :fill=>'grey50', :outline=>'') @@ -76,22 +76,22 @@ # Create the canvas containing the phase space graph; this consists of # a line that gets gradually paler as it ages, which is an extremely # effective visual trick. - @k = TkCanvas.new(@lf2, :width=>320, :height=>200, :background=>'white', + @k = TkCanvas.new(@lf2, :width=>320, :height=>200, :background=>'white', :borderwidth=>2, :relief=>:sunken) @y_axis = TkcLine.new(@k, 160, 200, 160, 0, :fill=>'grey75', :arrow=>:last) @x_axis = TkcLine.new(@k, 0, 100, 320, 100, :fill=>'grey75', :arrow=>:last) @graph = {} 90.step(0, -10){|i| - # Coordinates of these items don't matter; + # Coordinates of these items don't matter; # they will be set properly below @graph[i] = TkcLine.new(@k, 0, 0, 1, 1, :smooth=>true, :fill=>"grey#{i}") } # labels - @label_theta = TkcText.new(@k, 0, 0, :anchor=>:ne, + @label_theta = TkcText.new(@k, 0, 0, :anchor=>:ne, :text=>'q', :font=>'Symbol 8') - @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne, + @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne, :text=>'dq', :font=>'Symbol 8') # pack @@ -109,19 +109,19 @@ # binding @c.bindtags_unshift(btag = TkBindTag.new) btag.bind('Destroy'){ @timer.stop } - btag.bind('1', proc{|x, y| @timer.stop; showPendulum(x.to_i, y.to_i)}, + btag.bind('1', proc{|x, y| @timer.stop; showPendulum(x.to_i, y.to_i)}, '%x %y') btag.bind('B1-Motion', proc{|x, y| showPendulum(x.to_i, y.to_i)}, '%x %y') - btag.bind('ButtonRelease-1', - proc{|x, y| showPendulum(x.to_i, y.to_i); @timer.start }, + btag.bind('ButtonRelease-1', + proc{|x, y| showPendulum(x.to_i, y.to_i); @timer.start }, '%x %y') btag.bind('Configure', proc{|w| @plate.coords(0, 25, w.to_i, 25)}, '%w') - @k.bind('Configure', proc{|h, w| + @k.bind('Configure', proc{|h, w| h = h.to_i w = w.to_i - @psh = h/2; + @psh = h/2; @psw = w/2 @x_axis.coords(2, @psh, w-2, @psh) @y_axis.coords(@psw, h-2, @psw, 2) @@ -142,9 +142,9 @@ end # This procedure makes the pendulum appear at the correct place on the - # canvas. If the additional arguments x, y are passed instead of computing - # the position of the pendulum from the length of the pendulum rod and its - # angle, the length and angle are computed in reverse from the given + # canvas. If the additional arguments x, y are passed instead of computing + # the position of the pendulum from the length of the pendulum rod and its + # angle, the length and angle are computed in reverse from the given # location (which is taken to be the centre of the pendulum bob.) def showPendulum(x=nil, y=nil) if x && y && (x != 160 || y != 25) Index: ext/tk/sample/demos-en/puzzle.rb =================================================================== --- ext/tk/sample/demos-en/puzzle.rb (revision 23917) +++ ext/tk/sample/demos-en/puzzle.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($puzzle_demo) && $puzzle_demo - $puzzle_demo.destroy + $puzzle_demo.destroy $puzzle_demo = nil end @@ -70,7 +70,7 @@ # depend_on_button_width = true depend_on_button_width = false - + s = TkScrollbar.new(base_frame) base = TkFrame.new(base_frame) { width frameWidth @@ -101,7 +101,7 @@ if depend_on_button_width && (w.winfo_reqwidth * 4 > base.width) base.width = w.winfo_reqwidth * 4 end - }.place('relx'=>$xpos[num], 'rely'=>$ypos[num], + }.place('relx'=>$xpos[num], 'rely'=>$ypos[num], 'relwidth'=>0.25, 'relheight'=>0.25) } $xpos['space'] = 0.75 Index: ext/tk/sample/demos-en/aniwave.rb =================================================================== --- ext/tk/sample/demos-en/aniwave.rb (revision 23917) +++ ext/tk/sample/demos-en/aniwave.rb (working copy) @@ -5,7 +5,7 @@ # destroy toplevel widget for this demo script if defined?($aniwave_demo) && $aniwave_demo - $aniwave_demo.destroy + $aniwave_demo.destroy $aniwave_demo = nil end @@ -51,11 +51,11 @@ @direction = dir # create canvas widget - @c = TkCanvas.new(frame, :width=>300, :height=>200, + @c = TkCanvas.new(frame, :width=>300, :height=>200, :background=>'black') @c.pack(:padx=>10, :pady=>10, :expand=>true) - # Creates a coordinates list of a wave. + # Creates a coordinates list of a wave. @waveCoords = [] @backupCoords = [] n = 0 @@ -67,10 +67,10 @@ # Create a smoothed line and arrange for its coordinates to be the # contents of the variable waveCoords. - @line = TkcLine.new(@c, @waveCoords, + @line = TkcLine.new(@c, @waveCoords, :width=>1, :fill=>'green', :smooth=>true) - # Main animation "loop". + # Main animation "loop". # Theoretically 100 frames-per-second (==10ms between frames) @timer = TkTimer.new(10){ basicMotion; reverser } Index: ext/tk/sample/demos-en/radio.rb =================================================================== --- ext/tk/sample/demos-en/radio.rb (revision 23917) +++ ext/tk/sample/demos-en/radio.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($radio_demo) && $radio_demo - $radio_demo.destroy + $radio_demo.destroy $radio_demo = nil end @@ -21,7 +21,7 @@ base_frame = TkFrame.new($radio_demo).pack(:fill=>:both, :expand=>true) -# label +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' @@ -30,11 +30,11 @@ } msg.pack('side'=>'top') -# +# size = TkVariable.new color = TkVariable.new -# frame +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { text 'Dismiss' @@ -59,13 +59,13 @@ }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame +# frame f_left = TkFrame.new(base_frame) f_right = TkFrame.new(base_frame) f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -# radiobutton +# radiobutton [10, 12, 18, 24].each {|sz| TkRadioButton.new(f_left) { text "Point Size #{sz}" Index: ext/tk/sample/demos-en/msgbox.rb =================================================================== --- ext/tk/sample/demos-en/msgbox.rb (revision 23917) +++ ext/tk/sample/demos-en/msgbox.rb (working copy) @@ -7,7 +7,7 @@ # toplevel widget if defined?($msgbox_demo) && $msgbox_demo - $msgbox_demo.destroy + $msgbox_demo.destroy $msgbox_demo = nil end @@ -49,9 +49,9 @@ # frame $msgbox_leftframe = TkFrame.new(base_frame) $msgbox_rightframe = TkFrame.new(base_frame) -$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', +$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') -$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', +$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') TkLabel.new($msgbox_leftframe, 'text'=>'Icon').pack('side'=>'top') @@ -60,9 +60,9 @@ $msgboxIcon = TkVariable.new('info') ['error', 'info', 'question', 'warning'].each {|icon| - TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, - 'relief'=>'flat', 'value'=>icon, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon, + 'relief'=>'flat', 'value'=>icon, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') } @@ -71,20 +71,20 @@ .pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') $msgboxType = TkVariable.new('ok') -['abortretryignore', 'ok', 'okcancel', +['abortretryignore', 'ok', 'okcancel', 'retrycancel', 'yesno', 'yesnocancel'].each {|type| - TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, - 'relief'=>'flat', 'value'=>type, 'width'=>16, - 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, + TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType, + 'relief'=>'flat', 'value'=>type, 'width'=>16, + 'anchor'=>'w').pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') } def showMessageBox(w) - button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, + button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, 'title'=>'Message', 'parent'=>w, 'message'=>"This is a \"#{$msgboxType.value}\" type messagebox with the \"#{$msgboxIcon.value}\" icon") - Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, + Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, 'message'=>"You have selected \"#{button}\"") end Index: ext/tk/sample/demos-en/combo.rb =================================================================== --- ext/tk/sample/demos-en/combo.rb (revision 23917) +++ ext/tk/sample/demos-en/combo.rb (working copy) @@ -5,7 +5,7 @@ # based on "Id: combo.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp" if defined?($combo_demo) && $combo_demo - $combo_demo.destroy + $combo_demo.destroy $combo_demo = nil end @@ -17,7 +17,7 @@ base_frame = TkFrame.new($combo_demo).pack(:fill=>:both, :expand=>true) -Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left, +Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left, :text=><:top, :fill=>:x) Three different combo-boxes are displayed below. \ You can add characters to the first \ @@ -40,24 +40,24 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - Ttk::Button.new(frame, :text=>'See Variables', - :image=>$image['view'], :compound=>:left, + TkGrid('x', + Ttk::Button.new(frame, :text=>'See Variables', + :image=>$image['view'], :compound=>:left, :command=>proc{ - showVars(base_frame, - ['firstVariable', firstValue], - ['secondVariable', secondValue], + showVars(base_frame, + ['firstVariable', firstValue], + ['secondVariable', secondValue], ['ozCity', ozCity]) - }), - Ttk::Button.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'combo'}), - Ttk::Button.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + }), + Ttk::Button.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'combo'}), + Ttk::Button.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ $combo_demo.destroy $combo_demo = nil - }), + }), :padx=>4, :pady=>4) grid_columnconfigure(0, :weight=>1) pack(:side=>:bottom, :fill=>:x) @@ -66,7 +66,7 @@ frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true) australianCities = [ - 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', 'Brisbane', + 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', 'Brisbane', 'Hobart', 'Darwin', 'Alice Springs' ] @@ -80,17 +80,17 @@ w.values <<= w.value unless w.values.include?(w.value) } }.pack(:pady=>5, :padx=>10) - }, + }, Ttk::LabelFrame.new(frame, :text=>'Disabled'){|f| Ttk::Combobox.new(f, :textvariable=>secondValue, :state=>:disabled) . pack(:pady=>5, :padx=>10) - }, + }, Ttk::LabelFrame.new(frame, :text=>'Defined List Only'){|f| - Ttk::Combobox.new(f, :textvariable=>ozCity, :state=>:readonly, + Ttk::Combobox.new(f, :textvariable=>ozCity, :state=>:readonly, :values=>australianCities) . pack(:pady=>5, :padx=>10) - }, + }, :side=>:top, :pady=>5, :padx=>10) Index: ext/tk/sample/demos-en/colors.rb =================================================================== --- ext/tk/sample/demos-en/colors.rb (revision 23917) +++ ext/tk/sample/demos-en/colors.rb (working copy) @@ -9,7 +9,7 @@ # toplevel widget if defined?($colors_demo) && $colors_demo - $colors_demo.destroy + $colors_demo.destroy $colors_demo = nil end Index: ext/tk/sample/demos-en/floor2.rb =================================================================== --- ext/tk/sample/demos-en/floor2.rb (revision 23917) +++ ext/tk/sample/demos-en/floor2.rb (working copy) @@ -21,7 +21,7 @@ w.delete('all') $activeFloor2 = active - # First go through the three floors, displaying the backgrounds for + # First go through the three floors, displaying the backgrounds for # each floor. floor2_bg1(w,$floor2_colors['bg1'],$floor2_colors['outline1']) @@ -32,12 +32,12 @@ w.raise("floor#{active}") - # Create a dummy item just to mark this point in the display list, + # Create a dummy item just to mark this point in the display list, # so we can insert highlights here. w.create(TkcRectangle,0,100,1,101,'fill'=>'','outline'=>'','tags'=>'marker') - # Add the walls and labels for the active floor, along with + # Add the walls and labels for the active floor, along with # transparent polygons that define the rooms on the floor. # Make sure that the room polygons are on top. @@ -302,7 +302,7 @@ w.create(TkcLine,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg']) w.create(TkcLine,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) w.create(TkcLine,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg']) - w.create(TkcLine,107,300,159,300,159,248,107,248,107,300, + w.create(TkcLine,107,300,159,300,159,248,107,248,107,300, 'fill'=>outline, 'tags'=>['floor3','bg']) end @@ -316,316 +316,316 @@ # color - Color to use for drawing foreground information. def floor2_fg1(w,color) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '101' $floorItems2['101'] = i - w.create(TkcText,358,209, 'text'=>'101', 'fill'=>color, + w.create(TkcText,358,209, 'text'=>'101', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Pub Lift1' $floorItems2['Pub Lift1'] = i - w.create(TkcText,323,223, 'text'=>'Pub Lift1', 'fill'=>color, + w.create(TkcText,323,223, 'text'=>'Pub Lift1', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Priv Lift1' $floorItems2['Priv Lift1'] = i - w.create(TkcText,323,188, 'text'=>'Priv Lift1', 'fill'=>color, + w.create(TkcText,323,188, 'text'=>'Priv Lift1', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, + i = TkcPolygon.new(w,42,389,42,337,1,337,1,389, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '110' $floorItems2['110'] = i - w.create(TkcText,21.5,363, 'text'=>'110', 'fill'=>color, + w.create(TkcText,21.5,363, 'text'=>'110', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, + i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '109' $floorItems2['109'] = i - w.create(TkcText,67,363, 'text'=>'109', 'fill'=>color, + w.create(TkcText,67,363, 'text'=>'109', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, + i = TkcPolygon.new(w,51,300,51,253,6,253,6,300, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '111' $floorItems2['111'] = i - w.create(TkcText,28.5,276.5, 'text'=>'111', 'fill'=>color, + w.create(TkcText,28.5,276.5, 'text'=>'111', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, + i = TkcPolygon.new(w,98,248,98,309,79,309,79,248, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '117B' $floorItems2['117B'] = i - w.create(TkcText,88.5,278.5, 'text'=>'117B', 'fill'=>color, + w.create(TkcText,88.5,278.5, 'text'=>'117B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, + i = TkcPolygon.new(w,51,251,51,204,6,204,6,251, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '112' $floorItems2['112'] = i - w.create(TkcText,28.5,227.5, 'text'=>'112', 'fill'=>color, + w.create(TkcText,28.5,227.5, 'text'=>'112', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, + i = TkcPolygon.new(w,6,156,51,156,51,203,6,203, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '113' $floorItems2['113'] = i - w.create(TkcText,28.5,179.5, 'text'=>'113', 'fill'=>color, + w.create(TkcText,28.5,179.5, 'text'=>'113', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, + i = TkcPolygon.new(w,85,169,79,169,79,192,85,192, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '117A' $floorItems2['117A'] = i - w.create(TkcText,82,180.5, 'text'=>'117A', 'fill'=>color, + w.create(TkcText,82,180.5, 'text'=>'117A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, + i = TkcPolygon.new(w,77,302,77,168,53,168,53,302, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '117' $floorItems2['117'] = i - w.create(TkcText,65,235, 'text'=>'117', 'fill'=>color, + w.create(TkcText,65,235, 'text'=>'117', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, + i = TkcPolygon.new(w,51,155,51,115,6,115,6,155, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '114' $floorItems2['114'] = i - w.create(TkcText,28.5,135, 'text'=>'114', 'fill'=>color, + w.create(TkcText,28.5,135, 'text'=>'114', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, + i = TkcPolygon.new(w,95,115,53,115,53,168,95,168, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '115' $floorItems2['115'] = i - w.create(TkcText,74,141.5, 'text'=>'115', 'fill'=>color, + w.create(TkcText,74,141.5, 'text'=>'115', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, + i = TkcPolygon.new(w,87,113,87,27,10,27,10,113, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '116' $floorItems2['116'] = i - w.create(TkcText,48.5,70, 'text'=>'116', 'fill'=>color, + w.create(TkcText,48.5,70, 'text'=>'116', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, + i = TkcPolygon.new(w,89,91,128,91,128,113,89,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '118' $floorItems2['118'] = i - w.create(TkcText,108.5,102, 'text'=>'118', 'fill'=>color, + w.create(TkcText,108.5,102, 'text'=>'118', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,178,128,178,132,216,132,216,91, - 163,91,163,112,149,112,149,128, + 163,91,163,112,149,112,149,128, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '120' $floorItems2['120'] = i - w.create(TkcText,189.5,111.5, 'text'=>'120', 'fill'=>color, + w.create(TkcText,189.5,111.5, 'text'=>'120', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192, - 156,192,156,169,175,169,175,246,79,246, + 156,192,156,169,175,169,175,246,79,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '122' $floorItems2['122'] = i - w.create(TkcText,131,207.5, 'text'=>'122', 'fill'=>color, + w.create(TkcText,131,207.5, 'text'=>'122', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, + i = TkcPolygon.new(w,138,169,154,169,154,191,138,191, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '121' $floorItems2['121'] = i - w.create(TkcText,146,180, 'text'=>'121', 'fill'=>color, + w.create(TkcText,146,180, 'text'=>'121', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, + i = TkcPolygon.new(w,99,300,126,300,126,309,99,309, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '106A' $floorItems2['106A'] = i - w.create(TkcText,112.5,304.5, 'text'=>'106A', 'fill'=>color, + w.create(TkcText,112.5,304.5, 'text'=>'106A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, + i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '105' $floorItems2['105'] = i - w.create(TkcText,124.5,278.5, 'text'=>'105', 'fill'=>color, + w.create(TkcText,124.5,278.5, 'text'=>'105', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, + i = TkcPolygon.new(w,174,309,174,300,152,300,152,309, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '106B' $floorItems2['106B'] = i - w.create(TkcText,163,304.5, 'text'=>'106B', 'fill'=>color, + w.create(TkcText,163,304.5, 'text'=>'106B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, + i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '104' $floorItems2['104'] = i - w.create(TkcText,184,278.5, 'text'=>'104', 'fill'=>color, + w.create(TkcText,184,278.5, 'text'=>'104', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, + i = TkcPolygon.new(w,138,385,138,337,91,337,91,385, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '108' $floorItems2['108'] = i - w.create(TkcText,114.5,361, 'text'=>'108', 'fill'=>color, + w.create(TkcText,114.5,361, 'text'=>'108', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, + i = TkcPolygon.new(w,256,337,140,337,140,385,256,385, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '107' $floorItems2['107'] = i - w.create(TkcText,198,361, 'text'=>'107', 'fill'=>color, + w.create(TkcText,198,361, 'text'=>'107', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, + i = TkcPolygon.new(w,300,353,300,329,260,329,260,353, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Smoking' $floorItems2['Smoking'] = i - w.create(TkcText,280,341, 'text'=>'Smoking', 'fill'=>color, + w.create(TkcText,280,341, 'text'=>'Smoking', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, + i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '123' $floorItems2['123'] = i - w.create(TkcText,245.5,190.5, 'text'=>'123', 'fill'=>color, + w.create(TkcText,245.5,190.5, 'text'=>'123', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, + i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '103' $floorItems2['103'] = i - w.create(TkcText,259,287, 'text'=>'103', 'fill'=>color, + w.create(TkcText,259,287, 'text'=>'103', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, + i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '124' $floorItems2['124'] = i - w.create(TkcText,356,150, 'text'=>'124', 'fill'=>color, + w.create(TkcText,356,150, 'text'=>'124', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, + i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '125' $floorItems2['125'] = i - w.create(TkcText,392,217.5, 'text'=>'125', 'fill'=>color, + w.create(TkcText,392,217.5, 'text'=>'125', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, + i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '126' $floorItems2['126'] = i - w.create(TkcText,436.5,185.5, 'text'=>'126', 'fill'=>color, + w.create(TkcText,436.5,185.5, 'text'=>'126', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,409,209,409,229,399,229,399,253, - 486,253,486,239,474,239,474,209, + 486,253,486,239,474,239,474,209, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '127' $floorItems2['127'] = i - w.create(TkcText,436.5,'231', 'text'=>'127', 'fill'=>color, + w.create(TkcText,436.5,'231', 'text'=>'127', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,501,164,501,174,495,174,495,188, - 490,188,490,204,476,204,476,164, + 490,188,490,204,476,204,476,164, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'MShower' $floorItems2['MShower'] = i - w.create(TkcText,488.5,'184', 'text'=>'MShower', 'fill'=>color, + w.create(TkcText,488.5,'184', 'text'=>'MShower', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, + i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Closet' $floorItems2['Closet'] = i - w.create(TkcText,502.5,190, 'text'=>'Closet', 'fill'=>color, + w.create(TkcText,502.5,190, 'text'=>'Closet', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, + i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'WShower' $floorItems2['WShower'] = i - w.create(TkcText,494.5,230, 'text'=>'WShower', 'fill'=>color, + w.create(TkcText,494.5,230, 'text'=>'WShower', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166, 697,166,697,275,553,275,531,254,515,254, - 515,174,503,174,503,161,486,161, + 515,174,503,174,503,161,486,161, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '130' $floorItems2['130'] = i - w.create(TkcText,638.5,205, 'text'=>'130', 'fill'=>color, + w.create(TkcText,638.5,205, 'text'=>'130', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,308,242,339,242,339,248,342,248, 342,246,397,246,397,276,393,276, - 393,309,300,309,300,248,308,248, + 393,309,300,309,300,248,308,248, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '102' $floorItems2['102'] = i - w.create(TkcText,367.5,278.5, 'text'=>'102', 'fill'=>color, + w.create(TkcText,367.5,278.5, 'text'=>'102', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, + i = TkcPolygon.new(w,397,255,486,255,486,276,397,276, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '128' $floorItems2['128'] = i - w.create(TkcText,441.5,265.5, 'text'=>'128', 'fill'=>color, + w.create(TkcText,441.5,265.5, 'text'=>'128', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,510,309,486,309,486,255,530,255, 552,277,561,277,561,325,510,325, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '129' $floorItems2['129'] = i - w.create(TkcText,535.5,293, 'text'=>'129', 'fill'=>color, + w.create(TkcText,535.5,293, 'text'=>'129', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,696,281,740,281,740,387,642,387, - 642,389,561,389,561,277,696,277, + 642,389,561,389,561,277,696,277, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '133' $floorItems2['133'] = i - w.create(TkcText,628.5,335, 'text'=>'133', 'fill'=>color, + w.create(TkcText,628.5,335, 'text'=>'133', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, + i = TkcPolygon.new(w,742,387,742,281,800,281,800,387, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '132' $floorItems2['132'] = i - w.create(TkcText,771,334, 'text'=>'132', 'fill'=>color, + w.create(TkcText,771,334, 'text'=>'132', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, + i = TkcPolygon.new(w,800,168,800,280,699,280,699,168, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '134' $floorItems2['134'] = i - w.create(TkcText,749.5,224, 'text'=>'134', 'fill'=>color, + w.create(TkcText,749.5,224, 'text'=>'134', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) - i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, + i = TkcPolygon.new(w,726,131,726,166,800,166,800,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '135' $floorItems2['135'] = i - w.create(TkcText,763,148.5, 'text'=>'135', 'fill'=>color, + w.create(TkcText,763,148.5, 'text'=>'135', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366, 304,312,396,312,396,288,400,288,404,288, 409,290,413,292,418,297,421,302,422,309, 421,318,417,325,411,330,405,332,397,333, 344,333,340,334,336,336,335,338,332,342, - 331,347,332,351,334,354,336,357,341,359, + 331,347,332,351,334,354,336,357,341,359, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Ramona Stair' $floorItems2['Ramona Stair'] = i - w.create(TkcText,368,323, 'text'=>'Ramona Stair', 'fill'=>color, + w.create(TkcText,368,323, 'text'=>'Ramona Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20, - 122,28,123,32,123,68,220,68,220,87,90,87,90,23, + 122,28,123,32,123,68,220,68,220,87,90,87,90,23, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'University Stair' $floorItems2['University Stair'] = i - w.create(TkcText,155,77.5, 'text'=>'University Stair', 'fill'=>color, + w.create(TkcText,155,77.5, 'text'=>'University Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56, 358,48,363,39,365,29,348,25,335,22,321,14, 300,5,283,1,260,0,246,0,242,2,236,4,231,8, - 227,13,223,17,221,22,220,34,260,34, + 227,13,223,17,221,22,220,34,260,34, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Plaza Stair' $floorItems2['Plaza Stair'] = i - w.create(TkcText,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, + w.create(TkcText,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49, 323,56,337,70,350,83,365,94,377,100, - 386,104,386,128,220,128, + 386,104,386,128,220,128, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = 'Plaza Deck' $floorItems2['Plaza Deck'] = i - w.create(TkcText,303,81, 'text'=>'Plaza Deck', 'fill'=>color, + w.create(TkcText,303,81, 'text'=>'Plaza Deck', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '106' $floorItems2['106'] = i - w.create(TkcText,131.5,318.5, 'text'=>'106', 'fill'=>color, + w.create(TkcText,131.5,318.5, 'text'=>'106', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115, 95,128,114,128,114,151,157,151,157,153,112,153, - 112,130,97,130,97,168,175,168,175,131,146,131, + 112,130,97,130,97,168,175,168,175,131,146,131, 'fill'=>'', 'tags'=>['floor1','room']) $floorLabels2[i.id] = '119' $floorItems2['119'] = i - w.create(TkcText,143.5,133, 'text'=>'119', 'fill'=>color, + w.create(TkcText,143.5,133, 'text'=>'119', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor1','label']) w.create(TkcLine,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall']) w.create(TkcLine,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall']) @@ -798,321 +798,321 @@ def floor2_fg2(w,color) i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222, - 800,222,800,168,748,168, + 800,222,800,168,748,168, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '238' $floorItems2['238'] = i - w.create(TkcText,774,195, 'text'=>'238', 'fill'=>color, + w.create(TkcText,774,195, 'text'=>'238', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '237' $floorItems2['237'] = i - w.create(TkcText,763,148.5, 'text'=>'237', 'fill'=>color, + w.create(TkcText,763,148.5, 'text'=>'237', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324, 643,324,643,291,641,291,641,205,696,205, 696,291,694,291,694,314,715,314,715,291, - 715,205,755,205,755,190,724,190,724,187, + 715,205,755,205,755,190,724,190,724,187, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '246' $floorItems2['246'] = i - w.create(TkcText,600,264, 'text'=>'246', 'fill'=>color, + w.create(TkcText,600,264, 'text'=>'246', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, + i = TkcPolygon.new(w,694,279,643,279,643,314,694,314, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '247' $floorItems2['247'] = i - w.create(TkcText,668.5,296.5, 'text'=>'247', 'fill'=>color, + w.create(TkcText,668.5,296.5, 'text'=>'247', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246, 397,246,397,255,476,255,476,250,482,250,559,250, - 559,274,482,274,482,278,396,278,396,274,232,274, + 559,274,482,274,482,278,396,278,396,274,232,274, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '202' $floorItems2['202'] = i - w.create(TkcText,285.5,260, 'text'=>'202', 'fill'=>color, + w.create(TkcText,285.5,260, 'text'=>'202', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196, 306,196,306,180,175,180,175,169,156,169, - 156,196,176,196,176,228, + 156,196,176,196,176,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '206' $floorItems2['206'] = i - w.create(TkcText,143,267, 'text'=>'206', 'fill'=>color, + w.create(TkcText,143,267, 'text'=>'206', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, + i = TkcPolygon.new(w,51,277,6,277,6,338,51,338, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '212' $floorItems2['212'] = i - w.create(TkcText,28.5,307.5, 'text'=>'212', 'fill'=>color, + w.create(TkcText,28.5,307.5, 'text'=>'212', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, + i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '245' $floorItems2['245'] = i - w.create(TkcText,521.5,300.5, 'text'=>'245', 'fill'=>color, + w.create(TkcText,521.5,300.5, 'text'=>'245', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, + i = TkcPolygon.new(w,560,389,599,389,599,326,560,326, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '244' $floorItems2['244'] = i - w.create(TkcText,579.5,357.5, 'text'=>'244', 'fill'=>color, + w.create(TkcText,579.5,357.5, 'text'=>'244', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, + i = TkcPolygon.new(w,601,389,601,326,643,326,643,389, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '243' $floorItems2['243'] = i - w.create(TkcText,622,357.5, 'text'=>'243', 'fill'=>color, + w.create(TkcText,622,357.5, 'text'=>'243', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, + i = TkcPolygon.new(w,688,316,645,316,645,365,688,365, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '242' $floorItems2['242'] = i - w.create(TkcText,666.5,340.5, 'text'=>'242', 'fill'=>color, + w.create(TkcText,666.5,340.5, 'text'=>'242', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, + i = TkcPolygon.new(w,802,367,759,367,759,226,802,226, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = 'Barbecue Deck' $floorItems2['Barbecue Deck'] = i - w.create(TkcText,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, + w.create(TkcText,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, + i = TkcPolygon.new(w,755,262,755,314,717,314,717,262, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '240' $floorItems2['240'] = i - w.create(TkcText,736,288, 'text'=>'240', 'fill'=>color, + w.create(TkcText,736,288, 'text'=>'240', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, + i = TkcPolygon.new(w,755,316,689,316,689,365,755,365, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '241' $floorItems2['241'] = i - w.create(TkcText,722,340.5, 'text'=>'241', 'fill'=>color, + w.create(TkcText,722,340.5, 'text'=>'241', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, + i = TkcPolygon.new(w,755,206,717,206,717,261,755,261, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '239' $floorItems2['239'] = i - w.create(TkcText,736,233.5, 'text'=>'239', 'fill'=>color, + w.create(TkcText,736,233.5, 'text'=>'239', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, + i = TkcPolygon.new(w,695,277,643,277,643,206,695,206, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '248' $floorItems2['248'] = i - w.create(TkcText,669,241.5, 'text'=>'248', 'fill'=>color, + w.create(TkcText,669,241.5, 'text'=>'248', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, + i = TkcPolygon.new(w,676,135,676,185,724,185,724,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '236' $floorItems2['236'] = i - w.create(TkcText,700,160, 'text'=>'236', 'fill'=>color, + w.create(TkcText,700,160, 'text'=>'236', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, + i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '235' $floorItems2['235'] = i - w.create(TkcText,651.5,160, 'text'=>'235', 'fill'=>color, + w.create(TkcText,651.5,160, 'text'=>'235', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,626,143,633,143,633,135,572,135, - 572,143,579,143,579,185,626,185, + 572,143,579,143,579,185,626,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '234' $floorItems2['234'] = i - w.create(TkcText,606,160, 'text'=>'234', 'fill'=>color, + w.create(TkcText,606,160, 'text'=>'234', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,557,135,571,135,571,145,578,145, - 578,185,527,185,527,131,557,131, + 578,185,527,185,527,131,557,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '233' $floorItems2['233'] = i - w.create(TkcText,552.5,158, 'text'=>'233', 'fill'=>color, + w.create(TkcText,552.5,158, 'text'=>'233', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,476,249,557,249,557,205,476,205, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '230' $floorItems2['230'] = i - w.create(TkcText,516.5,227, 'text'=>'230', 'fill'=>color, + w.create(TkcText,516.5,227, 'text'=>'230', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, + i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '232' $floorItems2['232'] = i - w.create(TkcText,500.5,158, 'text'=>'232', 'fill'=>color, + w.create(TkcText,500.5,158, 'text'=>'232', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, + i = TkcPolygon.new(w,476,186,495,186,495,204,476,204, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '229' $floorItems2['229'] = i - w.create(TkcText,485.5,195, 'text'=>'229', 'fill'=>color, + w.create(TkcText,485.5,195, 'text'=>'229', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, + i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '227' $floorItems2['227'] = i - w.create(TkcText,436.5,185.5, 'text'=>'227', 'fill'=>color, + w.create(TkcText,436.5,185.5, 'text'=>'227', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, + i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '228' $floorItems2['228'] = i - w.create(TkcText,436.5,231, 'text'=>'228', 'fill'=>color, + w.create(TkcText,436.5,231, 'text'=>'228', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, + i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '226' $floorItems2['226'] = i - w.create(TkcText,392,217.5, 'text'=>'226', 'fill'=>color, + w.create(TkcText,392,217.5, 'text'=>'226', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, + i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '225' $floorItems2['225'] = i - w.create(TkcText,356.5,150, 'text'=>'225', 'fill'=>color, + w.create(TkcText,356.5,150, 'text'=>'225', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, + i = TkcPolygon.new(w,234,198,306,198,306,249,234,249, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '224' $floorItems2['224'] = i - w.create(TkcText,270,223.5, 'text'=>'224', 'fill'=>color, + w.create(TkcText,270,223.5, 'text'=>'224', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, + i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '223' $floorItems2['223'] = i - w.create(TkcText,292,157, 'text'=>'223', 'fill'=>color, + w.create(TkcText,292,157, 'text'=>'223', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, + i = TkcPolygon.new(w,268,179,221,179,221,135,268,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '222' $floorItems2['222'] = i - w.create(TkcText,244.5,157, 'text'=>'222', 'fill'=>color, + w.create(TkcText,244.5,157, 'text'=>'222', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, + i = TkcPolygon.new(w,177,179,219,179,219,135,177,135, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '221' $floorItems2['221'] = i - w.create(TkcText,198,157, 'text'=>'221', 'fill'=>color, + w.create(TkcText,198,157, 'text'=>'221', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, + i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '204' $floorItems2['204'] = i - w.create(TkcText,324,301.5, 'text'=>'204', 'fill'=>color, + w.create(TkcText,324,301.5, 'text'=>'204', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, + i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '205' $floorItems2['205'] = i - w.create(TkcText,265.5,307, 'text'=>'205', 'fill'=>color, + w.create(TkcText,265.5,307, 'text'=>'205', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,256,385,256,340,212,340,212,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '207' $floorItems2['207'] = i - w.create(TkcText,234,362.5, 'text'=>'207', 'fill'=>color, + w.create(TkcText,234,362.5, 'text'=>'207', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, + i = TkcPolygon.new(w,210,340,164,340,164,385,210,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '208' $floorItems2['208'] = i - w.create(TkcText,187,362.5, 'text'=>'208', 'fill'=>color, + w.create(TkcText,187,362.5, 'text'=>'208', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, + i = TkcPolygon.new(w,115,340,162,340,162,385,115,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '209' $floorItems2['209'] = i - w.create(TkcText,138.5,362.5, 'text'=>'209', 'fill'=>color, + w.create(TkcText,138.5,362.5, 'text'=>'209', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, + i = TkcPolygon.new(w,89,228,89,156,53,156,53,228, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '217' $floorItems2['217'] = i - w.create(TkcText,71,192, 'text'=>'217', 'fill'=>color, + w.create(TkcText,71,192, 'text'=>'217', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, + i = TkcPolygon.new(w,89,169,97,169,97,190,89,190, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '217A' $floorItems2['217A'] = i - w.create(TkcText,93,179.5, 'text'=>'217A', 'fill'=>color, + w.create(TkcText,93,179.5, 'text'=>'217A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, + i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '216' $floorItems2['216'] = i - w.create(TkcText,71,145.5, 'text'=>'216', 'fill'=>color, + w.create(TkcText,71,145.5, 'text'=>'216', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, + i = TkcPolygon.new(w,51,179,51,135,6,135,6,179, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '215' $floorItems2['215'] = i - w.create(TkcText,28.5,157, 'text'=>'215', 'fill'=>color, + w.create(TkcText,28.5,157, 'text'=>'215', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, + i = TkcPolygon.new(w,51,227,6,227,6,180,51,180, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '214' $floorItems2['214'] = i - w.create(TkcText,28.5,203.5, 'text'=>'214', 'fill'=>color, + w.create(TkcText,28.5,203.5, 'text'=>'214', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, + i = TkcPolygon.new(w,51,275,6,275,6,229,51,229, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '213' $floorItems2['213'] = i - w.create(TkcText,28.5,252, 'text'=>'213', 'fill'=>color, + w.create(TkcText,28.5,252, 'text'=>'213', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, + i = TkcPolygon.new(w,114,340,67,340,67,385,114,385, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '210' $floorItems2['210'] = i - w.create(TkcText,90.5,362.5, 'text'=>'210', 'fill'=>color, + w.create(TkcText,90.5,362.5, 'text'=>'210', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, + i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '211' $floorItems2['211'] = i - w.create(TkcText,33,364.5, 'text'=>'211', 'fill'=>color, + w.create(TkcText,33,364.5, 'text'=>'211', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, + i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '203' $floorItems2['203'] = i - w.create(TkcText,367.5,292.5, 'text'=>'203', 'fill'=>color, + w.create(TkcText,367.5,292.5, 'text'=>'203', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198, - 154,198,154,192,109,192,109,169,99,169, + 154,198,154,192,109,192,109,169,99,169, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '220' $floorItems2['220'] = i - w.create(TkcText,132.5,208.5, 'text'=>'220', 'fill'=>color, + w.create(TkcText,132.5,208.5, 'text'=>'220', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = 'Priv Lift2' $floorItems2['Priv Lift2'] = i - w.create(TkcText,323,188, 'text'=>'Priv Lift2', 'fill'=>color, + w.create(TkcText,323,188, 'text'=>'Priv Lift2', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = 'Pub Lift 2' $floorItems2['Pub Lift 2'] = i - w.create(TkcText,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, + w.create(TkcText,323,223, 'text'=>'Pub Lift 2', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, + i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '218' $floorItems2['218'] = i - w.create(TkcText,136,149.5, 'text'=>'218', 'fill'=>color, + w.create(TkcText,136,149.5, 'text'=>'218', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, + i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '219' $floorItems2['219'] = i - w.create(TkcText,132.5,180, 'text'=>'219', 'fill'=>color, + w.create(TkcText,132.5,180, 'text'=>'219', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor2','room']) $floorLabels2[i.id] = '201' $floorItems2['201'] = i - w.create(TkcText,358,209, 'text'=>'201', 'fill'=>color, + w.create(TkcText,358,209, 'text'=>'201', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor2','label']) w.create(TkcLine,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall']) w.create(TkcLine,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall']) @@ -1283,206 +1283,206 @@ 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '316' $floorItems2['316'] = i - w.create(TkcText,79.5,204, 'text'=>'316', 'fill'=>color, + w.create(TkcText,79.5,204, 'text'=>'316', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, + i = TkcPolygon.new(w,115,368,162,368,162,323,115,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '309' $floorItems2['309'] = i - w.create(TkcText,138.5,345.5, 'text'=>'309', 'fill'=>color, + w.create(TkcText,138.5,345.5, 'text'=>'309', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, + i = TkcPolygon.new(w,164,323,164,368,211,368,211,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '308' $floorItems2['308'] = i - w.create(TkcText,187.5,345.5, 'text'=>'308', 'fill'=>color, + w.create(TkcText,187.5,345.5, 'text'=>'308', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, + i = TkcPolygon.new(w,256,368,212,368,212,323,256,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '307' $floorItems2['307'] = i - w.create(TkcText,234,345.5, 'text'=>'307', 'fill'=>color, + w.create(TkcText,234,345.5, 'text'=>'307', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, + i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '305' $floorItems2['305'] = i - w.create(TkcText,270.5,301.5, 'text'=>'305', 'fill'=>color, + w.create(TkcText,270.5,301.5, 'text'=>'305', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,251,219,251,203,244,203,244,219, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '324B' $floorItems2['324B'] = i - w.create(TkcText,247.5,211, 'text'=>'324B', 'fill'=>color, + w.create(TkcText,247.5,211, 'text'=>'324B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, + i = TkcPolygon.new(w,251,249,244,249,244,232,251,232, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '324A' $floorItems2['324A'] = i - w.create(TkcText,247.5,240.5, 'text'=>'324A', 'fill'=>color, + w.create(TkcText,247.5,240.5, 'text'=>'324A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, + i = TkcPolygon.new(w,223,135,223,179,177,179,177,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '320' $floorItems2['320'] = i - w.create(TkcText,200,157, 'text'=>'320', 'fill'=>color, + w.create(TkcText,200,157, 'text'=>'320', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, + i = TkcPolygon.new(w,114,368,114,323,67,323,67,368, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '310' $floorItems2['310'] = i - w.create(TkcText,90.5,345.5, 'text'=>'310', 'fill'=>color, + w.create(TkcText,90.5,345.5, 'text'=>'310', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, + i = TkcPolygon.new(w,23,277,23,321,68,321,68,277, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '312' $floorItems2['312'] = i - w.create(TkcText,45.5,299, 'text'=>'312', 'fill'=>color, + w.create(TkcText,45.5,299, 'text'=>'312', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, + i = TkcPolygon.new(w,23,229,68,229,68,275,23,275, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '313' $floorItems2['313'] = i - w.create(TkcText,45.5,252, 'text'=>'313', 'fill'=>color, + w.create(TkcText,45.5,252, 'text'=>'313', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, + i = TkcPolygon.new(w,68,227,23,227,23,180,68,180, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '314' $floorItems2['314'] = i - w.create(TkcText,40.5,203.5, 'text'=>'314', 'fill'=>color, + w.create(TkcText,40.5,203.5, 'text'=>'314', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, + i = TkcPolygon.new(w,95,179,95,135,23,135,23,179, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '315' $floorItems2['315'] = i - w.create(TkcText,59,157, 'text'=>'315', 'fill'=>color, + w.create(TkcText,59,157, 'text'=>'315', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, + i = TkcPolygon.new(w,99,226,99,204,91,204,91,226, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '316B' $floorItems2['316B'] = i - w.create(TkcText,95,215, 'text'=>'316B', 'fill'=>color, + w.create(TkcText,95,215, 'text'=>'316B', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, + i = TkcPolygon.new(w,91,202,99,202,99,180,91,180, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '316A' $floorItems2['316A'] = i - w.create(TkcText,95,191, 'text'=>'316A', 'fill'=>color, + w.create(TkcText,95,191, 'text'=>'316A', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198, - 174,198,174,226,101,226,101,179,97,179, + 174,198,174,226,101,226,101,179,97,179, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '319' $floorItems2['319'] = i - w.create(TkcText,141.5,209, 'text'=>'319', 'fill'=>color, + w.create(TkcText,141.5,209, 'text'=>'319', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, + i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '311' $floorItems2['311'] = i - w.create(TkcText,29.5,361, 'text'=>'311', 'fill'=>color, + w.create(TkcText,29.5,361, 'text'=>'311', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, + i = TkcPolygon.new(w,154,191,111,191,111,169,154,169, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '318' $floorItems2['318'] = i - w.create(TkcText,132.5,180, 'text'=>'318', 'fill'=>color, + w.create(TkcText,132.5,180, 'text'=>'318', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, + i = TkcPolygon.new(w,175,168,97,168,97,131,175,131, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '317' $floorItems2['317'] = i - w.create(TkcText,136,149.5, 'text'=>'317', 'fill'=>color, + w.create(TkcText,136,149.5, 'text'=>'317', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, + i = TkcPolygon.new(w,274,194,274,221,306,221,306,194, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '323' $floorItems2['323'] = i - w.create(TkcText,290,207.5, 'text'=>'323', 'fill'=>color, + w.create(TkcText,290,207.5, 'text'=>'323', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, + i = TkcPolygon.new(w,306,222,274,222,274,249,306,249, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '325' $floorItems2['325'] = i - w.create(TkcText,290,235.5, 'text'=>'325', 'fill'=>color, + w.create(TkcText,290,235.5, 'text'=>'325', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, + i = TkcPolygon.new(w,263,179,224,179,224,135,263,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '321' $floorItems2['321'] = i - w.create(TkcText,243.5,157, 'text'=>'321', 'fill'=>color, + w.create(TkcText,243.5,157, 'text'=>'321', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,314,169,306,169,306,192,273,192, - 264,181,264,135,314,135, + 264,181,264,135,314,135, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '322' $floorItems2['322'] = i - w.create(TkcText,293.5,163.5, 'text'=>'322', 'fill'=>color, + w.create(TkcText,293.5,163.5, 'text'=>'322', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, + i = TkcPolygon.new(w,307,240,339,240,339,206,307,206, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = 'Pub Lift3' $floorItems2['Pub Lift3'] = i - w.create(TkcText,323,223, 'text'=>'Pub Lift3', 'fill'=>color, + w.create(TkcText,323,223, 'text'=>'Pub Lift3', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, + i = TkcPolygon.new(w,339,205,307,205,307,171,339,171, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = 'Priv Lift3' $floorItems2['Priv Lift3'] = i - w.create(TkcText,323,188, 'text'=>'Priv Lift3', 'fill'=>color, + w.create(TkcText,323,188, 'text'=>'Priv Lift3', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, + i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '303' $floorItems2['303'] = i - w.create(TkcText,373.5,292.5, 'text'=>'303', 'fill'=>color, + w.create(TkcText,373.5,292.5, 'text'=>'303', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,272,203,272,249,252,249,252,230, - 244,230,244,221,252,221,252,203, + 244,230,244,221,252,221,252,203, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '324' $floorItems2['324'] = i - w.create(TkcText,262,226, 'text'=>'324', 'fill'=>color, + w.create(TkcText,262,226, 'text'=>'324', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, + i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '304' $floorItems2['304'] = i - w.create(TkcText,324,301.5, 'text'=>'304', 'fill'=>color, + w.create(TkcText,324,301.5, 'text'=>'304', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, + i = TkcPolygon.new(w,375,246,375,172,341,172,341,246, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '301' $floorItems2['301'] = i - w.create(TkcText,358,209, 'text'=>'301', 'fill'=>color, + w.create(TkcText,358,209, 'text'=>'301', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, + i = TkcPolygon.new(w,397,246,377,246,377,185,397,185, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '327' $floorItems2['327'] = i - w.create(TkcText,387,215.5, 'text'=>'327', 'fill'=>color, + w.create(TkcText,387,215.5, 'text'=>'327', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) - i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, + i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '326' $floorItems2['326'] = i - w.create(TkcText,365.5,150, 'text'=>'326', 'fill'=>color, + w.create(TkcText,365.5,150, 'text'=>'326', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282, - 375,274,397,274,397,248,339,248,339,242,308,242, + 375,274,397,274,397,248,339,248,339,242,308,242, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '302' $floorItems2['302'] = i - w.create(TkcText,319.5,261, 'text'=>'302', 'fill'=>color, + w.create(TkcText,319.5,261, 'text'=>'302', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203, 272,193,263,180,242,180,175,180,175,169,156,169, 156,196,177,196,177,228,107,228,70,228,70,275,107,275, - 107,248,160,248,160,301,107,301,107,275,70,275, + 107,248,160,248,160,301,107,301,107,275,70,275, 'fill'=>'', 'tags'=>['floor3','room']) $floorLabels2[i.id] = '306' $floorItems2['306'] = i - w.create(TkcText,200.5,284.5, 'text'=>'306', 'fill'=>color, + w.create(TkcText,200.5,284.5, 'text'=>'306', 'fill'=>color, 'anchor'=>'c', 'tags'=>['floor3','label']) w.create(TkcLine,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall']) w.create(TkcLine,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall']) @@ -1577,7 +1577,7 @@ # toplevel widget if defined?($floor2_demo) && $floor2_demo - $floor2_demo.destroy + $floor2_demo.destroy $floor2_demo = nil end @@ -1593,7 +1593,7 @@ base_frame = TkFrame.new($floor2_demo).pack(:fill=>:both, :expand=>true) # label -TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', +TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', 'text'=>"This window contains a canvas widget showing the floorplan of Digital Equipment Corporation's Western Research Laboratory. It has three levels. At any given time one of the levels is active, meaning that you can see its room structure. To activate a level, click the left mouse button anywhere on it. As the mouse moves over the active level, the room under the mouse lights up and its room number appears in the \"Room:\" entry. You can also type a room number in the entry and the room will light up."){ pack('side'=>'top') } @@ -1616,18 +1616,18 @@ } $floor2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# +# $floorLabels2 = {} $floorItems2 = {} -# canvas +# canvas if $tk_version =~ /^4\.[01]/ $floor2_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken', 'highlightthickness'=>2) - $floor2_canvas = TkCanvas.new($floor2_canvas_frame, - 'width'=>900, 'height'=>500, 'borderwidth'=>0, + $floor2_canvas = TkCanvas.new($floor2_canvas_frame, + 'width'=>900, 'height'=>500, 'borderwidth'=>0, 'highlightthickness'=>0) {|c| - TkScrollbar.new(base_frame, 'orient'=>'horiz', + TkScrollbar.new(base_frame, 'orient'=>'horiz', 'command'=>proc{|*args| c.xview(*args)}){|hs| c.xscrollcommand(proc{|first,last| hs.set first,last}) pack('side'=>'bottom', 'fill'=>'x') @@ -1648,20 +1648,20 @@ v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical') TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1| - $floor2_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, - 'borderwidth'=>0, + $floor2_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500, + 'borderwidth'=>0, 'highlightthickness'=>0) { xscrollcommand(proc{|first,last| h.set first,last}) yscrollcommand(proc{|first,last| v.set first,last}) pack('expand'=>'yes', 'fill'=>'both') } - grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, + grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') } - v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, + v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') - h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, + h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0, 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news') TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0) @@ -1678,7 +1678,7 @@ # Create an entry for displaying and typing in current room. $currentRoom2 = TkVariable.new -$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken', +$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken', 'bd'=>2, 'textvariable'=>$currentRoom2) # Choose colors, then fill in the floorplan. @@ -1715,7 +1715,7 @@ $floor2_canvas.itembind('room', 'Enter', proc{newRoom2 $floor2_canvas}) $floor2_canvas.itembind('room', 'Leave', proc{$currentRoom2.value = ''}) $floor2_canvas.bind('2', proc{|x,y| $floor2_canvas.scan_mark x,y}, '%x %y') -$floor2_canvas.bind('B2-Motion', +$floor2_canvas.bind('B2-Motion', proc{|x,y| $floor2_canvas.scan_dragto x,y}, '%x %y') $floor2_canvas.bind('Destroy', proc{$currentRoom2.unset}) $currentRoom2.value = '' Index: ext/tk/sample/demos-en/anilabel.rb =================================================================== --- ext/tk/sample/demos-en/anilabel.rb (revision 23917) +++ ext/tk/sample/demos-en/anilabel.rb (working copy) @@ -4,7 +4,7 @@ # based on Tcl/Tk8.5a2 widget demos if defined?($anilabel_demo) && $anilabel_demo - $anilabel_demo.destroy + $anilabel_demo.destroy $anilabel_demo = nil end @@ -47,7 +47,7 @@ # create frame for label demo f_left = TkLabelFrame.new(base_frame, :text=>'Scrolling Texts') f_right = TkLabelFrame.new(base_frame, :text=>'GIF Image') -Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both', +Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both', 'padx'=>10, 'pady'=>10) # animated label @@ -85,7 +85,7 @@ @btag.bind_append('Destroy'){ if @destroy_image begin - self.image.delete + self.image.delete rescue end end @@ -121,13 +121,13 @@ end # create labels -l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge, +l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge, :font=>{:family=>'Courier', :size=>10}) -l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove, +l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove, :font=>{:family=>'Courier', :size=>10}) -l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat, +l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat, :font=>{:family=>'Courier', :size=>10}, :width=>18) -Tk.pack(l1, l2, l3, +Tk.pack(l1, l2, l3, :side=>:top, :expand=>true, :anchor=>:w, :padx=>10, :pady=>10) limg = AnimatedImageLabel.new(f_right, :borderwidth=>0) Index: ext/tk/sample/demos-en/twind2.rb =================================================================== --- ext/tk/sample/demos-en/twind2.rb (revision 23917) +++ ext/tk/sample/demos-en/twind2.rb (working copy) @@ -4,7 +4,7 @@ # delete toplevel widget if defined?($twind2_demo) && $twind2_demo - $twind2_demo.destroy + $twind2_demo.destroy $twind2_demo = nil end @@ -19,20 +19,20 @@ # frame $twind2_buttons = TkFrame.new(base_frame) {|frame| - TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), + TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) - TkGrid('x', - TkButton.new(frame, :text=>'See Code', - :image=>$image['view'], :compound=>:left, - :command=>proc{showCode 'twind2'}), - TkButton.new(frame, :text=>'Dismiss', - :image=>$image['delete'], :compound=>:left, + TkGrid('x', + TkButton.new(frame, :text=>'See Code', + :image=>$image['view'], :compound=>:left, + :command=>proc{showCode 'twind2'}), + TkButton.new(frame, :text=>'Dismiss', + :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $twind2_demo $twind2_demo = nil $showVarsWin[tmppath.path] = nil tmppath.destroy - }), + }), :padx=>4, :pady=>4) frame.grid_columnconfigure(0, :weight=>1) } @@ -40,11 +40,11 @@ # frame $twind2_text = nil -TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, +TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, 'relief'=>'sunken') {|f| $twind2_text = TkText.new(f, 'setgrid'=>true, 'font'=>$font, - # 'width'=>'70', 'height'=>35, 'wrap'=>'word', - 'width'=>'70', 'height'=>35, 'wrap'=>'char', + # 'width'=>'70', 'height'=>35, 'wrap'=>'word', + 'width'=>'70', 'height'=>35, 'wrap'=>'char', 'highlightthickness'=>0, 'borderwidth'=>0 ){|t| TkScrollbar.new(f) {|s| command proc{|*args| t.yview(*args)} @@ -54,11 +54,11 @@ }.pack('expand'=>'yes', 'fill'=>'both') # text tags -$tag2_center = TkTextTag.new($twind2_text, +$tag2_center = TkTextTag.new($twind2_text, 'justify' =>'center', 'spacing1'=>'5m', 'spacing3'=>'5m' ) -$tag2_buttons = TkTextTag.new($twind2_text, +$tag2_buttons = TkTextTag.new($twind2_text, 'lmargin1'=>'1c', 'lmargin2'=>'1c', 'rmargin' =>'1c', @@ -67,7 +67,7 @@ 'spacing3'=>0 ) # insert text -$twind2_text.insert('end', +$twind2_text.insert('end', 'A text widget can contain many different kinds of items, ') $twind2_text.insert('end', "both active and passive. It can lay these out in various ") @@ -82,7 +82,7 @@ $twind2_text.insert('end', "and they can consist of arbitrary widgets. ") $twind2_text.insert('end', "For example, here are two embedded button ") $twind2_text.insert('end', "widgets. You can click on the first button to ") -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { text 'ON' command proc{textWindOn2 $twind2_text,$twind2_buttons} @@ -91,30 +91,30 @@ $twind2_text.insert('end', " horizontal scrolling, which also turns off ") $twind2_text.insert('end', "word wrapping. Or, you can click on the second ") $twind2_text.insert('end', "button to\n") -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { text 'OFF' command proc{textWindOff2 $twind2_text} cursor 'top_left_arrow' }) -$twind2_text.insert('end', +$twind2_text.insert('end', " horizontal scrolling and turn back on word wrapping.\n\n") $twind2_text.insert('end', "Or, here is another example. If you ") -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { text 'Click Here' command proc{textWindPlot2 $twind2_text} cursor 'top_left_arrow' }) -$twind2_text.insert('end', +$twind2_text.insert('end', " a canvas displaying an x-y plot will appear right here.") $mark2_plot = TkTextMark.new($twind2_text, 'insert') $mark2_plot.gravity='left' -$twind2_text.insert('end', +$twind2_text.insert('end', " You can drag the data points around with the mouse, ") $twind2_text.insert('end', "or you can click here to ") -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { text 'Delete' command proc{textWindDel2 $twind2_text} @@ -122,19 +122,19 @@ }) $twind2_text.insert('end', " the plot again.\n\n") -$twind2_text.insert('end', +$twind2_text.insert('end', "You may also find it useful to put embedded windows in ") -$twind2_text.insert('end', +$twind2_text.insert('end', "a text without any actual text. In this case the ") $twind2_text.insert('end', "text widget acts like a geometry manager. For ") -$twind2_text.insert('end', +$twind2_text.insert('end', "example, here is a collection of buttons laid out ") -$twind2_text.insert('end', +$twind2_text.insert('end', "neatly into rows by the text widget. These buttons ") -$twind2_text.insert('end', +$twind2_text.insert('end', "can be used to change the background color of the ") $twind2_text.insert('end', "text widget (\"Default\" restores the color to ") -$twind2_text.insert('end', +$twind2_text.insert('end', "its default). If you click on the button labeled ") $twind2_text.insert('end', "\"Short\", it changes to a longer string so that ") $twind2_text.insert('end', "you can see how the text widget automatically ") @@ -148,7 +148,7 @@ } TkTextWindow.new($twind2_text, 'end', 'window'=>btn_default, 'padx'=>3) embToggle = TkVariable.new('Short') -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkCheckButton.new($twind2_text) { textvariable embToggle indicatoron 0 @@ -159,21 +159,21 @@ pady 5 padx 2 }, - 'padx'=>3, + 'padx'=>3, 'pady'=>2 ) -[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', - 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', - 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', - 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' +[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4', + 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1', + 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1', + 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4' ].each{|twind_color| - TkTextWindow.new($twind2_text, 'end', + TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { text twind_color cursor 'top_left_arrow' command proc{$twind2_text.bg twind_color} }, - 'padx'=>3, + 'padx'=>3, 'pady'=>2 ) } @@ -187,54 +187,54 @@ $twind2_text.insert('end', "\nYou can also change the usual border width and ") $twind2_text.insert('end', "highlightthickness and padding.\n") -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Big borders", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Big borders", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinBigB2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Small borders", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Small borders", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinSmallB2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Big highlight", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Big highlight", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinBigH2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', +TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text, :text=>"Small highlight", - :cursor=>'top_left_arrow', + :cursor=>'top_left_arrow', 'command'=>proc{ textWinSmallH2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Big pad", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Big pad", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinBigP2 $twind2_text })) -TkTextWindow.new($twind2_text, 'end', - 'window'=>TkButton.new($twind2_text, :text=>"Small pad", - :cursor=>'top_left_arrow', +TkTextWindow.new($twind2_text, 'end', + 'window'=>TkButton.new($twind2_text, :text=>"Small pad", + :cursor=>'top_left_arrow', 'command'=>proc{ textWinSmallP2 $twind2_text })) -$twind2_text.insert('end', +$twind2_text.insert('end', "\n\nFinally, images fit comfortably in text widgets too:") -TkTextImage.new($twind2_text, 'end', +TkTextImage.new($twind2_text, 'end', 'image'=>TkBitmapImage.new(:file=>[ - $demo_dir, '..', + $demo_dir, '..', 'images', 'face.xbm' ].join(File::Separator))) @@ -309,39 +309,39 @@ TkcLine.new($twind2_plot, 100, 250, 400, 250, 'width'=>2) TkcLine.new($twind2_plot, 100, 250, 100, 50, 'width'=>2) - TkcText.new($twind2_plot, 225, 20, + TkcText.new($twind2_plot, 225, 20, 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) TkcLine.new($twind2_plot, x, 250, x, 245, 'width'=>2) - TkcText.new($twind2_plot, x, 254, + TkcText.new($twind2_plot, x, 254, 'text'=>10*i, 'font'=>font, 'anchor'=>'n') } (0..5).each {|i| y = 250 - (i * 40) TkcLine.new($twind2_plot, 100, y, 105, y, 'width'=>2) - TkcText.new($twind2_plot, 96, y, + TkcText.new($twind2_plot, 96, y, 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e') } for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]] x = 100 + (3*xx) y = 250 - (4*yy)/5 - item = TkcOval.new($twind2_plot, x-6, y-6, x+6, y+6, + item = TkcOval.new($twind2_plot, x-6, y-6, x+6, y+6, 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2') item.addtag 'point' end - $twind2_plot.itembind('point', 'Any-Enter', + $twind2_plot.itembind('point', 'Any-Enter', proc{$twind2_plot.itemconfigure 'current', 'fill', 'red'}) - $twind2_plot.itembind('point', 'Any-Leave', + $twind2_plot.itembind('point', 'Any-Leave', proc{$twind2_plot.itemconfigure 'current', 'fill', 'SkyBlue2'}) - $twind2_plot.itembind('point', '1', + $twind2_plot.itembind('point', '1', proc{|x,y| embPlotDown2 $twind2_plot,x,y}, "%x %y") - $twind2_plot.itembind('point', 'ButtonRelease-1', + $twind2_plot.itembind('point', 'ButtonRelease-1', proc{$twind2_plot.dtag 'selected'}) - $twind2_plot.bind('B1-Motion', + $twind2_plot.bind('B1-Motion', proc{|x,y| embPlotMove2 $twind2_plot,x,y}, "%x %y") while ($twind2_text.get($mark2_plot) =~ /[ \t\n]/) $twind2_text.delete $mark2_plot Index: ext/tk/sample/demos-en/spin.rb =================================================================== --- ext/tk/sample/demos-en/spin.rb (revision 23917) +++ ext/tk/sample/demos-en/spin.rb (working copy) @@ -5,7 +5,7 @@ # based on Tcl/Tk8.4.4 widget demos if defined?($spin_demo) && $spin_demo - $spin_demo.destroy + $spin_demo.destroy $spin_demo = nil end @@ -17,8 +17,8 @@ base_frame = TkFrame.new($spin_demo).pack(:fill=>:both, :expand=>true) -TkLabel.new(base_frame, - :font=>$font, :wraplength=>'5i', :justify=>:left, +TkLabel.new(base_frame, + :font=>$font, :wraplength=>'5i', :justify=>:left, :text=><:top) Three different spin-boxes are displayed below. \ You can add characters by pointing, clicking and typing. \ @@ -50,16 +50,16 @@ } australianCities = [ - 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', + 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', 'Brisbane', 'Hobart', 'Darwin', 'Alice Springs' ] [ - TkSpinbox.new(base_frame, :from=>1, :to=>10, :width=>10, :validate=>:key, + TkSpinbox.new(base_frame, :from=>1, :to=>10, :width=>10, :validate=>:key, :validatecommand=>[ proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' - ]), - TkSpinbox.new(base_frame, :from=>0, :to=>3, :increment=>0.5, - :format=>'%05.2f', :width=>10), + ]), + TkSpinbox.new(base_frame, :from=>0, :to=>3, :increment=>0.5, + :format=>'%05.2f', :width=>10), TkSpinbox.new(base_frame, :values=>australianCities, :width=>10) ].each{|sbox| sbox.pack(:side=>:top, :pady=>5, :padx=>10)} Index: ext/tk/sample/demos-en/button.rb =================================================================== --- ext/tk/sample/demos-en/button.rb (revision 23917) +++ ext/tk/sample/demos-en/button.rb (working copy) @@ -6,20 +6,20 @@ # button widget demo (called by 'widget') # -# toplevel widget +# toplevel widget if defined?($button_demo) && $button_demo - $button_demo.destroy + $button_demo.destroy $button_demo = nil end -# demo toplevel widget +# demo toplevel widget $button_demo = TkToplevel.new {|w| title("Button Demonstration") iconname("button") positionWindow(w) } -# label +# label msg = TkLabel.new($button_demo) { font $kanji_font wraplength '4i' @@ -28,7 +28,7 @@ } msg.pack('side'=>'top') -# frame +# frame $button_buttons = Tk::Frame.new($button_demo) {|frame| TkButton.new(frame) { text 'Dismiss' Index: ext/tk/sample/demos-en/bind.rb =================================================================== --- ext/tk/sample/demos-en/bind.rb (revision 23917) +++ ext/tk/sample/demos-en/bind.rb (working copy) @@ -8,7 +8,7 @@ # toplevel widget if defined?($bind_demo) && $bind_demo - $bind_demo.destroy + $bind_demo.destroy $bind_demo = nil end @@ -38,15 +38,15 @@ }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# bind +# bind def tag_binding_for_bind_demo(tag, enter_style, leave_style) tag.bind('Any-Enter', proc{tag.configure enter_style}) tag.bind('Any-Leave', proc{tag.configure leave_style}) end -# text +# text txt = TkText.new(base_frame){|t| - # + # setgrid 'true' #width 60 #height 24 @@ -59,9 +59,9 @@ } pack('expand'=>'yes', 'fill'=>'both') - # + # if TkWinfo.depth($root).to_i > 1 - tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised', + tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised', 'borderwidth'=>1} tagstyle_normal = {'background'=>'', 'relief'=>'flat'} else @@ -77,44 +77,44 @@ insert('end', "\n\n") insert('end', '2. A simple two-dimensional plot that allows you to adjust the positions of the data points.', (d2 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '3. Anchoring and justification modes for text items.', + insert('end', '3. Anchoring and justification modes for text items.', (d3 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '4. An editor for arrow-head shapes for line items.', + insert('end', '4. An editor for arrow-head shapes for line items.', (d4 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '5. A ruler with facilities for editing tab stops.', + insert('end', '5. A ruler with facilities for editing tab stops.', (d5 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', - '6. A grid that demonstrates how canvases can be scrolled.', + insert('end', + '6. A grid that demonstrates how canvases can be scrolled.', (d6 = TkTextTag.new(t)) ) # binding [d1, d2, d3, d4, d5, d6].each{|tag| tag_binding_for_bind_demo(tag, tagstyle_bold, tagstyle_normal) } - d1.bind('1', + d1.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'items.rb'].join(File::Separator)}`, 'items.rb') }) - d2.bind('1', + d2.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`, 'plot.rb') }) - d3.bind('1', + d3.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`, 'ctext.rb') }) - d4.bind('1', + d4.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`, 'arrow.rb') }) - d5.bind('1', + d5.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`, 'ruler.rb') }) - d6.bind('1', + d6.bind('1', proc{ eval_samplecode(`cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`, 'cscroll.rb') }) Index: ext/tk/sample/tkbiff.rb =================================================================== --- ext/tk/sample/tkbiff.rb (revision 23917) +++ ext/tk/sample/tkbiff.rb (working copy) @@ -11,10 +11,10 @@ if ARGV.length == 0 if ENV['MAIL'] $spool = ENV['MAIL'] - else + else $spool = '/var/spool/mail/' + ENV['USER'] end -else +else $spool = ARGV[0] end @@ -40,7 +40,7 @@ @body = [] while line = f.gets() line.chop! - next if /^From / =~ line # skip From-line + next if /^From / =~ line # skip From-line break if /^$/ =~ line # end of header if /^(\S+):\s*(.*)/ =~ line @header[attr = $1.capitalize] = $2 Index: ext/tk/sample/tkcombobox.rb =================================================================== --- ext/tk/sample/tkcombobox.rb (revision 23917) +++ ext/tk/sample/tkcombobox.rb (working copy) @@ -1,11 +1,11 @@ # # tkcombobox.rb : TkAutoScrollbox & TkCombobox -# +# # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # require 'tk' -class TkAutoScrollbox < TkListbox +class Tk::AutoScrollListbox < TkListbox include TkComposite @@up_bmp = TkBitmapImage.new(:data=><@@up_bmp, + @up_arrow = TkLabel.new(@lbox, :image=>@@up_bmp, :relief=>:raised, :borderwidth=>1) - @down_arrow = TkLabel.new(@lbox, :image=>@@down_bmp, + @down_arrow = TkLabel.new(@lbox, :image=>@@down_bmp, :relief=>:raised, :borderwidth=>1) _init_binding @@ -78,7 +78,7 @@ def _show_down_arrow unless @down_arrow.winfo_mapped? - @down_arrow.pack(:side=>:bottom, :fill=>:x) + @down_arrow.pack(:side=>:bottom, :fill=>:x) end end @@ -91,11 +91,11 @@ def _check_sel(cidx, tidx = nil, bidx = nil) _set_sel(cidx) unless tidx - tidx = @lbox.nearest(0) + tidx = @lbox.nearest(0) tidx += 1 if tidx > 0 end unless bidx - bidx = @lbox.nearest(10000) + bidx = @lbox.nearest(10000) bidx -= 1 if bidx < @lbox.index('end') - 1 end if cidx > bidx @@ -197,7 +197,7 @@ @lbox.bind('Configure', proc{_config_proc}) @lbox.bind('Enter', proc{|y| _set_sel(@lbox.nearest(y))}, '%y') - @lbox.bind('Motion', proc{|y| + @lbox.bind('Motion', proc{|y| @up_timer.stop if @up_timer.running? @down_timer.stop if @down_timer.running? _check_sel(@lbox.nearest(y)) @@ -221,17 +221,7 @@ ################################################ -# don't use Ttk widget -Object.instance_eval{remove_const :TkCombobox} if Object.autoload? :TkCombobox - -# if you want to use the 'default_widget_set' selector, -#class TkCombobox < TkEntry; end -#Tk.__set_toplevel_aliases__(:Tk, TkCombobox, :TkCombobox) - - -################################################ - -class TkCombobox < TkEntry +class Tk::Combobox < TkEntry include TkComposite @@down_btn_bmp = TkBitmapImage.new(:data=><:raised, :borderwidth=>3, - :image=>@@down_btn_bmp).pack(:side=>:right, + @btn = TkLabel.new(@frame, :relief=>:raised, :borderwidth=>3, + :image=>@@down_btn_bmp).pack(:side=>:right, :ipadx=>2, :fill=>:y) @ent = TkEntry.new(@frame).pack(:side=>:left) @path = @ent.path @@ -322,10 +312,10 @@ startwait = keys.delete('startwait'){300} interval = keys.delete('interval'){150} - @lst = TkAutoScrollbox.new(@top, - :startwait=>startwait, - :interval=>interval).pack(:fill=>:both, - :expand=>true) + @lst = Tk::AutoScrollListbox.new(@top, + :startwait=>startwait, + :interval=>interval).pack(:fill=>:both, + :expand=>true) @ent_list = [] @var = TkVariable.new @@ -406,9 +396,9 @@ ################################################ if __FILE__ == $0 v = TkVariable.new - e = TkCombobox.new(:height=>7, :scrollbar=>true, :textvariable=>v, - :arrowrelief=>:flat, :arrowborderwidth=>0, - :startwait=>400, :interval=>200).pack + e = Tk::Combobox.new(:height=>7, :scrollbar=>true, :textvariable=>v, + :arrowrelief=>:flat, :arrowborderwidth=>0, + :startwait=>400, :interval=>200).pack e.values(%w(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu)) #e.see(e.list_index('end') - 2) e.value = 'cc' @@ -418,17 +408,18 @@ TkLabel.new(f, :font=>fnt, :textvariable=>v).pack(:side=>:left) }.pack - TkFrame.new(:relief=>:raised, :borderwidth=>2, + TkFrame.new(:relief=>:raised, :borderwidth=>2, :height=>3).pack(:fill=>:x, :expand=>true, :padx=>5, :pady=>3) - l = TkAutoScrollbox.new(nil, :relief=>:groove, :borderwidth=>4, - :width=>20).pack(:fill=>:both, :expand=>true) + l = Tk::AutoScrollListbox.new(nil, :relief=>:groove, :borderwidth=>4, + :height=>7, :width=>20).pack(:fill=>:both, + :expand=>true) (0..20).each{|i| l.insert('end', "line #{i}")} TkFrame.new(:relief=>:ridge, :borderwidth=>3){ - TkButton.new(self, :text=>'ON', + TkButton.new(self, :text=>'ON', :command=>proc{l.scrollbar(true)}).pack(:side=>:left) - TkButton.new(self, :text=>'OFF', + TkButton.new(self, :text=>'OFF', :command=>proc{l.scrollbar(false)}).pack(:side=>:right) pack(:fill=>:x) } Index: ext/tk/sample/scrollframe.rb =================================================================== --- ext/tk/sample/scrollframe.rb (revision 23917) +++ ext/tk/sample/scrollframe.rb (working copy) @@ -6,7 +6,7 @@ # When it is configured, scrollregion of the container is changed. # # Scrollbars can be toggled by Tk::ScrollFrame#vscroll & hscroll. -# If horizontal or virtical scrollbar is turned off, the horizontal +# If horizontal or virtical scrollbar is turned off, the horizontal # or virtical size of embedded widgets is propagated. # # Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) @@ -27,8 +27,8 @@ @v_scroll = TkScrollbar.new(@frame, 'orient'=>'vertical') # create a canvas widget - @canvas = TkCanvas.new(@frame, - :borderwidth=>0, :selectborderwidth=>0, + @canvas = TkCanvas.new(@frame, + :borderwidth=>0, :selectborderwidth=>0, :highlightthickness=>0) # allignment @@ -215,22 +215,31 @@ TkButton.new(f, :text=>'foo button', :command=>proc{puts 'foo'}).pack TkButton.new(f, :text=>'baaar button', :command=>proc{puts 'baaar'}).pack TkButton.new(f, :text=>'baz button', :command=>proc{puts 'baz'}).pack - TkButton.new(f, :text=>'hoge hoge button', + TkButton.new(f, :text=>'hoge hoge button', :command=>proc{puts 'hoge hoge'}).pack(:side=>:bottom) # f.hscroll(false) + # add a text widget Tk.after(3000){ t = TkText.new(f).pack(:expand=>true, :fill=>:both) - t.insert(:end, 'Here is a text widget') + t.insert(:end, "An example of Tk::ScrollFrame widget.\n\n") + t.insert(:end, "Here is a text widget.\n") + t.insert(:end, "Please resize the application window, ") + t.insert(:end, "and try the scrollbars ") + t.insert(:end, "to move the view of packed widgets.\n") } + # remove a vertical scrollbar, and then the scrollframe is not scrollable. Tk.after(6000){ f.vscroll(false) } + # add a vertical scrollbar, and make the scrollframe scrollable. Tk.after(9000){ f.vscroll(true) } + # remove a horizontal scrollbar, and then the scrollframe is not scrollable. Tk.after(12000){ f.hscroll(false) } + # add a horizontal scrollbar, and make the scrollframe scrollable. Tk.after(15000){ f.hscroll(true) } Tk.mainloop Index: ext/tk/sample/menubar2.rb =================================================================== --- ext/tk/sample/menubar2.rb (revision 23917) +++ ext/tk/sample/menubar2.rb (working copy) @@ -11,21 +11,21 @@ {:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0}, '---', ['Check_A', TkVariable.new(true), 6], - {:type=>'checkbutton', :label=>'Check_B', + {:type=>'checkbutton', :label=>'Check_B', :variable=>TkVariable.new, :underline=>6}, '---', ['Radio_X', [radio_var, 'x'], 6, '', {:foreground=>'black'}], ['Radio_Y', [radio_var, 'y'], 6], ['Radio_Z', [radio_var, 'z'], 6], '---', - ['cascade', [ - ['sss', proc{p 'sss'}, 0], - ['ttt', proc{p 'ttt'}, 0], - ['uuu', proc{p 'uuu'}, 0], - ['vvv', proc{p 'vvv'}, 0], - ], - 0, '', - {:font=>'Courier 16 italic', + ['cascade', [ + ['sss', proc{p 'sss'}, 0], + ['ttt', proc{p 'ttt'}, 0], + ['uuu', proc{p 'uuu'}, 0], + ['vvv', proc{p 'vvv'}, 0], + ], + 0, '', + {:font=>'Courier 16 italic', :menu_config=>{:font=>'Times -18 bold', :foreground=>'black'}}], '---', ['Quit', proc{exit}, 0]], @@ -33,16 +33,16 @@ [['Edit', 0], ['Cut', proc{puts('Cut clicked')}, 2], ['Copy', proc{puts('Copy clicked')}, 0], - ['Paste', proc{puts('Paste clicked')}, 0]], + ['Paste', proc{puts('Paste clicked')}, 0]], [['Help', 0, {:menu_name=>'help'}], ['About This', proc{puts('Ruby/Tk menubar sample 2')}, 6]] ] -mbar = Tk.root.add_menubar(menu_spec, +mbar = Tk.root.add_menubar(menu_spec, # followings are default configure options 'tearoff'=>'false', - 'foreground'=>'grey40', + 'foreground'=>'grey40', 'activeforeground'=>'red', 'font'=>'Helvetia 12 bold') # This (default configure options) is NOT same the following. Index: ext/tk/sample/binding_sample.rb =================================================================== --- ext/tk/sample/binding_sample.rb (revision 23917) +++ ext/tk/sample/binding_sample.rb (working copy) @@ -43,7 +43,7 @@ def invoke if @command - @command.call + @command.call else '' end @@ -53,7 +53,7 @@ TkLabel.new(:text=><v).pack(:side=>:left) }.pack -TkButton.new(:text=>'normal Button widget', +TkButton.new(:text=>'normal Button widget', :command=>proc{ puts 'button is clicked!!' lbl.text 'button is clicked!!' @@ -75,7 +75,7 @@ pack(:fill=>:x, :expand=>true) } -Button_clone.new(:text=>'Label with Button binding', +Button_clone.new(:text=>'Label with Button binding', :command=>proc{ puts 'label is clicked!!' lbl.text 'label is clicked!!' Index: ext/tk/tcltklib.c =================================================================== --- ext/tk/tcltklib.c (revision 23917) +++ ext/tk/tcltklib.c (working copy) @@ -4,15 +4,10 @@ * Oct. 24, 1997 Y. Matsumoto */ -#define TCLTKLIB_RELEASE_DATE "2008-05-23" +#define TCLTKLIB_RELEASE_DATE "2009-07-01" #include "ruby.h" -#ifdef HAVE_RUBY_SIGNAL_H -#include "ruby/signal.h" -#else -#include "rubysig.h" -#endif #ifdef HAVE_RUBY_ENCODING_H #include "ruby/encoding.h" #endif @@ -20,6 +15,19 @@ #include "version.h" #endif +#ifdef RUBY_VM +static VALUE rb_thread_critical; /* dummy */ +int rb_thread_check_trap_pending(); +#else +/* use rb_thread_critical on Ruby 1.8.x */ +#include "rubysig.h" +#endif + +#if defined(HAVE_RB_PROC_NEW) && !defined(RUBY_VM) +/* Ruby 1.8 :: rb_proc_new() was hidden from intern.h at 2008/04/22 */ +extern VALUE rb_proc_new _((VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE)); +#endif + #undef EXTERN /* avoid conflict with tcl.h of tcl8.2 or before */ #include #ifdef HAVE_STDARG_PROTOTYPES @@ -49,16 +57,16 @@ #include "stubs.h" #ifndef TCL_ALPHA_RELEASE -#define TCL_ALPHA_RELEASE 0 -#define TCL_BETA_RELEASE 1 -#define TCL_FINAL_RELEASE 2 +#define TCL_ALPHA_RELEASE 0 /* "alpha" */ +#define TCL_BETA_RELEASE 1 /* "beta" */ +#define TCL_FINAL_RELEASE 2 /* "final" */ #endif static struct { int major; int minor; + int type; /* ALPHA==0, BETA==1, FINAL==2 */ int patchlevel; - int type; } tcltk_version = {0, 0, 0, 0}; static void @@ -93,6 +101,14 @@ # endif #endif +#ifndef CONST86 +# if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 5 /* Tcl8.0.x -- 8.5.x */ +# define CONST86 +# else +# define CONST86 CONST84 +# endif +#endif + /* copied from eval.c */ #define TAG_RETURN 0x1 #define TAG_BREAK 0x2 @@ -116,7 +132,7 @@ */ /* release date */ -const char tcltklib_release_date[] = TCLTKLIB_RELEASE_DATE; +static const char tcltklib_release_date[] = TCLTKLIB_RELEASE_DATE; /* finalize_proc_name */ static const char finalize_hook_name[] = "INTERP_FINALIZE_HOOK"; @@ -193,10 +209,10 @@ /* Tcl's object type */ #if TCL_MAJOR_VERSION >= 8 static const char Tcl_ObjTypeName_ByteArray[] = "bytearray"; -static Tcl_ObjType *Tcl_ObjType_ByteArray; +static CONST86 Tcl_ObjType *Tcl_ObjType_ByteArray; static const char Tcl_ObjTypeName_String[] = "string"; -static Tcl_ObjType *Tcl_ObjType_String; +static CONST86 Tcl_ObjType *Tcl_ObjType_String; #if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1) #define IS_TCL_BYTEARRAY(obj) ((obj)->typePtr == Tcl_ObjType_ByteArray) @@ -409,11 +425,12 @@ static VALUE eventloop_thread; +static Tcl_Interp *eventloop_interp; #ifdef RUBY_USE_NATIVE_THREAD Tcl_ThreadId tk_eventloop_thread_id; /* native thread ID of Tcl interpreter */ #endif static VALUE eventloop_stack; -static int window_event_mode = ( ~ TCL_IDLE_EVENTS | TCL_WINDOW_EVENTS ); +static int window_event_mode = ~0; static VALUE watchdog_thread; @@ -425,9 +442,15 @@ : USE_TOGGLE_WINDOW_MODE_FOR_IDLE 0 : DO_THREAD_SCHEDULE_AT_CALLBACK_DONE 0 */ +#ifdef RUBY_USE_NATIVE_THREAD #define CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE 1 #define USE_TOGGLE_WINDOW_MODE_FOR_IDLE 0 +#define DO_THREAD_SCHEDULE_AT_CALLBACK_DONE 1 +#else /* ! RUBY_USE_NATIVE_THREAD */ +#define CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE 1 +#define USE_TOGGLE_WINDOW_MODE_FOR_IDLE 0 #define DO_THREAD_SCHEDULE_AT_CALLBACK_DONE 0 +#endif #if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE static int have_rb_thread_waiting_for_value = 0; @@ -443,7 +466,7 @@ #ifdef RUBY_USE_NATIVE_THREAD #define DEFAULT_EVENT_LOOP_MAX 800/*counts*/ #define DEFAULT_NO_EVENT_TICK 10/*counts*/ -#define DEFAULT_NO_EVENT_WAIT 10/*milliseconds ( 1 -- 999 ) */ +#define DEFAULT_NO_EVENT_WAIT 1/*milliseconds ( 1 -- 999 ) */ #define WATCHDOG_INTERVAL 10/*milliseconds ( 1 -- 999 ) */ #define DEFAULT_TIMER_TICK 0/*milliseconds ( 0 -- 999 ) */ #define NO_THREAD_INTERRUPT_TIME 100/*milliseconds ( 1 -- 999 ) */ @@ -456,6 +479,8 @@ #define NO_THREAD_INTERRUPT_TIME 100/*milliseconds ( 1 -- 999 ) */ #endif +#define EVENT_HANDLER_TIMEOUT 100/*milliseconds*/ + static int event_loop_max = DEFAULT_EVENT_LOOP_MAX; static int no_event_tick = DEFAULT_NO_EVENT_TICK; static int no_event_wait = DEFAULT_NO_EVENT_WAIT; @@ -1183,7 +1208,7 @@ if (RTEST(mode)) { window_event_mode = ~0; } else { - window_event_mode = ~(TCL_WINDOW_EVENTS | TCL_IDLE_EVENTS); + window_event_mode = ~TCL_WINDOW_EVENTS; } return mode; @@ -1549,6 +1574,10 @@ { struct timeval t; + if (no_event_wait <= 0) { + return Qnil; + } + t.tv_sec = (time_t)0; t.tv_usec = (long)(no_event_wait*1000.0); @@ -1613,7 +1642,54 @@ } #endif +#define TRAP_CHECK() do { \ + if (trap_check(check_var) == 0) return 0; \ +} while (0) + static int +trap_check(int *check_var) +{ + DUMP1("trap check"); + +#ifdef RUBY_VM + if (rb_thread_check_trap_pending()) { + if (check_var != (int*)NULL) { + /* wait command */ + return 0; + } + else { + rb_thread_check_ints(); + } + } +#else + if (rb_trap_pending) { + run_timer_flag = 0; + if (rb_prohibit_interrupt || check_var != (int*)NULL) { + /* pending or on wait command */ + return 0; + } else { + rb_trap_exec(); + } + } +#endif + + return 1; +} + +static int +check_eventloop_interp() +{ + DUMP1("check eventloop_interp"); + if (eventloop_interp != (Tcl_Interp*)NULL + && Tcl_InterpDeleted(eventloop_interp)) { + DUMP2("eventloop_interp(%p) was deleted", eventloop_interp); + return 1; + } + + return 0; +} + +static int lib_eventloop_core(check_root, update_flag, check_var, interp) int check_root; int update_flag; @@ -1654,6 +1730,8 @@ #endif for(;;) { + if (check_eventloop_interp()) return 0; + #if USE_EVLOOP_THREAD_ALONE_CHECK_FLAG if (thread_alone_check_flag && rb_thread_alone()) { #else @@ -1745,28 +1823,13 @@ } } - DUMP1("trap check"); - if (rb_trap_pending) { - run_timer_flag = 0; - if (rb_prohibit_interrupt || check_var != (int*)NULL) { - /* pending or on wait command */ - return 0; - } else { - rb_trap_exec(); - } - } + TRAP_CHECK(); + if (check_eventloop_interp()) return 0; - DUMP1("check Root Widget"); + DUMP1("check Root Widget"); if (check_root && tk_stubs_init_p() && Tk_GetNumMainWindows() == 0) { run_timer_flag = 0; - if (rb_trap_pending) { - if (rb_prohibit_interrupt || check_var != (int*)NULL) { - /* pending or on wait command */ - return 0; - } else { - rb_trap_exec(); - } - } + TRAP_CHECK(); return 1; } @@ -1876,16 +1939,7 @@ return 0; } - DUMP1("trap check"); - if (rb_trap_pending) { - run_timer_flag = 0; - if (rb_prohibit_interrupt || check_var != (int*)NULL) { - /* pending or on wait command */ - return 0; - } else { - rb_trap_exec(); - } - } + TRAP_CHECK(); if (check_var != (int*)NULL && !NIL_P(rbtk_pending_exception)) { @@ -1956,28 +2010,13 @@ return 1; } - DUMP1("trap check"); - if (rb_trap_pending) { - run_timer_flag = 0; - if (rb_prohibit_interrupt || check_var != (int*)NULL) { - /* pending or on wait command */ - return 0; - } else { - rb_trap_exec(); - } - } + TRAP_CHECK(); + if (check_eventloop_interp()) return 0; DUMP1("check Root Widget"); if (check_root && tk_stubs_init_p() && Tk_GetNumMainWindows() == 0) { run_timer_flag = 0; - if (rb_trap_pending) { - if (rb_prohibit_interrupt || check_var != (int*)NULL) { - /* pending or on wait command */ - return 0; - } else { - rb_trap_exec(); - } - } + TRAP_CHECK(); return 1; } @@ -2109,8 +2148,11 @@ break; } - /* if (RTEST(rb_funcall(eventloop_thread, ID_alive_p, 0, 0))) { */ +#ifdef RUBY_VM + if (RTEST(rb_funcall(eventloop_thread, ID_alive_p, 0, 0))) { +#else if (RTEST(rb_thread_alive_p(eventloop_thread))) { +#endif DUMP2("eventloop-enshure: wake up parent %lx", eventloop_thread); rb_thread_wakeup(eventloop_thread); @@ -2213,6 +2255,7 @@ VALUE *argv; VALUE self; { + volatile VALUE ret; struct tcltkip *ptr = get_ip(self); /* ip is deleted? */ @@ -2224,7 +2267,11 @@ /* slave IP */ return Qnil; } - return lib_mainloop(argc, argv, self); + + eventloop_interp = ptr->ip; + ret = lib_mainloop(argc, argv, self); + eventloop_interp = (Tcl_Interp*)NULL; + return ret; } @@ -2314,7 +2361,7 @@ { VALUE check_rootwidget; -#ifdef RUBY_USE_NATIVE_THREAD +#ifdef RUBY_VM rb_raise(rb_eNotImpError, "eventloop_watchdog is not implemented on Ruby VM."); #endif @@ -2428,8 +2475,11 @@ foundEvent = RTEST(lib_eventloop_launcher(/* not check root-widget */0, 0, q->done, (Tcl_Interp*)NULL)); - /* if (RTEST(rb_funcall(th, ID_alive_p, 0))) { */ +#ifdef RUBY_VM + if (RTEST(rb_funcall(th, ID_alive_p, 0))) { +#else if (RTEST(rb_thread_alive_p(th))) { +#endif rb_funcall(th, ID_kill, 0); ret = Qnil; } else { @@ -2807,7 +2857,6 @@ VALUE (*proc)(); VALUE data; { - int old_trapflag = rb_trap_immediate; int code; #ifdef HAVE_NATIVETHREAD @@ -2818,9 +2867,16 @@ #endif #endif - rb_trap_immediate = 0; +#ifdef RUBY_VM code = tcl_protect_core(interp, proc, data); - rb_trap_immediate = old_trapflag; +#else + do { + int old_trapflag = rb_trap_immediate; + rb_trap_immediate = 0; + code = tcl_protect_core(interp, proc, data); + rb_trap_immediate = old_trapflag; + } while (0); +#endif return code; } @@ -2915,6 +2971,7 @@ thr_crit_bup = rb_thread_critical; rb_thread_critical = Qfalse; ret = rb_apply(arg->receiver, arg->method, arg->args); + DUMP2("rb_apply return:%lx", ret); rb_thread_critical = thr_crit_bup; DUMP1("finish ip_ruby_cmd_core"); @@ -3098,26 +3155,21 @@ /* get args */ args = rb_ary_new2(argc - 2); -#ifdef HAVE_STRUCT_RARRAY_LEN - RARRAY(args)->len = 0; -#endif for(i = 3; i < argc; i++) { + VALUE s; #if TCL_MAJOR_VERSION >= 8 str = Tcl_GetStringFromObj(argv[i], &len); + s = rb_tainted_str_new(str, len); +#else /* TCL_MAJOR_VERSION < 8 */ + str = argv[i]; + s = rb_tainted_str_new2(str); +#endif DUMP2("arg:%s",str); #ifndef HAVE_STRUCT_RARRAY_LEN - rb_ary_push(args, rb_tainted_str_new(str, len)); + rb_ary_push(args, s); #else - RARRAY(args)->ptr[RARRAY(args)->len++] = rb_tainted_str_new(str, len); + RARRAY(args)->ptr[RARRAY(args)->len++] = s; #endif -#else /* TCL_MAJOR_VERSION < 8 */ - DUMP2("arg:%s",argv[i]); -#ifndef HAVE_STRUCT_RARRAY_LEN - rb_ary_push(args, rb_tainted_str_new2(argv[i])); -#else - RARRAY(args)->ptr[RARRAY(args)->len++] = rb_tainted_str_new2(argv[i]); -#endif -#endif } if (old_gc == Qfalse) rb_gc_enable(); @@ -3388,7 +3440,11 @@ } /* trap check */ +#ifdef RUBY_VM + if (rb_thread_check_trap_pending()) { +#else if (rb_trap_pending) { +#endif Tcl_Release(interp); return TCL_RETURN; @@ -3456,6 +3512,7 @@ static CONST char *updateOptions[] = {"idletasks", (char *) NULL}; enum updateOptions {REGEXP_IDLETASKS}; volatile VALUE current_thread = rb_thread_current(); + struct timeval t; DUMP1("Ruby's 'thread_update' is called"); if (interp == (Tcl_Interp*)NULL) { @@ -3543,10 +3600,17 @@ DUMP1("set idle proc"); Tcl_DoWhenIdle(rb_threadUpdateProc, (ClientData) param); + t.tv_sec = (time_t)0; + t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0); + while(!param->done) { - DUMP1("wait for complete idle proc"); - /* rb_thread_stop(); */ - rb_thread_sleep_forever(); + DUMP1("wait for complete idle proc"); + /* rb_thread_stop(); */ + /* rb_thread_sleep_forever(); */ + rb_thread_wait_for(t); + if (NIL_P(eventloop_thread)) { + break; + } } #if 0 /* use Tcl_EventuallyFree */ @@ -3754,7 +3818,11 @@ } /* trap check */ +#ifdef RUBY_VM + if (rb_thread_check_trap_pending()) { +#else if (rb_trap_pending) { +#endif #if TCL_MAJOR_VERSION >= 8 Tcl_DecrRefCount(objv[1]); #endif @@ -4043,7 +4111,11 @@ } /* trap check */ - if (rb_trap_pending) { +#ifdef RUBY_VM + if (rb_thread_check_trap_pending()) { +#else + if (rb_trap_pending) { +#endif Tcl_Release(interp); return TCL_RETURN; @@ -4103,7 +4175,11 @@ } /* trap check */ - if (rb_trap_pending) { +#ifdef RUBY_VM + if (rb_thread_check_trap_pending()) { +#else + if (rb_trap_pending) { +#endif #if TCL_MAJOR_VERSION >= 8 Tcl_DecrRefCount(objv[2]); #endif @@ -4198,7 +4274,11 @@ } /* trap check */ - if (rb_trap_pending) { +#ifdef RUBY_VM + if (rb_thread_check_trap_pending()) { +#else + if (rb_trap_pending) { +#endif Tcl_Release(interp); return TCL_RETURN; @@ -4318,6 +4398,7 @@ int ret, dummy; int thr_crit_bup; volatile VALUE current_thread = rb_thread_current(); + struct timeval t; DUMP1("Ruby's 'thread_vwait' is called"); if (interp == (Tcl_Interp*)NULL) { @@ -4412,9 +4493,16 @@ return TCL_ERROR; } + t.tv_sec = (time_t)0; + t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0); + while(!param->done) { - /* rb_thread_stop(); */ - rb_thread_sleep_forever(); + /* rb_thread_stop(); */ + /* rb_thread_sleep_forever(); */ + rb_thread_wait_for(t); + if (NIL_P(eventloop_thread)) { + break; + } } thr_crit_bup = rb_thread_critical; @@ -4473,6 +4561,7 @@ int ret, dummy; int thr_crit_bup; volatile VALUE current_thread = rb_thread_current(); + struct timeval t; DUMP1("Ruby's 'thread_tkwait' is called"); if (interp == (Tcl_Interp*)NULL) { @@ -4626,9 +4715,16 @@ return TCL_ERROR; } + t.tv_sec = (time_t)0; + t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0); + while(!param->done) { - /* rb_thread_stop(); */ - rb_thread_sleep_forever(); + /* rb_thread_stop(); */ + /* rb_thread_sleep_forever(); */ + rb_thread_wait_for(t); + if (NIL_P(eventloop_thread)) { + break; + } } thr_crit_bup = rb_thread_critical; @@ -4705,10 +4801,17 @@ rb_thread_critical = thr_crit_bup; + t.tv_sec = (time_t)0; + t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0); + while(param->done != TKWAIT_MODE_VISIBILITY) { - if (param->done == TKWAIT_MODE_DESTROY) break; - /* rb_thread_stop(); */ - rb_thread_sleep_forever(); + if (param->done == TKWAIT_MODE_DESTROY) break; + /* rb_thread_stop(); */ + /* rb_thread_sleep_forever(); */ + rb_thread_wait_for(t); + if (NIL_P(eventloop_thread)) { + break; + } } thr_crit_bup = rb_thread_critical; @@ -4820,9 +4923,16 @@ rb_thread_critical = thr_crit_bup; + t.tv_sec = (time_t)0; + t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0); + while(param->done != TKWAIT_MODE_DESTROY) { - /* rb_thread_stop(); */ - rb_thread_sleep_forever(); + /* rb_thread_stop(); */ + /* rb_thread_sleep_forever(); */ + rb_thread_wait_for(t); + if (NIL_P(eventloop_thread)) { + break; + } } Tcl_Release(window); @@ -5087,7 +5197,9 @@ } /* delete root widget */ -#if 1 +#ifdef RUBY_VM + /* cause SEGV on Ruby 1.9 */ +#else DUMP1("check `destroy'"); if (Tcl_GetCommandInfo(ip, "destroy", &info)) { DUMP1("call `destroy .'"); @@ -5504,6 +5616,7 @@ ; } + st = ruby_tcl_stubs_init(); /* from Tcl_AppInit() */ if (with_tk) { DUMP1("Tk_Init"); @@ -6214,8 +6327,13 @@ DUMP1("process it on current event-loop"); } +#ifdef RUBY_VM + if (RTEST(rb_funcall(thread, ID_alive_p, 0)) + && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { +#else if (RTEST(rb_thread_alive_p(thread)) && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { +#endif DUMP1("caller is not yet ready to receive the result -> pending"); return 0; } @@ -6264,8 +6382,11 @@ q->thread = (VALUE)NULL; /* back to caller */ - /* if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) { */ +#ifdef RUBY_VM + if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) { +#else if (RTEST(rb_thread_alive_p(thread))) { +#endif DUMP2("back to caller (caller thread:%lx)", thread); DUMP2(" (current thread:%lx)", rb_thread_current()); #if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE @@ -6303,6 +6424,7 @@ volatile VALUE ip_obj = obj; volatile VALUE result; volatile VALUE ret; + struct timeval t; if (!NIL_P(ip_obj) && rb_obj_is_kind_of(ip_obj, tcltkip_class)) { ptr = get_ip(ip_obj); @@ -6412,12 +6534,21 @@ rb_thread_critical = thr_crit_bup; /* wait for the handler to be processed */ + t.tv_sec = (time_t)0; + t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0); + DUMP2("wait for handler (current thread:%lx)", current); while(*alloc_done >= 0) { DUMP2("*** wait for handler (current thread:%lx)", current); /* rb_thread_stop(); */ - rb_thread_sleep_forever(); + /* rb_thread_sleep_forever(); */ + rb_thread_wait_for(t); DUMP2("*** wakeup (current thread:%lx)", current); + if (NIL_P(eventloop_thread)) { + DUMP1("*** lost eventloop thread"); + break; + } + DUMP2("*** wakeup (current thread:%lx)", current); } DUMP2("back from handler (current thread:%lx)", current); @@ -6688,8 +6819,13 @@ DUMP1("process it on current event-loop"); } +#ifdef RUBY_VM + if (RTEST(rb_funcall(thread, ID_alive_p, 0)) + && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { +#else if (RTEST(rb_thread_alive_p(thread)) && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { +#endif DUMP1("caller is not yet ready to receive the result -> pending"); return 0; } @@ -6742,8 +6878,11 @@ q->thread = (VALUE)NULL; /* back to caller */ - /* if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) { */ +#ifdef RUBY_VM + if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) { +#else if (RTEST(rb_thread_alive_p(thread))) { +#endif DUMP2("back to caller (caller thread:%lx)", thread); DUMP2(" (current thread:%lx)", rb_thread_current()); #if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE @@ -6782,6 +6921,7 @@ volatile VALUE result; volatile VALUE ret; Tcl_QueuePosition position; + struct timeval t; thr_crit_bup = rb_thread_critical; rb_thread_critical = Qtrue; @@ -6790,7 +6930,12 @@ #ifdef RUBY_USE_NATIVE_THREAD ptr = get_ip(ip_obj); + DUMP2("eval status: ptr->tk_thread_id %p", ptr->tk_thread_id); + DUMP2("eval status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread()); +#else + DUMP2("status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread()); #endif + DUMP2("status: eventloopt_thread %lx", eventloop_thread); if ( #ifdef RUBY_USE_NATIVE_THREAD @@ -6878,12 +7023,20 @@ rb_thread_critical = thr_crit_bup; /* wait for the handler to be processed */ + t.tv_sec = (time_t)0; + t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0); + DUMP2("wait for handler (current thread:%lx)", current); while(*alloc_done >= 0) { DUMP2("*** wait for handler (current thread:%lx)", current); /* rb_thread_stop(); */ - rb_thread_sleep_forever(); + /* rb_thread_sleep_forever(); */ + rb_thread_wait_for(t); DUMP2("*** wakeup (current thread:%lx)", current); + if (NIL_P(eventloop_thread)) { + DUMP1("*** lost eventloop thread"); + break; + } } DUMP2("back from handler (current thread:%lx)", current); @@ -6929,6 +7082,71 @@ } +static int +ip_cancel_eval_core(interp, msg, flag) + Tcl_Interp *interp; + VALUE msg; + int flag; +{ +#if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6) + rb_raise(rb_eNotImpError, + "cancel_eval is supported Tcl/Tk8.6 or later."); +#else + Tcl_Obj *msg_obj; + + if (NIL_P(msg)) { + msg_obj = NULL; + } else { + msg_obj = Tcl_NewStringObj(RSTRING_PTR(msg), RSTRING_LEN(msg)); + Tcl_IncrRefCount(msg_obj); + } + + return Tcl_CancelEval(interp, msg_obj, 0, flag); +#endif +} + +static VALUE +ip_cancel_eval(argc, argv, self) + int argc; + VALUE *argv; + VALUE self; +{ + VALUE retval; + + if (rb_scan_args(argc, argv, "01", &retval) == 0) { + retval = Qnil; + } + if (ip_cancel_eval_core(get_ip(self)->ip, retval, 0) == TCL_OK) { + return Qtrue; + } else { + return Qfalse; + } +} + +#ifndef TCL_CANCEL_UNWIND +#define TCL_CANCEL_UNWIND 0x100000 +#endif +static VALUE +ip_cancel_eval_unwind(argc, argv, self) + int argc; + VALUE *argv; + VALUE self; +{ + int flag = 0; + VALUE retval; + + if (rb_scan_args(argc, argv, "01", &retval) == 0) { + retval = Qnil; + } + + flag |= TCL_CANCEL_UNWIND; + if (ip_cancel_eval_core(get_ip(self)->ip, retval, flag) == TCL_OK) { + return Qtrue; + } else { + return Qfalse; + } +} + /* restart Tk */ static VALUE lib_restart_core(interp, argc, argv) @@ -8086,8 +8304,13 @@ DUMP1("process it on current event-loop"); } +#ifdef RUBY_VM + if (RTEST(rb_funcall(thread, ID_alive_p, 0)) + && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { +#else if (RTEST(rb_thread_alive_p(thread)) && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { +#endif DUMP1("caller is not yet ready to receive the result -> pending"); return 0; } @@ -8135,8 +8358,11 @@ q->thread = (VALUE)NULL; /* back to caller */ - /* if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) { */ +#ifdef RUBY_VM + if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) { +#else if (RTEST(rb_thread_alive_p(thread))) { +#endif DUMP2("back to caller (caller thread:%lx)", thread); DUMP2(" (current thread:%lx)", rb_thread_current()); #if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE @@ -8175,6 +8401,7 @@ volatile VALUE ip_obj = obj; volatile VALUE result; volatile VALUE ret; + struct timeval t; #if TCL_MAJOR_VERSION >= 8 Tcl_Obj **av = (Tcl_Obj **)NULL; @@ -8188,9 +8415,11 @@ #ifdef RUBY_USE_NATIVE_THREAD ptr = get_ip(ip_obj); - DUMP2("status: ptr->tk_thread_id %p", ptr->tk_thread_id); + DUMP2("invoke status: ptr->tk_thread_id %p", ptr->tk_thread_id); + DUMP2("invoke status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread()); +#else + DUMP2("status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread()); #endif - DUMP2("status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread()); DUMP2("status: eventloopt_thread %lx", eventloop_thread); if ( @@ -8273,15 +8502,24 @@ rb_thread_critical = thr_crit_bup; /* wait for the handler to be processed */ + t.tv_sec = (time_t)0; + t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0); + DUMP2("wait for handler (current thread:%lx)", current); while(*alloc_done >= 0) { - /* rb_thread_stop(); */ - rb_thread_sleep_forever(); + /* rb_thread_stop(); */ + /* rb_thread_sleep_forever(); */ + rb_thread_wait_for(t); + DUMP2("*** wakeup (current thread:%lx)", current); + if (NIL_P(eventloop_thread)) { + DUMP1("*** lost eventloop thread"); + break; + } } DUMP2("back from handler (current thread:%lx)", current); /* get result & free allocated memory */ - ret = RARRAY(result)->ptr[0]; + ret = RARRAY_PTR(result)[0]; #if 0 /* use Tcl_EventuallyFree */ Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */ #else @@ -9056,28 +9294,30 @@ lib_getversion(self) VALUE self; { - volatile VALUE type_name; + set_tcltk_version(); + return rb_ary_new3(4, INT2NUM(tcltk_version.major), + INT2NUM(tcltk_version.minor), + INT2NUM(tcltk_version.type), + INT2NUM(tcltk_version.patchlevel)); +} + +static VALUE +lib_get_reltype_name(self) + VALUE self; +{ set_tcltk_version(); switch(tcltk_version.type) { case TCL_ALPHA_RELEASE: - type_name = rb_str_new2("alpha"); - break; + return rb_str_new2("alpha"); case TCL_BETA_RELEASE: - type_name = rb_str_new2("beta"); - break; + return rb_str_new2("beta"); case TCL_FINAL_RELEASE: - type_name = rb_str_new2("final"); - break; + return rb_str_new2("final"); default: - type_name = rb_str_new2("unknown"); + rb_raise(rb_eRuntimeError, "tcltklib has invalid release type number"); } - - return rb_ary_new3(5, INT2NUM(tcltk_version.major), - INT2NUM(tcltk_version.minor), - INT2NUM(tcltk_version.type), type_name, - INT2NUM(tcltk_version.patchlevel)); } @@ -9280,14 +9520,22 @@ enc = rb_funcall(interp, ID_encoding_name, 0, 0); } } - /* 2nd: encoding system of Tcl/Tk */ + /* 2nd: Encoding.default_internal */ if (NIL_P(enc)) { + enc = rb_enc_default_internal(); + } + /* 3rd: encoding system of Tcl/Tk */ + if (NIL_P(enc)) { enc = rb_str_new2(Tcl_GetEncodingName((Tcl_Encoding)NULL)); } - /* 3rd: Encoding.default_external */ + /* 4th: Encoding.default_external */ if (NIL_P(enc)) { enc = rb_enc_default_external(); } + /* 5th: Encoding.locale_charmap */ + if (NIL_P(enc)) { + enc = rb_locale_charmap(rb_cEncoding); + } if (RTEST(rb_obj_is_kind_of(enc, cRubyEncoding))) { /* Ruby's Encoding object */ @@ -9854,6 +10102,24 @@ /* --------------------------------------------------------------- */ +#ifdef __WIN32__ +#define TK_WINDOWING_SYSTEM "win32" +#else +#ifdef MAC_TCL +#define TK_WINDOWING_SYSTEM "classic" +#else +#ifdef MAC_OSX_TK +#define TK_WINDOWING_SYSTEM "aqua" +#else +#define TK_WINDOWING_SYSTEM "x11" +#endif +#endif +#endif + rb_define_const(lib, "WINDOWING_SYSTEM", + rb_obj_freeze(rb_str_new2(TK_WINDOWING_SYSTEM))); + + /* --------------------------------------------------------------- */ + rb_define_const(ev_flag, "NONE", INT2FIX(0)); rb_define_const(ev_flag, "WINDOW", INT2FIX(TCL_WINDOW_EVENTS)); rb_define_const(ev_flag, "FILE", INT2FIX(TCL_FILE_EVENTS)); @@ -9883,6 +10149,8 @@ /* --------------------------------------------------------------- */ rb_define_module_function(lib, "get_version", lib_getversion, -1); + rb_define_module_function(lib, "get_release_type_name", + lib_get_reltype_name, -1); rb_define_const(release_type, "ALPHA", INT2FIX(TCL_ALPHA_RELEASE)); rb_define_const(release_type, "BETA", INT2FIX(TCL_BETA_RELEASE)); @@ -9997,6 +10265,8 @@ rb_define_method(ip, "has_mainwindow?", ip_has_mainwindow_p, 0); rb_define_method(ip, "invalid_namespace?", ip_has_invalid_namespace_p, 0); rb_define_method(ip, "_eval", ip_eval, 1); + rb_define_method(ip, "_cancel_eval", ip_cancel_eval, -1); + rb_define_method(ip, "_cancel_eval_unwind", ip_cancel_eval_unwind, -1); rb_define_method(ip, "_toUTF8", ip_toUTF8, -1); rb_define_method(ip, "_fromUTF8", ip_fromUTF8, -1); rb_define_method(ip, "_thread_vwait", ip_thread_vwait, 1); @@ -10059,6 +10329,7 @@ /* --------------------------------------------------------------- */ eventloop_thread = Qnil; + eventloop_interp = (Tcl_Interp*)NULL; #ifndef DEFAULT_EVENTLOOP_DEPTH #define DEFAULT_EVENTLOOP_DEPTH 7 Index: ext/tk/MANUAL_tcltklib.eucj =================================================================== --- ext/tk/MANUAL_tcltklib.eucj (revision 23917) +++ ext/tk/MANUAL_tcltklib.eucj (working copy) @@ -235,8 +235,8 @@ ¥â¥¸¥å¡¼¥ë¥á¥½¥Ã¥É get_version() - : Tcl/Tk ¤Î major, minor, release-type ÈÖ¹æ, release-type ̾, - : patchlevel ¤òÇÛÎó¤Ë¤·¤ÆÊÖ¤¹¡¥ + : Tcl/Tk ¤Î major, minor, release-type ÈÖ¹æ, patchlevel ¤ò + : ÇÛÎó¤Ë¤·¤ÆÊÖ¤¹¡¥ mainloop(check_root = true) : ¥¤¥Ù¥ó¥È¥ë¡¼¥×¤òµ¯Æ°¤¹¤ë¡¥check_root ¤¬ true ¤Ç¤¢¤ì¤Ð¡¤ @@ -464,6 +464,11 @@ : ¤·¤ÆÅÐÏ¿¤ËÀ®¸ù¤·¤µ¤¨¤¹¤ì¤Ð¡¤°Ê¹ß¤Ï _invoke ¤Ç¤âÍøÍÑ¤Ç : ¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡¥ + _cancel_eval(str) + _cancel_eval_unwind(str) + : (Tcl/Tk8.6 or later) + : Tcl_CancelEval() ´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¡¤eval ¤Î¼Â¹Ô¤òÂǤÁÀڤ롥 + _toUTF8(str, encoding=nil) _fromUTF8(str, encoding=nil) : Tcl/Tk ¤¬Æâ¢¤·¤Æ¤¤¤ë UTF8 ÊÑ´¹½èÍý¤ò¸Æ¤Ó½Ð¤¹¡¥ Index: ext/tk/README.tcltklib =================================================================== --- ext/tk/README.tcltklib (revision 23917) +++ ext/tk/README.tcltklib (working copy) @@ -1,18 +1,53 @@ To compile 'tcltklib', you must have Tcl/Tk libraries on your environment. -Although 'extconf.rb' script searches Tcl/Tk libraries and header files, +Although 'extconf.rb' script searches Tcl/Tk libraries and header files +(as default, searches tclConfig.sh/tkConfig.sh and use the defintions on +those; ActiveTcl has high priority on searching unless --without-ActiveTcl), sometimes fails to find them. And then, 'tcltklib' cannot be compiled. If Tcl/Tk libraries or header files are installed but are not found, you can give the information by arguments of the 'configure' script. Please give some or all of the following options. + --with-tk-old-extconf use old "extconf.rb" (default: false). + If current extconf.rb doesn't work properly + (or your install process is based on old + documant about Ruby/Tk install), please try + this option. + + --with-ActiveTcl / --without-ActiveTcl + --with-ActiveTcl= search ActiveTcl libraries (default: true). + When true, try to find installed ActiveTcl. + When is given, use it as the ActiveTcl's + top directory (use /lib, and so on). + Old "extconf.rb" doesn't support this option. + + --with-tk-shlib-search-path= + teach the paths for loading shared-libraries + to linker. + is a path list with the same format + as PATH environment variable. + This option may be experimental. + Old "extconf.rb" doesn't support this option. + --with-tcltkversion= force version of Tcl/Tk libaray (e.g. libtcl8.4g.so ==> --with-tcltkversion=8.4g) + --without-tcl-config / --without-tk-config + --with-tclConfig-dir= + --with-tkConfig-dir= the directory contains 'tclConfig.sh' and + 'tkConfig.sh'. + Current "extconf.rb" uses the information + on tclConfig.sh/tkConfig.rb, if possible. + Old "extconf.rb" doesn't support this option. + --with-tcllib= (e.g. libtcl8.4.so ==> --with-tcllib=tcl8.4) --with-tklib= (e.g. libtk8.4.so ==> --with-tklib=tk8.4) --enable-tcltk-stubs (if you force to enable stubs) + On old "extconf.rb", default is false. + On current "extconf.rb", default is true when + tclConfig.sh/tkConfig.sh have TCL_STUB_LIB_SPEC + /TK_STUB_LIB_SPEC, else default is false. --with-tcl-dir= equal to "--with-tcl-include=/include --with-tcl-lib=/lib" @@ -36,6 +71,12 @@ When this option is given, it is assumed that --enable-tcltk-framework option is given also. + --with-tcl-framework-dir= + Tcl framework directory (e.g. "/Library/Frameworks/Tcl.framework") + + --with-tk-framework-dir= + Tk framework directory (e.g. "/Library/Frameworks/Tk.framework") + --with-tcl-framework-header= Tcl framework headers directory (e.g. "/Library/Frameworks/Tcl.framework/Headers") Index: ext/tk/config_list.in =================================================================== --- ext/tk/config_list.in (revision 0) +++ ext/tk/config_list.in (revision 0) @@ -0,0 +1,31 @@ +with tk-old-extconf +with ActiveTcl +with tk-shlib-search-path +with tcltkversion +with tcl-config +with tk-config +with tclConfig-dir +with tkConfig-dir +with tcllib +with tklib +enable tcltk-stubs +with tcl-dir +with tk-dir +with tcl-include +with tcl-lib +with tcl-lib +with tk-lib +enable mac-tcltk-framework +enable tcltk-framework +with tcltk-framework +with tcl-framework-dir +with tk-framework-dir +with tcl-framework-header +with tk-framework-header +with X11 +with X11-dir +with X11-include +with X11-lib +enable pthread +enable tcl-thread +with tclConfig-file Index: ext/tk/lib/tk.rb =================================================================== --- ext/tk/lib/tk.rb (revision 23917) +++ ext/tk/lib/tk.rb (working copy) @@ -15,12 +15,25 @@ class TclTkIp # backup original (without encoding) _eval and _invoke alias _eval_without_enc _eval + alias __eval__ _eval alias _invoke_without_enc _invoke + alias __invoke__ _invoke def _ip_id_ # for RemoteTkIp '' end + + alias __initialize__ initialize + private :__initialize__ + + def initialize(*args) + __initialize__(*args) + + @force_default_encoding ||= [false].taint + @encoding ||= [nil].taint + def @encoding.to_s; self.join(nil); end + end end # define TkComm module (step 1: basic functions) @@ -65,7 +78,7 @@ unless const_defined?(:GET_CONFIGINFO_AS_ARRAY) # GET_CONFIGINFO_AS_ARRAY = false => returns a Hash { opt =>val, ... } # true => returns an Array [[opt,val], ... ] - # val is a list which includes resource info. + # val is a list which includes resource info. GET_CONFIGINFO_AS_ARRAY = true end unless const_defined?(:GET_CONFIGINFOwoRES_AS_ARRAY) @@ -166,7 +179,7 @@ #{classname_def} end" end - Object.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}', + Object.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}', 'without_creating'=>true)" =end base = Object @@ -181,7 +194,7 @@ #{klass}" end } - base.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}', + base.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}', 'without_creating'=>true)" end private :_genobj_for_tkwidget @@ -222,7 +235,7 @@ val.to_i when /\A\.\S*\z/ #Tk_WINDOWS[val] ? Tk_WINDOWS[val] : _genobj_for_tkwidget(val) - TkCore::INTERP.tk_windows[val]? + TkCore::INTERP.tk_windows[val]? TkCore::INTERP.tk_windows[val] : _genobj_for_tkwidget(val) when /\Ai(_\d+_)?\d+\z/ TkImage::Tk_IMGTBL.mutex.synchronize{ @@ -427,7 +440,7 @@ def tk_split_list(str, depth=0, src_enc=true, dst_enc=true) return [] if str == "" - tk_split_escstr(str).collect{|token| + tk_split_escstr(str).collect{|token| tk_split_sublist(token, depth - 1) } end @@ -573,7 +586,7 @@ def window(val) if val =~ /^\./ #Tk_WINDOWS[val]? Tk_WINDOWS[val] : _genobj_for_tkwidget(val) - TkCore::INTERP.tk_windows[val]? + TkCore::INTERP.tk_windows[val]? TkCore::INTERP.tk_windows[val] : _genobj_for_tkwidget(val) else nil @@ -602,14 +615,14 @@ val end end - private :bool, :number, :string, :num_or_str + private :bool, :number, :num_or_str, :num_or_nil, :string private :list, :simplelist, :window, :procedure - module_function :bool, :number, :num_or_str, :string + module_function :bool, :number, :num_or_str, :num_or_nil, :string module_function :list, :simplelist, :window, :image_obj, :procedure def subst(str, *opts) # opts := :nobackslashes | :nocommands | novariables - tk_call('subst', + tk_call('subst', *(opts.collect{|opt| opt = opt.to_s (opt[0] == ?-)? opt: '-' << opt @@ -667,7 +680,7 @@ else str = str.to_s() || '' unless str.kind_of? String - fail RuntimeError, "fail to convert the object to a string" + fail RuntimeError, "fail to convert the object to a string" end str = _toUTF8(str) if enc_mode end @@ -706,7 +719,7 @@ begin obj = obj.to_s || '' rescue - fail RuntimeError, "fail to convert object '#{obj}' to string" + fail RuntimeError, "fail to convert object '#{obj}' to string" end (enc_mode)? _toUTF8(obj): obj end @@ -925,7 +938,7 @@ def _bind_core(mode, what, context, cmd, *args) id = install_bind(cmd, *args) if cmd begin - tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>", + tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>", mode + id])) rescue uninstall_cmd(id) if cmd @@ -984,7 +997,7 @@ def _bind_core_for_event_class(klass, mode, what, context, cmd, *args) id = install_bind_for_event_class(klass, cmd, *args) if cmd begin - tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>", + tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>", mode + id])) rescue uninstall_cmd(id) if cmd @@ -1010,8 +1023,8 @@ private :tk_event_sequence private :_bind_core, :_bind, :_bind_append, :_bind_remove, :_bindinfo - private :_bind_core_for_event_class, :_bind_for_event_class, - :_bind_append_for_event_class, :_bind_remove_for_event_class, + private :_bind_core_for_event_class, :_bind_for_event_class, + :_bind_append_for_event_class, :_bind_remove_for_event_class, :_bindinfo_for_event_class #def bind(tagOrClass, context, cmd=Proc.new, *args) @@ -1099,13 +1112,9 @@ extend TkComm WITH_RUBY_VM = Object.const_defined?(:RubyVM) && ::RubyVM.class == Class - WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class + WITH_ENCODING = defined?(::Encoding.default_external) && true + #WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class - unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD - ### Ruby 1.9 !!!!!!!!!!!!!!!!!!!!!!!!!! - RUN_EVENTLOOP_ON_MAIN_THREAD = false - end - unless self.const_defined? :INTERP if self.const_defined? :IP_NAME name = IP_NAME.to_s @@ -1123,8 +1132,48 @@ opts = '' end + unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD + if WITH_RUBY_VM ### check Ruby 1.9 !!!!!!! + # *** NEED TO FIX *** + ip = TclTkIp.new(name, opts) + if ip._invoke_without_enc('tk', 'windowingsystem') == 'aqua' && + (TclTkLib.get_version<=>[8,4,TclTkLib::RELEASE_TYPE::FINAL,6]) > 0 + # *** KNOWN BUG *** + # Main event loop thread of TkAqua (> Tk8.4.9) must be the main + # application thread. So, ruby1.9 users must call Tk.mainloop on + # the main application thread. + # + # *** ADD (2009/05/10) *** + # In some cases (I don't know the description of conditions), + # TkAqua 8.4.7 has a same kind of hang-up trouble. + # So, if 8.4.7 or later, set RUN_EVENTLOOP_ON_MAIN_THREAD to true. + # When you want to control this mode, please call the following + # (set true/false as you want) before "require 'tk'". + # ---------------------------------------------------------- + # module TkCore; RUN_EVENTLOOP_ON_MAIN_THREAD = true; end + # ---------------------------------------------------------- + # + RUN_EVENTLOOP_ON_MAIN_THREAD = true + INTERP = ip + else + unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD + RUN_EVENTLOOP_ON_MAIN_THREAD = false + end + if RUN_EVENTLOOP_ON_MAIN_THREAD + INTERP = ip + else + ip.delete + end + end + ip = nil + + else # Ruby 1.8.x + RUN_EVENTLOOP_ON_MAIN_THREAD = false + end + end + if !WITH_RUBY_VM || RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!! - INTERP = TclTkIp.new(name, opts) + INTERP = TclTkIp.new(name, opts) unless self.const_defined? :INTERP else INTERP_MUTEX = Mutex.new INTERP_ROOT_CHECK = ConditionVariable.new @@ -1135,17 +1184,34 @@ Thread.current[:interp] = e raise e end - Thread.current[:status] = nil + + status = [nil] + def status.value + self[0] + end + def status.value=(val) + self[0] = val + end + + Thread.current[:status] = status #sleep begin - Thread.current[:status] = TclTkLib.mainloop(true) + #TclTkLib.mainloop_abort_on_exception = false + #Thread.current[:status].value = TclTkLib.mainloop(true) + interp.mainloop_abort_on_exception = false + Thread.current[:status].value = interp.mainloop(true) + rescue SystemExit=>e + Thread.current[:status].value = e rescue Exception=>e - Thread.current[:status] = e + Thread.current[:status].value = e + retry if interp.has_mainwindow? ensure INTERP_MUTEX.synchronize{ INTERP_ROOT_CHECK.broadcast } end - Thread.current[:status] = TclTkLib.mainloop(false) + + #Thread.current[:status].value = TclTkLib.mainloop(false) + Thread.current[:status].value = interp.mainloop(false) } until INTERP_THREAD[:interp] @@ -1155,11 +1221,15 @@ raise INTERP_THREAD[:interp] if INTERP_THREAD[:interp].kind_of? Exception INTERP = INTERP_THREAD[:interp] + INTERP_THREAD_STATUS = INTERP_THREAD[:status] end def INTERP.__getip self end + def INTERP.default_master? + true + end INTERP.instance_eval{ # @tk_cmd_tbl = {}.taint @@ -1180,6 +1250,10 @@ @init_ip_env = [].taint # table of Procs @add_tk_procs = [].taint # table of [name, args, body] + @force_default_encoding ||= [false].taint + @encoding ||= [nil].taint + def @encoding.to_s; self.join(nil); end + @cb_entry_class = Class.new(TkCallbackEntry){ class << self def inspect @@ -1266,10 +1340,11 @@ def INTERP.remove_tk_procs(*names) names.each{|name| name = name.to_s - @add_tk_procs.delete_if{|elem| + @add_tk_procs.delete_if{|elem| elem.kind_of?(Array) && elem[0].to_s == name } - self._invoke('rename', name, '') + #self._invoke('rename', name, '') + self.__invoke__('rename', name, '') } end def INTERP.init_ip_internal @@ -1279,8 +1354,13 @@ end end + unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD + ### Ruby 1.9 !!!!!!!!!!!!!!!!!!!!!!!!!! + RUN_EVENTLOOP_ON_MAIN_THREAD = false + end + WIDGET_DESTROY_HOOK = '' - INTERP._invoke_without_enc('event', 'add', + INTERP._invoke_without_enc('event', 'add', "<#{WIDGET_DESTROY_HOOK}>", '') INTERP._invoke_without_enc('bind', 'all', "<#{WIDGET_DESTROY_HOOK}>", install_cmd(proc{|path| @@ -1297,7 +1377,7 @@ end }) << ' %W') - INTERP.add_tk_procs(TclTkLib::FINALIZE_PROC_NAME, '', + INTERP.add_tk_procs(TclTkLib::FINALIZE_PROC_NAME, '', "catch { bind all <#{WIDGET_DESTROY_HOOK}> {} }") INTERP.add_tk_procs('rb_out', 'ns args', <<-'EOL') @@ -1400,10 +1480,10 @@ fail(e) rescue Exception => e begin - msg = _toUTF8(e.class.inspect) + ': ' + - _toUTF8(e.message) + "\n" + - "\n---< backtrace of Ruby side >-----\n" + - _toUTF8(e.backtrace.join("\n")) + + msg = _toUTF8(e.class.inspect) + ': ' + + _toUTF8(e.message) + "\n" + + "\n---< backtrace of Ruby side >-----\n" + + _toUTF8(e.backtrace.join("\n")) + "\n---< backtrace of Tk side >-------" if TkCore::WITH_ENCODING msg.force_encoding('utf-8') @@ -1411,9 +1491,9 @@ msg.instance_variable_set(:@encoding, 'utf-8') end rescue Exception - msg = e.class.inspect + ': ' + e.message + "\n" + - "\n---< backtrace of Ruby side >-----\n" + - e.backtrace.join("\n") + + msg = e.class.inspect + ': ' + e.message + "\n" + + "\n---< backtrace of Ruby side >-----\n" + + e.backtrace.join("\n") + "\n---< backtrace of Tk side >-------" end # TkCore::INTERP._set_global_var('errorInfo', msg) @@ -1426,15 +1506,15 @@ # arg = tk_split_list(arg_str) arg = tk_split_simplelist(arg_str) #_get_eval_string(TkUtil.eval_cmd(Tk_CMDTBL[arg.shift], *arg)) - #_get_eval_string(TkUtil.eval_cmd(TkCore::INTERP.tk_cmd_tbl[arg.shift], + #_get_eval_string(TkUtil.eval_cmd(TkCore::INTERP.tk_cmd_tbl[arg.shift], # *arg)) # TkCore::INTERP.tk_cmd_tbl[arg.shift].call(*arg) begin TkCore::INTERP.tk_cmd_tbl[arg.shift].call(*arg) rescue Exception => e - raise(e, e.class.inspect + ': ' + e.message + "\n" + - "\n---< backtrace of Ruby side >-----\n" + - e.backtrace.join("\n") + + raise(e, e.class.inspect + ': ' + e.message + "\n" + + "\n---< backtrace of Ruby side >-----\n" + + e.backtrace.join("\n") + "\n---< backtrace of Tk side >-------") end #=begin @@ -1452,7 +1532,7 @@ # cb_obj.call(*arg) # rescue # trace = $!.backtrace -# raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" + +# raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" + # "\tfrom #{trace[1..pos].join("\n\tfrom ")}" # end # end @@ -1642,17 +1722,36 @@ end def mainloop(check_root = true) - if !TkCore::WITH_RUBY_VM || TkCore::RUN_EVENTLOOP_ON_MAIN_THREAD + if !TkCore::WITH_RUBY_VM TclTkLib.mainloop(check_root) + + elsif TkCore::RUN_EVENTLOOP_ON_MAIN_THREAD + # if TclTkLib::WINDOWING_SYSTEM == 'aqua' && + #if TkCore::INTERP._invoke_without_enc('tk','windowingsystem')=='aqua' && + # Thread.current != Thread.main && + # (TclTkLib.get_version <=> [8,4,TclTkLib::RELEASE_TYPE::FINAL,9]) > 0 + # raise RuntimeError, + # "eventloop on TkAqua ( > Tk8.4.9 ) works on the main thread only" + #end + if Thread.current != Thread.main + raise RuntimeError, "Tk.mainloop is allowed on the main thread only" + end + TclTkLib.mainloop(check_root) + else ### Ruby 1.9 !!!!! + unless TkCore::INTERP.default_master? + # [MultiTkIp] slave interp ? + return TkCore::INTERP._thread_tkwait('window', '.') if check_root + end + begin TclTkLib.set_eventloop_window_mode(true) if check_root INTERP_MUTEX.synchronize{ INTERP_ROOT_CHECK.wait(INTERP_MUTEX) - status = INTERP_THREAD[:status] - if status - INTERP_THREAD[:status] = nil + status = INTERP_THREAD_STATUS.value + if status && TkCore::INTERP.default_master? + INTERP_THREAD_STATUS.value = nil if $SAFE < 4 raise status if status.kind_of?(Exception) end } @@ -1737,11 +1836,11 @@ if context.kind_of?(TkEvent::Event) context.generate(win, ((keys)? keys: {})) elsif keys - tk_call_without_enc('event', 'generate', win, - "<#{tk_event_sequence(context)}>", + tk_call_without_enc('event', 'generate', win, + "<#{tk_event_sequence(context)}>", *hash_kv(keys, true)) else - tk_call_without_enc('event', 'generate', win, + tk_call_without_enc('event', 'generate', win, "<#{tk_event_sequence(context)}>") end nil @@ -1846,9 +1945,9 @@ # err = $! begin args.unshift "unknown" - #res = INTERP._invoke(*args).taint - #res = INTERP._invoke(enc_mode, *args) - res = _ip_invoke_core(enc_mode, *args) + #res = INTERP._invoke(*args).taint + #res = INTERP._invoke(enc_mode, *args) + res = _ip_invoke_core(enc_mode, *args) # >>>>> _invoke returns a TAINTED string <<<<< rescue StandardError => err2 fail err2 unless /^invalid command/ =~ err2.message @@ -1930,7 +2029,7 @@ TK_MAJOR_VERSION = major.to_i TK_MINOR_VERSION = minor.to_i - JAPANIZED_TK = (INTERP._invoke_without_enc("info", "commands", + JAPANIZED_TK = (INTERP._invoke_without_enc("info", "commands", "kanji") != "").freeze def Tk.const_missing(sym) @@ -1959,14 +2058,14 @@ fail SecurityError, "can't get #{sym} when $SAFE >= 4" end INTERP._invoke_without_enc('global', 'tcl_platform') - Hash[*tk_split_simplelist(INTERP._invoke_without_enc('array', 'get', + Hash[*tk_split_simplelist(INTERP._invoke_without_enc('array', 'get', 'tcl_platform'))] when :ENV INTERP._invoke_without_enc('global', 'env') Hash[*tk_split_simplelist(INTERP._invoke('array', 'get', 'env'))] - #when :AUTO_PATH #<=== + #when :AUTO_PATH #<=== # tk_split_simplelist(INTERP._invoke('set', 'auto_path')) #when :AUTO_OLDPATH @@ -1984,7 +2083,7 @@ var_nam = 'tkPriv' end INTERP._invoke_without_enc('global', var_nam) - Hash[*tk_split_simplelist(INTERP._invoke('array', 'get', + Hash[*tk_split_simplelist(INTERP._invoke('array', 'get', var_nam))].each{|k,v| k.freeze case v @@ -2140,7 +2239,7 @@ end def Tk.exit - tk_call_without_enc('destroy', '.') + TkCore::INTERP.has_mainwindow? && tk_call_without_enc('destroy', '.') end ################################################ @@ -2211,9 +2310,9 @@ end # NOTE:: - # If no eventloop-thread is running, "thread_update" method is same - # to "update" method. Else, "thread_update" method waits to complete - # idletask operation on the eventloop-thread. + # If no eventloop-thread is running, "thread_update" method is same + # to "update" method. Else, "thread_update" method waits to complete + # idletask operation on the eventloop-thread. def Tk.thread_update(idle=nil) if idle tk_call_without_enc('thread_update', 'idletasks') @@ -2285,7 +2384,7 @@ def Tk.add_kinsoku(chars, mode='both') begin if /^8\.*/ === TK_VERSION && JAPANIZED_TK - tk_split_simplelist(tk_call('kinsoku', 'add', mode, + tk_split_simplelist(tk_call('kinsoku', 'add', mode, *(chars.split('')))) else [] @@ -2297,7 +2396,7 @@ def Tk.delete_kinsoku(chars, mode='both') begin if /^8\.*/ === TK_VERSION && JAPANIZED_TK - tk_split_simplelist(tk_call('kinsoku', 'delete', mode, + tk_split_simplelist(tk_call('kinsoku', 'delete', mode, *(chars.split('')))) end rescue @@ -2307,7 +2406,7 @@ def Tk.toUTF8(str, encoding = nil) _toUTF8(str, encoding) end - + def Tk.fromUTF8(str, encoding = nil) _fromUTF8(str, encoding) end @@ -2355,6 +2454,7 @@ BINARY_NAME = 'binary'.freeze UTF8_NAME = 'utf-8'.freeze DEFAULT_EXTERNAL_NAME = RubyEncoding.default_external.name.freeze + DEFAULT_INTERNAL_NAME = RubyEncoding.default_internal.name.freeze rescue nil BINARY = RubyEncoding.find(BINARY_NAME) UNKNOWN = RubyEncoding.find('ASCII-8BIT') @@ -2363,11 +2463,11 @@ ENCODING_TABLE = TkCore::INTERP.encoding_table =begin ENCODING_TABLE = { - 'binary' => BINARY, - # 'UNKNOWN-8BIT' => UNKNOWN, + 'binary' => BINARY, + # 'UNKNOWN-8BIT' => UNKNOWN, } - list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0], + list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0], ENCNAMES_CMD[1]) TkCore::INTERP._split_tklist(list).each{|name| begin @@ -2415,7 +2515,7 @@ end # Is it new ? - list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0], + list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0], ENCNAMES_CMD[1]) TkComm.simplelist(list).each{|name| if ((enc == RubyEncoding.find(name)) rescue false) @@ -2432,7 +2532,7 @@ # Is it new ? if (enc_obj = (RubyEncoding.find(name) rescue false)) - list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0], + list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0], ENCNAMES_CMD[1]) if TkComm.simplelist(list).index(name) # Tk's encoding name ? @@ -2492,8 +2592,9 @@ alias default_encoding encoding_name def tk_encoding_names - TkComm.simplelist(TkCore::INTERP._invoke_without_enc(Tk::Encoding::ENCNAMES_CMD[0], Tk::Encoding::ENCNAMES_CMD[1])) - end + #TkComm.simplelist(TkCore::INTERP._invoke_without_enc(Tk::Encoding::ENCNAMES_CMD[0], Tk::Encoding::ENCNAMES_CMD[1])) + TkComm.simplelist(TkCore::INTERP._invoke_without_enc('encoding', 'names')) + end def encoding_names self.tk_encoding_names.find_all{|name| Tk::Encoding::ENCODING_TABLE.get_name(name) rescue false @@ -2585,7 +2686,7 @@ else str.instance_variable_set('@encoding', 'binary') end - ret = TkCore::INTERP._invoke_without_enc('encoding', 'convertfrom', + ret = TkCore::INTERP._invoke_without_enc('encoding', 'convertfrom', enc, str) if TkCore::WITH_ENCODING ret.force_encoding('utf-8') @@ -2599,7 +2700,7 @@ def encoding_convertto(str, enc=nil) # str must be a UTF-8 string enc = encoding_system_name unless enc - ret = TkCore::INTERP._invoke_without_enc('encoding', 'convertto', + ret = TkCore::INTERP._invoke_without_enc('encoding', 'convertto', enc, str) #ret.instance_variable_set('@encoding', 'binary') if TkCore::WITH_ENCODING @@ -2626,16 +2727,16 @@ class TclTkIp def force_default_encoding=(mode) - @force_default_encoding = (mode)? true: false + @force_default_encoding[0] = (mode)? true: false end def force_default_encoding? - @force_default_encoding ||= false + @force_default_encoding[0] ||= false end def default_encoding=(name) - name = name.name if name.kind_of?(::Encoding) if Tk::WITH_ENCODING - @encoding = name + name = name.name if Tk::WITH_ENCODING && name.kind_of?(::Encoding) + @encoding[0] = name.to_s.dup end # from tkencoding.rb by ttate@jaist.ac.jp @@ -2646,16 +2747,16 @@ end def encoding_name - (@encoding)? @encoding.dup: nil + (@encoding[0])? @encoding[0].dup: nil end alias encoding encoding_name alias default_encoding encoding_name def encoding_obj if Tk::WITH_ENCODING - Tk::Encoding.tcl2rb_encoding(@encoding) + Tk::Encoding.tcl2rb_encoding(@encoding[0]) else - (@encoding)? @encoding.dup: nil + (@encoding[0])? @encoding[0].dup: nil end end @@ -2683,10 +2784,15 @@ enc_name ||= str.instance_variable_get(:@encoding) - enc_name ||= + enc_name ||= Tk::Encoding::ENCODING_TABLE.get_name(str.encoding) rescue nil - unless enc_name + if enc_name + # str has its encoding information + encstr = __toUTF8(str, enc_name) + encstr.force_encoding(Tk::Encoding::UTF8_NAME) + return encstr + else # str.encoding isn't supported by Tk -> try to convert on Ruby begin return str.encode(Tk::Encoding::UTF8_NAME) # new string @@ -2695,7 +2801,7 @@ end end - #enc_name ||= + #enc_name ||= # Tk::Encoding::ENCODING_TABLE.get_name(Tk.encoding) rescue nil enc_name ||= Tk::Encoding::ENCODING_TABLE.get_name(nil) @@ -2716,7 +2822,7 @@ def _fromUTF8(str, enc = nil) # str must be UTF-8 or binary. enc_name = str.instance_variable_get(:@encoding) - enc_name ||= + enc_name ||= Tk::Encoding::ENCODING_TABLE.get_name(str.encoding) rescue nil # is 'binary' encoding? @@ -2906,7 +3012,7 @@ end # estimate encoding - unless TkCore::WITH_ENCODING + unless TkCore::WITH_ENCODING case $KCODE when /^e/i # EUC Tk.encoding = 'euc-jp' @@ -2939,14 +3045,16 @@ end else ### Ruby 1.9 !!!!!!!!!!!! - loc_enc_obj = ::Encoding.find(::Encoding.locale_charmap) + # loc_enc_obj = (::Encoding.find(::Encoding.locale_charmap) rescue Tk::Encoding::UNKNOWN) + loc_enc_obj = ::Encoding.find("locale") ext_enc_obj = ::Encoding.default_external + int_enc_obj = ::Encoding.default_internal || ext_enc_obj tksys_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(Tk.encoding_system) # p [Tk.encoding, Tk.encoding_system, loc_enc_obj, ext_enc_obj] =begin if ext_enc_obj == Tk::Encoding::UNKNOWN - if defind? DEFAULT_TK_ENCODING + if defined? DEFAULT_TK_ENCODING if DEFAULT_TK_ENCODING.kind_of?(::Encoding) tk_enc_name = DEFAULT_TK_ENCODING.name tksys_enc_name = DEFAULT_TK_ENCODING.name @@ -3012,12 +3120,13 @@ enc_name = nil rescue ArgumentError enc_name = nil - fail ArgumentError, + fail ArgumentError, "DEFAULT_TK_ENCODING has an unknown encoding #{default_def}" end unless enc_name - if ext_enc_obj == Tk::Encoding::UNKNOWN + #if ext_enc_obj == Tk::Encoding::UNKNOWN + if int_enc_obj == Tk::Encoding::UNKNOWN if loc_enc_obj == Tk::Encoding::UNKNOWN # use Tk.encoding_system enc_name = tksys_enc_name @@ -3025,7 +3134,7 @@ # use locale_charmap begin loc_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(loc_enc_obj) - if loc_enc_name && loc_enc_name != tksys_enc_name + if loc_enc_name # use locale_charmap enc_name = loc_enc_name else @@ -3039,10 +3148,12 @@ end else begin - ext_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(ext_enc_obj) - if ext_enc_name && ext_enc_name != tksys_enc_name - # use default_external - enc_name = ext_enc_name + #ext_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(ext_enc_obj) + #if ext_enc_name && ext_enc_name != tksys_enc_name + int_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(int_enc_obj) + if int_enc_name + # use default_internal + enc_name = int_enc_name else # use Tk.encoding_system enc_name = tksys_enc_name @@ -3186,19 +3297,19 @@ if key pathname = [win, tag, key].join(';') - TkFont.used_on(pathname) || + TkFont.used_on(pathname) || TkFont.init_widget_font(pathname, *__confinfo_cmd) elsif optkeys.size == 1 pathname = [win, tag, optkeys[0]].join(';') - TkFont.used_on(pathname) || + TkFont.used_on(pathname) || TkFont.init_widget_font(pathname, *__confinfo_cmd) else fonts = {} - optkeys.each{|key| - key = key.to_s - pathname = [win, tag, key].join(';') - fonts[key] = - TkFont.used_on(pathname) || + optkeys.each{|k| + k = k.to_s + pathname = [win, tag, k].join(';') + fonts[k] = + TkFont.used_on(pathname) || TkFont.init_widget_font(pathname, *__confinfo_cmd) } fonts @@ -3228,8 +3339,8 @@ next else if fnt - if (slot.key?(l_optkey) || - slot.key?(a_optkey) || + if (slot.key?(l_optkey) || + slot.key?(a_optkey) || slot.key?(k_optkey)) fnt = TkFont.new(fnt) @@ -3240,7 +3351,7 @@ fnt.latin_replace(lfnt) if lfnt fnt.kanji_replace(kfnt) if kfnt - fnt.call_font_configure([pathname, optkey], + fnt.call_font_configure([pathname, optkey], *(__config_cmd << {})) next else @@ -3265,7 +3376,7 @@ kfnt = slot.delete(k_optkey) if lfnt && kfnt - TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey], + TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey], *(__config_cmd << {})) elsif lfnt latinfont_configure([lfnt, optkey]) @@ -3322,7 +3433,7 @@ if fobj.kind_of?(TkFont) if ltn.kind_of?(TkFont) conf = {} - ltn.latin_configinfo.each{|key,val| conf[key] = val} + ltn.latin_configinfo.each{|k,val| conf[k] = val} if keys fobj.latin_configure(conf.update(keys)) else @@ -3382,7 +3493,7 @@ if fobj.kind_of?(TkFont) if knj.kind_of?(TkFont) conf = {} - knj.kanji_configinfo.each{|key,val| conf[key] = val} + knj.kanji_configinfo.each{|k,val| conf[k] = val} if keys fobj.kanji_configure(conf.update(keys)) else @@ -3423,7 +3534,7 @@ def latinfont_copy(win, wintag=nil, winkey=nil, targetkey=nil) if targetkey - fontobj(targetkey).dup.call_font_configure([__pathname, targetkey], + fontobj(targetkey).dup.call_font_configure([__pathname, targetkey], *(__config_cmd << {})) else fontobj.dup.call_font_configure(__pathname, *(__config_cmd << {})) @@ -3448,7 +3559,7 @@ def kanjifont_copy(win, wintag=nil, winkey=nil, targetkey=nil) if targetkey - fontobj(targetkey).dup.call_font_configure([__pathname, targetkey], + fontobj(targetkey).dup.call_font_configure([__pathname, targetkey], *(__config_cmd << {})) else fontobj.dup.call_font_configure(__pathname, *(__config_cmd << {})) @@ -3500,7 +3611,7 @@ private :__confinfo_cmd def __configinfo_struct - {:key=>0, :alias=>1, :db_name=>1, :db_class=>2, + {:key=>0, :alias=>1, :db_name=>1, :db_class=>2, :default_value=>3, :current_value=>4} end private :__configinfo_struct @@ -3527,10 +3638,10 @@ def __strval_optkeys [ - 'text', 'label', 'show', 'data', 'file', - 'activebackground', 'activeforeground', 'background', - 'disabledforeground', 'disabledbackground', 'foreground', - 'highlightbackground', 'highlightcolor', 'insertbackground', + 'text', 'label', 'show', 'data', 'file', + 'activebackground', 'activeforeground', 'background', + 'disabledforeground', 'disabledbackground', 'foreground', + 'highlightbackground', 'highlightcolor', 'insertbackground', 'selectbackground', 'selectforeground', 'troughcolor' ] end @@ -3616,11 +3727,17 @@ val end + def cget_tkstring(option) + opt = option.to_s + fail ArgumentError, "Invalid option `#{option.inspect}'" if opt.length == 0 + tk_call_without_enc(*(__cget_cmd << "-#{opt}")) + end + def __cget_core(slot) orig_slot = slot slot = slot.to_s - - if slot.length == 0 + + if slot.length == 0 fail ArgumentError, "Invalid option `#{orig_slot.inspect}'" end @@ -3846,12 +3963,12 @@ def __configinfo_core(slot = nil) if TkComm::GET_CONFIGINFO_AS_ARRAY - if (slot && + if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__font_optkeys.join('|')})$/) fontkey = $2 # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{fontkey}")))) conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{fontkey}")), false, true) - conf[__configinfo_struct[:key]] = + conf[__configinfo_struct[:key]] = conf[__configinfo_struct[:key]][1..-1] if ( ! __configinfo_struct[:alias] \ || conf.size > __configinfo_struct[:alias] + 1 ) @@ -3863,7 +3980,7 @@ elsif ( __configinfo_struct[:alias] \ && conf.size == __configinfo_struct[:alias] + 1 \ && conf[__configinfo_struct[:alias]][0] == ?- ) - conf[__configinfo_struct[:alias]] = + conf[__configinfo_struct[:alias]] = conf[__configinfo_struct[:alias]][1..-1] end conf @@ -3913,7 +4030,7 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]]) begin - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = number(conf[__configinfo_struct[:default_value]]) rescue conf[__configinfo_struct[:default_value]] = nil @@ -3921,7 +4038,7 @@ end if ( conf[__configinfo_struct[:current_value]] ) begin - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = number(conf[__configinfo_struct[:current_value]]) rescue conf[__configinfo_struct[:current_value]] = nil @@ -3934,11 +4051,11 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]]) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = num_or_str(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = num_or_str(conf[__configinfo_struct[:current_value]]) end @@ -3949,7 +4066,7 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]]) begin - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = bool(conf[__configinfo_struct[:default_value]]) rescue conf[__configinfo_struct[:default_value]] = nil @@ -3957,7 +4074,7 @@ end if ( conf[__configinfo_struct[:current_value]] ) begin - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = bool(conf[__configinfo_struct[:current_value]]) rescue conf[__configinfo_struct[:current_value]] = nil @@ -3970,11 +4087,11 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]]) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = simplelist(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = simplelist(conf[__configinfo_struct[:current_value]]) end @@ -3985,12 +4102,12 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] \ && conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = list(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] \ && conf[__configinfo_struct[:current_value]] =~ /^[0-9]/ ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = list(conf[__configinfo_struct[:current_value]]) end @@ -4021,15 +4138,16 @@ else # conf = tk_split_list(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")))) - conf = tk_split_list(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), 0, false, true) + # conf = tk_split_list(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), 0, false, true) + conf = tk_split_list(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), 1, false, true) end - conf[__configinfo_struct[:key]] = + conf[__configinfo_struct[:key]] = conf[__configinfo_struct[:key]][1..-1] if ( __configinfo_struct[:alias] \ && conf.size == __configinfo_struct[:alias] + 1 \ && conf[__configinfo_struct[:alias]][0] == ?- ) - conf[__configinfo_struct[:alias]] = + conf[__configinfo_struct[:alias]] = conf[__configinfo_struct[:alias]][1..-1] end @@ -4040,7 +4158,7 @@ # conf = tk_split_simplelist(conflist) ret = tk_split_simplelist(tk_call_without_enc(*__confinfo_cmd), false, false).collect{|conflist| conf = tk_split_simplelist(conflist, false, true) - conf[__configinfo_struct[:key]] = + conf[__configinfo_struct[:key]] = conf[__configinfo_struct[:key]][1..-1] optkey = conf[__configinfo_struct[:key]] @@ -4076,7 +4194,7 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) begin - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = number(conf[__configinfo_struct[:default_value]]) rescue conf[__configinfo_struct[:default_value]] = nil @@ -4084,7 +4202,7 @@ end if ( conf[__configinfo_struct[:current_value]] ) begin - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = number(conf[__configinfo_struct[:current_value]]) rescue conf[__configinfo_struct[:current_value]] = nil @@ -4094,11 +4212,11 @@ when /^(#{__numstrval_optkeys.join('|')})$/ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = num_or_str(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = num_or_str(conf[__configinfo_struct[:current_value]]) end @@ -4106,7 +4224,7 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) begin - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = bool(conf[__configinfo_struct[:default_value]]) rescue conf[__configinfo_struct[:default_value]] = nil @@ -4114,7 +4232,7 @@ end if ( conf[__configinfo_struct[:current_value]] ) begin - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = bool(conf[__configinfo_struct[:current_value]]) rescue conf[__configinfo_struct[:current_value]] = nil @@ -4124,11 +4242,11 @@ when /^(#{__listval_optkeys.join('|')})$/ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = simplelist(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = simplelist(conf[__configinfo_struct[:current_value]]) end @@ -4136,12 +4254,12 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] \ && conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = list(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] \ && conf[__configinfo_struct[:current_value]] =~ /^[0-9]/ ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = list(conf[__configinfo_struct[:current_value]]) end @@ -4168,20 +4286,20 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) if conf[__configinfo_struct[:default_value]].index('{') - conf[__configinfo_struct[:default_value]] = - tk_split_list(conf[__configinfo_struct[:default_value]]) + conf[__configinfo_struct[:default_value]] = + tk_split_list(conf[__configinfo_struct[:default_value]]) else - conf[__configinfo_struct[:default_value]] = - tk_tcl2ruby(conf[__configinfo_struct[:default_value]]) + conf[__configinfo_struct[:default_value]] = + tk_tcl2ruby(conf[__configinfo_struct[:default_value]]) end end if conf[__configinfo_struct[:current_value]] if conf[__configinfo_struct[:current_value]].index('{') - conf[__configinfo_struct[:current_value]] = - tk_split_list(conf[__configinfo_struct[:current_value]]) + conf[__configinfo_struct[:current_value]] = + tk_split_list(conf[__configinfo_struct[:current_value]]) else - conf[__configinfo_struct[:current_value]] = - tk_tcl2ruby(conf[__configinfo_struct[:current_value]]) + conf[__configinfo_struct[:current_value]] = + tk_tcl2ruby(conf[__configinfo_struct[:current_value]]) end end end @@ -4189,7 +4307,7 @@ if ( __configinfo_struct[:alias] \ && conf.size == __configinfo_struct[:alias] + 1 \ && conf[__configinfo_struct[:alias]][0] == ?- ) - conf[__configinfo_struct[:alias]] = + conf[__configinfo_struct[:alias]] = conf[__configinfo_struct[:alias]][1..-1] end @@ -4211,8 +4329,8 @@ end } - __methodcall_optkeys.each{|optkey, method| - ret << [optkey.to_s, '', '', '', self.__send__(method)] + __methodcall_optkeys.each{|optkey, m| + ret << [optkey.to_s, '', '', '', self.__send__(m)] } ret @@ -4220,12 +4338,12 @@ end else # ! TkComm::GET_CONFIGINFO_AS_ARRAY - if (slot && + if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__font_optkeys.join('|')})$/) fontkey = $2 # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{fontkey}")))) conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{fontkey}")), false, true) - conf[__configinfo_struct[:key]] = + conf[__configinfo_struct[:key]] = conf[__configinfo_struct[:key]][1..-1] if ( ! __configinfo_struct[:alias] \ @@ -4239,7 +4357,7 @@ elsif ( __configinfo_struct[:alias] \ && conf.size == __configinfo_struct[:alias] + 1 ) if conf[__configinfo_struct[:alias]][0] == ?- - conf[__configinfo_struct[:alias]] = + conf[__configinfo_struct[:alias]] = conf[__configinfo_struct[:alias]][1..-1] end { conf[0] => conf[1] } @@ -4250,7 +4368,7 @@ if slot slot = slot.to_s - alias_name, real_name = __optkey_aliases.find{|k, v| k.to_s == slot} + alias_name, real_name = __optkey_aliases.find{|k,var| k.to_s == slot} if real_name slot = real_name.to_s end @@ -4292,7 +4410,7 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) begin - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = number(conf[__configinfo_struct[:default_value]]) rescue conf[__configinfo_struct[:default_value]] = nil @@ -4300,7 +4418,7 @@ end if ( conf[__configinfo_struct[:current_value]] ) begin - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = number(conf[__configinfo_struct[:current_value]]) rescue conf[__configinfo_struct[:current_value]] = nil @@ -4313,11 +4431,11 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = num_or_str(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = num_or_str(conf[__configinfo_struct[:current_value]]) end @@ -4328,7 +4446,7 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) begin - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = bool(conf[__configinfo_struct[:default_value]]) rescue conf[__configinfo_struct[:default_value]] = nil @@ -4336,7 +4454,7 @@ end if ( conf[__configinfo_struct[:current_value]] ) begin - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = bool(conf[__configinfo_struct[:current_value]]) rescue conf[__configinfo_struct[:current_value]] = nil @@ -4349,11 +4467,11 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = simplelist(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = simplelist(conf[__configinfo_struct[:current_value]]) end @@ -4364,12 +4482,12 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] \ && conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = list(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] \ && conf[__configinfo_struct[:current_value]] =~ /^[0-9]/ ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = list(conf[__configinfo_struct[:current_value]]) end @@ -4401,13 +4519,13 @@ # conf = tk_split_list(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")))) conf = tk_split_list(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), 0, false, true) end - conf[__configinfo_struct[:key]] = + conf[__configinfo_struct[:key]] = conf[__configinfo_struct[:key]][1..-1] if ( __configinfo_struct[:alias] \ && conf.size == __configinfo_struct[:alias] + 1 ) if conf[__configinfo_struct[:alias]][0] == ?- - conf[__configinfo_struct[:alias]] = + conf[__configinfo_struct[:alias]] = conf[__configinfo_struct[:alias]][1..-1] end { conf[0] => conf[1] } @@ -4421,7 +4539,7 @@ # conf = tk_split_simplelist(conflist) tk_split_simplelist(tk_call_without_enc(*__confinfo_cmd), false, false).each{|conflist| conf = tk_split_simplelist(conflist, false, true) - conf[__configinfo_struct[:key]] = + conf[__configinfo_struct[:key]] = conf[__configinfo_struct[:key]][1..-1] optkey = conf[__configinfo_struct[:key]] @@ -4457,7 +4575,7 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) begin - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = number(conf[__configinfo_struct[:default_value]]) rescue conf[__configinfo_struct[:default_value]] = nil @@ -4465,7 +4583,7 @@ end if ( conf[__configinfo_struct[:current_value]] ) begin - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = number(conf[__configinfo_struct[:current_value]]) rescue conf[__configinfo_struct[:current_value]] = nil @@ -4475,11 +4593,11 @@ when /^(#{__numstrval_optkeys.join('|')})$/ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = num_or_str(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = num_or_str(conf[__configinfo_struct[:current_value]]) end @@ -4487,7 +4605,7 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) begin - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = bool(conf[__configinfo_struct[:default_value]]) rescue conf[__configinfo_struct[:default_value]] = nil @@ -4495,7 +4613,7 @@ end if ( conf[__configinfo_struct[:current_value]] ) begin - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = bool(conf[__configinfo_struct[:current_value]]) rescue conf[__configinfo_struct[:current_value]] = nil @@ -4505,11 +4623,11 @@ when /^(#{__listval_optkeys.join('|')})$/ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = simplelist(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = simplelist(conf[__configinfo_struct[:current_value]]) end @@ -4517,12 +4635,12 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] \ && conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ ) - conf[__configinfo_struct[:default_value]] = + conf[__configinfo_struct[:default_value]] = list(conf[__configinfo_struct[:default_value]]) end if ( conf[__configinfo_struct[:current_value]] \ && conf[__configinfo_struct[:current_value]] =~ /^[0-9]/ ) - conf[__configinfo_struct[:current_value]] = + conf[__configinfo_struct[:current_value]] = list(conf[__configinfo_struct[:current_value]]) end @@ -4549,20 +4667,20 @@ if ( __configinfo_struct[:default_value] \ && conf[__configinfo_struct[:default_value]] ) if conf[__configinfo_struct[:default_value]].index('{') - conf[__configinfo_struct[:default_value]] = - tk_split_list(conf[__configinfo_struct[:default_value]]) + conf[__configinfo_struct[:default_value]] = + tk_split_list(conf[__configinfo_struct[:default_value]]) else - conf[__configinfo_struct[:default_value]] = - tk_tcl2ruby(conf[__configinfo_struct[:default_value]]) + conf[__configinfo_struct[:default_value]] = + tk_tcl2ruby(conf[__configinfo_struct[:default_value]]) end end if conf[__configinfo_struct[:current_value]] if conf[__configinfo_struct[:current_value]].index('{') - conf[__configinfo_struct[:current_value]] = - tk_split_list(conf[__configinfo_struct[:current_value]]) + conf[__configinfo_struct[:current_value]] = + tk_split_list(conf[__configinfo_struct[:current_value]]) else - conf[__configinfo_struct[:current_value]] = - tk_tcl2ruby(conf[__configinfo_struct[:current_value]]) + conf[__configinfo_struct[:current_value]] = + tk_tcl2ruby(conf[__configinfo_struct[:current_value]]) end end end @@ -4570,7 +4688,7 @@ if ( __configinfo_struct[:alias] \ && conf.size == __configinfo_struct[:alias] + 1 ) if conf[__configinfo_struct[:alias]][0] == ?- - conf[__configinfo_struct[:alias]] = + conf[__configinfo_struct[:alias]] = conf[__configinfo_struct[:alias]][1..-1] end ret[conf[0]] = conf[1] @@ -4597,8 +4715,8 @@ end } - __methodcall_optkeys.each{|optkey, method| - ret[optkey.to_s] = ['', '', '', self.__send__(method)] + __methodcall_optkeys.each{|optkey, m| + ret[optkey.to_s] = ['', '', '', self.__send__(m)] } ret @@ -4632,22 +4750,22 @@ end slot = conf[__configinfo_struct[:alias]] end while(org_slot != slot) - fail RuntimeError, + fail RuntimeError, "there is a configure alias loop about '#{org_slot}'" else ret = {} - configinfo().each{|conf| + configinfo().each{|cnf| if ( ! __configinfo_struct[:alias] \ - || conf.size > __configinfo_struct[:alias] + 1 ) - ret[conf[0]] = conf[-1] + || cnf.size > __configinfo_struct[:alias] + 1 ) + ret[cnf[0]] = cnf[-1] end } ret end else # ! TkComm::GET_CONFIGINFO_AS_ARRAY ret = {} - configinfo(slot).each{|key, conf| - ret[key] = conf[-1] if conf.kind_of?(Array) + configinfo(slot).each{|key, cnf| + ret[key] = cnf[-1] if cnf.kind_of?(Array) } ret end @@ -4719,13 +4837,13 @@ cget(name) rescue if self.kind_of?(TkWindow) - fail NameError, + fail NameError, "unknown option '#{id}' for #{self.inspect} (deleted widget?)" else super(id, *args) end -# fail NameError, -# "undefined local variable or method `#{name}' for #{self.to_s}", +# fail NameError, +# "undefined local variable or method `#{name}' for #{self.to_s}", # error_at end else @@ -4749,14 +4867,14 @@ if context.kind_of?(TkEvent::Event) context.generate(self, ((keys)? keys: {})) elsif keys - #tk_call('event', 'generate', path, + #tk_call('event', 'generate', path, # "<#{tk_event_sequence(context)}>", *hash_kv(keys)) - tk_call_without_enc('event', 'generate', path, - "<#{tk_event_sequence(context)}>", + tk_call_without_enc('event', 'generate', path, + "<#{tk_event_sequence(context)}>", *hash_kv(keys, true)) else #tk_call('event', 'generate', path, "<#{tk_event_sequence(context)}>") - tk_call_without_enc('event', 'generate', path, + tk_call_without_enc('event', 'generate', path, "<#{tk_event_sequence(context)}>") end end @@ -4779,6 +4897,7 @@ include TkWinfo extend TkBindCore include Tk::Wm_for_General + include Tk::Busy @@WIDGET_INSPECT_FULL = false def TkWindow._widget_inspect_full_? @@ -4789,10 +4908,10 @@ end TkCommandNames = [].freeze - ## ==> If TkCommandNames[0] is a string (not a null string), - ## assume the string is a Tcl/Tk's create command of the widget class. + ## ==> If TkCommandNames[0] is a string (not a null string), + ## assume the string is a Tcl/Tk's create command of the widget class. WidgetClassName = ''.freeze - # WidgetClassNames[WidgetClassName] = self + # WidgetClassNames[WidgetClassName] = self ## ==> If self is a widget class, entry to the WidgetClassNames table. def self.to_eval self::WidgetClassName @@ -4805,8 +4924,8 @@ widgetname = keys.delete('widgetname') install_win(if parent then parent.path end, widgetname) without_creating = keys.delete('without_creating') - # if without_creating && !widgetname - # fail ArgumentError, + # if without_creating && !widgetname + # fail ArgumentError, # "if set 'without_creating' to true, need to define 'widgetname'" # end elsif keys @@ -4814,8 +4933,8 @@ widgetname = keys.delete('widgetname') install_win(if parent then parent.path end, widgetname) without_creating = keys.delete('without_creating') - # if without_creating && !widgetname - # fail ArgumentError, + # if without_creating && !widgetname + # fail ArgumentError, # "if set 'without_creating' to true, need to define 'widgetname'" # end else @@ -4907,7 +5026,7 @@ tk_call_without_enc('destroy', @path) rescue # cannot rescue options error - fail e + fail e else # re-create widget tk_call_without_enc(cmd, @path, *hash_kv(keys, true)) @@ -5212,7 +5331,7 @@ # conf[0] = conf[0][1..-1] # conf #else - # tk_split_simplelist(tk_call('place', + # tk_split_simplelist(tk_call('place', # 'configure', epath)).collect{|conflist| # conf = tk_split_simplelist(conflist) # conf[0] = conf[0][1..-1] @@ -5422,7 +5541,7 @@ taglist else list(tk_call('bindtags', path)).collect{|tag| - if tag.kind_of?(String) + if tag.kind_of?(String) if cls = WidgetClassNames[tag] cls elsif btag = TkBindTag.id2obj(tag) @@ -5466,7 +5585,7 @@ #Tk.freeze module Tk - RELEASE_DATE = '2008-12-04'.freeze + RELEASE_DATE = '2009-07-01'.freeze autoload :AUTO_PATH, 'tk/variable' autoload :TCL_PACKAGE_PATH, 'tk/variable' Index: ext/tk/lib/tcltk.rb =================================================================== --- ext/tk/lib/tcltk.rb (revision 23917) +++ ext/tk/lib/tcltk.rb (working copy) @@ -84,7 +84,7 @@ # class TclTkInterpreter: tcl/tk interpreter class TclTkInterpreter - # initialize(): + # initialize(): def initialize() # generate interpreter object @ip = TclTkIp.new() @@ -181,7 +181,7 @@ # class TclTkObject: base class of the tcl/tk objects class TclTkObject - # initialize(ip, exp): + # initialize(ip, exp): # ip: interpreter(TclTkIp) # exp: tcl/tk representation def initialize(ip, exp) @@ -211,7 +211,7 @@ # class TclTkLibCommand: tcl/tk commands in the library class TclTkLibCommand < TclTkCommand - # initialize(ip, name): + # initialize(ip, name): # ip: interpreter(TclTkInterpreter) # name: command name (String) def initialize(ip, name) @@ -222,7 +222,7 @@ # class TclTkVariable: tcl/tk variable class TclTkVariable < TclTkObject - # initialize(interp, dat): + # initialize(interp, dat): # interp: interpreter(TclTkInterpreter) # dat: the value to set(String) # if nil, not initialize variable @@ -255,7 +255,7 @@ # class TclTkWidget: tcl/tk widget class TclTkWidget < TclTkCommand - # initialize(*args): + # initialize(*args): # *args: parameters def initialize(*args) if args[0].kind_of?(TclTkIp) @@ -281,7 +281,7 @@ # interp: interpreter(TclTkInterpreter) # parent: parent widget # command: widget generating tk command(label Åù) - # *args: argument to the command + # *args: argument to the command interp, parent, command, *args = args # generate widget name @@ -303,14 +303,14 @@ # class TclTkCallback: tcl/tk callbacks class TclTkCallback < TclTkObject - # initialize(interp, pr, arg): + # initialize(interp, pr, arg): # interp: interpreter(TclTkInterpreter) # pr: callback procedure(Proc) # arg: string to pass as block parameters of pr # bind command of tcl/tk uses % replacement for parameters # pr can receive replaced data using block parameter # its format is specified by arg string - # You should not specify arg for the command like + # You should not specify arg for the command like # scrollbar with -command option, which receives parameters # without specifying any replacement def initialize(interp, pr, arg = nil) @@ -347,7 +347,7 @@ # class TclTkImage: tcl/tk images class TclTkImage < TclTkCommand - # initialize(interp, t, *args): + # initialize(interp, t, *args): # generating image is done by TclTkImage.new() # destrying is done by image delete (inconsistent, sigh) # interp: interpreter(TclTkInterpreter) Index: ext/tk/lib/tkextlib/iwidgets/hierarchy.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/hierarchy.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/hierarchy.rb (working copy) @@ -64,15 +64,15 @@ class IndicatorCommand < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst - KEY_TBL = [ - [ ?n, ?s, :node ], - [ ?s, ?b, :status ], + KEY_TBL = [ + [ ?n, ?s, :node ], + [ ?s, ?b, :status ], nil ] - PROC_TBL = [ - [ ?s, TkComm.method(:string) ], - [ ?b, TkComm.method(:bool) ], + PROC_TBL = [ + [ ?s, TkComm.method(:string) ], + [ ?b, TkComm.method(:bool) ], nil ] @@ -109,9 +109,9 @@ class IconCommand < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst - KEY_TBL = [ - [ ?n, ?s, :node ], - [ ?i, ?s, :icon ], + KEY_TBL = [ + [ ?n, ?s, :node ], + [ ?i, ?s, :icon ], nil ] PROC_TBL = [ [ ?s, TkComm.method(:string) ], nil ] @@ -270,7 +270,7 @@ end def compare(idx1, op, idx2) - bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1), + bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1), op, _get_eval_enc_str(idx2))) end Index: ext/tk/lib/tkextlib/iwidgets/spinner.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/spinner.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/spinner.rb (working copy) @@ -25,16 +25,16 @@ class EntryfieldValidate < TkValidateCommand #class CalCmdArgs < TkUtil::CallbackSubst class ValidateArgs < TkUtil::CallbackSubst - KEY_TBL = [ - [ ?c, ?s, :char ], - [ ?P, ?s, :post ], - [ ?S, ?s, :current ], - [ ?W, ?w, :widget ], + KEY_TBL = [ + [ ?c, ?s, :char ], + [ ?P, ?s, :post ], + [ ?S, ?s, :current ], + [ ?W, ?w, :widget ], nil ] - PROC_TBL = [ - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], + PROC_TBL = [ + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], nil ] Index: ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb (working copy) @@ -20,7 +20,7 @@ def __strval_optkeys super() + [ - 'dirslabel', 'fileslabel', 'filterlabel', 'mask', 'nomatchstring', + 'dirslabel', 'fileslabel', 'filterlabel', 'mask', 'nomatchstring', 'selectionlabel' ] end Index: ext/tk/lib/tkextlib/iwidgets/tabset.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/tabset.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/tabset.rb (working copy) @@ -41,13 +41,14 @@ end end + alias tabcget_tkstring itemcget_tkstring alias tabcget itemcget alias tabcget_strict itemcget_strict alias tabconfigure itemconfigure alias tabconfiginfo itemconfiginfo alias current_tabconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### @@ -116,9 +117,9 @@ return end tabs_size = @canvas.winfo_width - tab_start, tab_end = @canvas . - find_overlapping(head, 0, head + delta, @canvas.winfo_height) . - find_all{|id| @canvas.itemtype(id) == TkcPolygon} . + tab_start, tab_end = @canvas . + find_overlapping(head, 0, head + delta, @canvas.winfo_height) . + find_all{|id| @canvas.itemtype(id) == TkcPolygon} . map!{|id| bbox = @canvas.bbox(id); [bbox[0], bbox[2]]} . max when 'e', 'w' @@ -127,9 +128,9 @@ return end tabs_size = @canvas.winfo_height - tab_start, tab_end = @canvas . - find_overlapping(0, head, @canvas.winfo_width, head + delta) . - find_all{|id| @canvas.itemtype(id) == TkcPolygon} . + tab_start, tab_end = @canvas . + find_overlapping(0, head, @canvas.winfo_width, head + delta) . + find_all{|id| @canvas.itemtype(id) == TkcPolygon} . map!{|id| bbox = @canvas.bbox(id); [bbox[1], bbox[3]]} . max end Index: ext/tk/lib/tkextlib/iwidgets/buttonbox.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/buttonbox.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/buttonbox.rb (working copy) @@ -46,13 +46,14 @@ end end + alias buttoncget_tkstring itemcget_tkstring alias buttoncget itemcget alias buttoncget_strict itemcget_strict alias buttonconfigure itemconfigure alias buttonconfiginfo itemconfiginfo alias current_buttonconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### Index: ext/tk/lib/tkextlib/iwidgets/dialogshell.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/dialogshell.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/dialogshell.rb (working copy) @@ -46,13 +46,14 @@ end end + alias buttoncget_tkstring itemcget_tkstring alias buttoncget itemcget alias buttoncget_strict itemcget_strict alias buttonconfigure itemconfigure alias buttonconfiginfo itemconfiginfo alias current_buttonconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### Index: ext/tk/lib/tkextlib/iwidgets/menubar.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/menubar.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/menubar.rb (working copy) @@ -61,13 +61,14 @@ end end + alias menucget_tkstring itemcget_tkstring alias menucget itemcget alias menucget_strict itemcget_strict alias menuconfigure itemconfigure alias menuconfiginfo itemconfiginfo alias current_menuconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### Index: ext/tk/lib/tkextlib/iwidgets/messagebox.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/messagebox.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/messagebox.rb (working copy) @@ -46,13 +46,14 @@ end private :__item_boolval_optkeys + alias typecget_tkstring itemcget_tkstring alias typecget itemcget alias typecget_strict itemcget_strict alias typeconfigure itemconfigure alias typeconfiginfo itemconfiginfo alias current_typeconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### Index: ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb (working copy) @@ -20,7 +20,7 @@ def __strval_optkeys super() + [ - 'directory', 'dirslabel', 'fileslabel', 'filterlabel', 'mask', + 'directory', 'dirslabel', 'fileslabel', 'filterlabel', 'mask', 'nomatchstring', 'selectionlabel' ] end Index: ext/tk/lib/tkextlib/iwidgets/setup.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/iwidgets/toolbar.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/toolbar.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/toolbar.rb (working copy) @@ -105,7 +105,7 @@ else tag = Tk::Itk::Component.new(self) end - window(tk_call(@path, 'insert', index(idx), type, + window(tk_call(@path, 'insert', index(idx), type, tagid(tag), *hash_kv(keys))) tag end Index: ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb (working copy) @@ -103,7 +103,7 @@ end def bbox(tagOrId, *tags) - list(tk_send_without_enc('bbox', tagid(tagOrId), + list(tk_send_without_enc('bbox', tagid(tagOrId), *tags.collect{|t| tagid(t)})) end @@ -165,7 +165,7 @@ end def dchars(tag, first, last=None) - tk_send_without_enc('dchars', tagid(tag), + tk_send_without_enc('dchars', tagid(tag), _get_eval_enc_str(first), _get_eval_enc_str(last)) self end @@ -176,7 +176,7 @@ tbl = TkcItem::CItemID_TBL[self.path] } if tbl - find('withtag', *args).each{|item| + find('withtag', *args).each{|item| if item.kind_of?(TkcItem) TkcItem::CItemID_TBL.mutex.synchronize{ tbl.delete(item.id) @@ -195,7 +195,7 @@ end def find(mode, *args) - list(tk_send_without_enc('find', mode, *args)).collect!{|id| + list(tk_send_without_enc('find', mode, *args)).collect!{|id| TkcItem.id2obj(self, id) } end @@ -251,7 +251,7 @@ end def insert(tagOrId, index, string) - tk_send_without_enc('insert', tagid(tagOrId), index, + tk_send_without_enc('insert', tagid(tagOrId), index, _get_eval_enc_str(string)) self end Index: ext/tk/lib/tkextlib/iwidgets/entryfield.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/entryfield.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/entryfield.rb (working copy) @@ -30,16 +30,16 @@ class EntryfieldValidate < TkValidateCommand #class CalCmdArgs < TkUtil::CallbackSubst class ValidateArgs < TkUtil::CallbackSubst - KEY_TBL = [ - [ ?c, ?s, :char ], - [ ?P, ?s, :post ], - [ ?S, ?s, :current ], - [ ?W, ?w, :widget ], + KEY_TBL = [ + [ ?c, ?s, :char ], + [ ?P, ?s, :post ], + [ ?S, ?s, :current ], + [ ?W, ?w, :widget ], nil ] - PROC_TBL = [ - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], + PROC_TBL = [ + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], nil ] Index: ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb (working copy) @@ -46,13 +46,14 @@ end end + alias pagecget_tkstring itemcget_tkstring alias pagecget itemcget alias pagecget_strict itemcget_strict alias pageconfigure itemconfigure alias pageconfiginfo itemconfiginfo alias current_pageconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### Index: ext/tk/lib/tkextlib/iwidgets/radiobox.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/radiobox.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/radiobox.rb (working copy) @@ -46,13 +46,14 @@ end end + alias buttoncget_tkstring itemcget_tkstring alias buttoncget itemcget alias buttoncget_strict itemcget_strict alias buttonconfigure itemconfigure alias buttonconfiginfo itemconfiginfo alias current_buttonconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### Index: ext/tk/lib/tkextlib/iwidgets/panedwindow.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/panedwindow.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/panedwindow.rb (working copy) @@ -41,13 +41,14 @@ end end + alias panecget_tkstring itemcget_tkstring alias panecget itemcget alias panecget_strict itemcget_strict alias paneconfigure itemconfigure alias paneconfiginfo itemconfiginfo alias current_paneconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### Index: ext/tk/lib/tkextlib/iwidgets/notebook.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/notebook.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/notebook.rb (working copy) @@ -41,13 +41,14 @@ end end + alias pagecget_tkstring itemcget_tkstring alias pagecget itemcget alias pagecget_strict itemcget_strict alias pageconfigure itemconfigure alias pageconfiginfo itemconfiginfo alias current_pageconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### Index: ext/tk/lib/tkextlib/iwidgets/checkbox.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/checkbox.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/checkbox.rb (working copy) @@ -46,13 +46,14 @@ end end + alias buttoncget_tkstring itemcget_tkstring alias buttoncget itemcget alias buttoncget_strict itemcget_strict alias buttonconfigure itemconfigure alias buttonconfiginfo itemconfiginfo alias current_buttonconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo #################################### Index: ext/tk/lib/tkextlib/iwidgets/finddialog.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/finddialog.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/finddialog.rb (working copy) @@ -20,7 +20,7 @@ def __strval_optkeys super() + [ - 'patternbackground', 'patternforeground', + 'patternbackground', 'patternforeground', 'searchbackground', 'searchforeground' ] end Index: ext/tk/lib/tkextlib/iwidgets/watch.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/watch.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/watch.rb (working copy) @@ -24,7 +24,7 @@ private :__boolval_optkeys def __strval_optkeys - super() << 'clockcolor' << 'hourcolor' << 'minutecolor' << + super() << 'clockcolor' << 'hourcolor' << 'minutecolor' << 'pivotcolor' << 'secondcolor' << 'tickcolor' end private :__strval_optkeys Index: ext/tk/lib/tkextlib/iwidgets/calendar.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/calendar.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/calendar.rb (working copy) @@ -20,7 +20,7 @@ def __strval_optkeys super() + [ - 'buttonforeground', 'outline', 'selectcolor', + 'buttonforeground', 'outline', 'selectcolor', 'weekdaybackground', 'weekendbackground' ] end Index: ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb (working copy) @@ -141,7 +141,7 @@ def get(first, last=nil) if last # tk_split_simplelist(_fromUTF8(tk_send_without_enc('get', first, last))) - tk_split_simplelist(tk_send_without_enc('get', first, last), + tk_split_simplelist(tk_send_without_enc('get', first, last), false, true) else _fromUTF8(tk_send_without_enc('get', first)) Index: ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb =================================================================== --- ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb (revision 23917) +++ ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb (working copy) @@ -86,7 +86,7 @@ list(tk_send('bbox', index)) end def compare(idx1, op, idx2) - bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1), + bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1), op, _get_eval_enc_str(idx2))) end @@ -116,14 +116,18 @@ get('-displaychars', *index) end + def image_cget_tkstring(index, slot) + _fromUTF8(tk_send_without_enc('image', 'cget', + _get_eval_enc_str(index), "-#{slot.to_s}")) + end def image_cget_strict(index, slot) case slot.to_s when 'text', 'label', 'show', 'data', 'file' - _fromUTF8(tk_send_without_enc('image', 'cget', + _fromUTF8(tk_send_without_enc('image', 'cget', _get_eval_enc_str(index), "-#{slot}")) else - tk_tcl2ruby(_fromUTF8(tk_send_without_enc('image', 'cget', - _get_eval_enc_str(index), + tk_tcl2ruby(_fromUTF8(tk_send_without_enc('image', 'cget', + _get_eval_enc_str(index), "-#{slot}"))) end end @@ -151,13 +155,13 @@ def image_configure(index, slot, value=None) if slot.kind_of? Hash - _fromUTF8(tk_send_without_enc('image', 'configure', - _get_eval_enc_str(index), + _fromUTF8(tk_send_without_enc('image', 'configure', + _get_eval_enc_str(index), *hash_kv(slot, true))) else - _fromUTF8(tk_send_without_enc('image', 'configure', - _get_eval_enc_str(index), - "-#{slot}", + _fromUTF8(tk_send_without_enc('image', 'configure', + _get_eval_enc_str(index), + "-#{slot}", _get_eval_enc_str(value))) end self @@ -187,16 +191,16 @@ else if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf[4] if conf[4].index('{') - conf[4] = tk_split_list(conf[4]) + conf[4] = tk_split_list(conf[4]) else - conf[4] = tk_tcl2ruby(conf[4]) + conf[4] = tk_tcl2ruby(conf[4]) end end end @@ -228,16 +232,16 @@ else if conf[2] if conf[2].index('{') - conf[2] = tk_split_list(conf[2]) + conf[2] = tk_split_list(conf[2]) else - conf[2] = tk_tcl2ruby(conf[2]) + conf[2] = tk_tcl2ruby(conf[2]) end end if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end end @@ -298,7 +302,7 @@ def mark_gravity(mark, direction=nil) if direction - tk_send_without_enc('mark', 'gravity', + tk_send_without_enc('mark', 'gravity', _get_eval_enc_str(mark), direction) self else @@ -307,27 +311,27 @@ end def mark_set(mark, index) - tk_send_without_enc('mark', 'set', _get_eval_enc_str(mark), + tk_send_without_enc('mark', 'set', _get_eval_enc_str(mark), _get_eval_enc_str(index)) self end alias set_mark mark_set def mark_unset(*marks) - tk_send_without_enc('mark', 'unset', + tk_send_without_enc('mark', 'unset', *(marks.collect{|mark| _get_eval_enc_str(mark)})) self end alias unset_mark mark_unset def mark_next(index) - tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'next', + tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'next', _get_eval_enc_str(index)))) end alias next_mark mark_next def mark_previous(index) - tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'previous', + tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'previous', _get_eval_enc_str(index)))) end alias previous_mark mark_previous @@ -354,11 +358,11 @@ # $KCODE == 'NONE' if JAPANIZED_TK - tk_call_without_enc('kstring', 'length', + tk_call_without_enc('kstring', 'length', _get_eval_enc_str(txt)).to_i else begin - tk_call_without_enc('encoding', 'convertto', 'ascii', + tk_call_without_enc('encoding', 'convertto', 'ascii', _get_eval_enc_str(txt)).length rescue StandardError, NameError # sorry, I have no plan @@ -419,11 +423,11 @@ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 if pat.kind_of? String #return [index(start + " + #{pos} chars"), pat.split('').length] - return [index(start + " + #{pos} chars"), + return [index(start + " + #{pos} chars"), _ktext_length(pat), pat.dup] else #return [index(start + " + #{pos} chars"), $&.split('').length] - return [index(start + " + #{pos} chars"), + return [index(start + " + #{pos} chars"), _ktext_length(match), match] end else @@ -437,11 +441,11 @@ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 if pat.kind_of? String #return [index(start + " + #{pos} chars"), pat.split('').length] - return [index(start + " + #{pos} chars"), + return [index(start + " + #{pos} chars"), _ktext_length(pat), pat.dup] else #return [index(start + " + #{pos} chars"), $&.split('').length] - return [index(start + " + #{pos} chars"), + return [index(start + " + #{pos} chars"), _ktext_length(match), match] end else @@ -452,7 +456,7 @@ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 if pat.kind_of? String #return [index("1.0 + #{pos} chars"), pat.split('').length] - return [index("1.0 + #{pos} chars"), + return [index("1.0 + #{pos} chars"), _ktext_length(pat), pat.dup] else #return [index("1.0 + #{pos} chars"), $&.split('').length] Index: ext/tk/lib/tkextlib/blt/busy.rb =================================================================== --- ext/tk/lib/tkextlib/blt/busy.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/busy.rb (working copy) @@ -44,6 +44,7 @@ private :__item_config_cmd undef itemcget + undef itemcget_tkstring alias configure itemconfigure alias configinfo itemconfiginfo alias current_configinfo current_itemconfiginfo Index: ext/tk/lib/tkextlib/blt/tabset.rb =================================================================== --- ext/tk/lib/tkextlib/blt/tabset.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/tabset.rb (working copy) @@ -132,6 +132,9 @@ @t.tab_bindinfo(@id, context) end + def cget_tkstring(*args) + @t.tab_cget_tkstring(@id, *args) + end def cget(*args) @t.tab_cget(@id, *args) end @@ -249,6 +252,7 @@ end private :__item_pathname + alias tab_cget_tkstring itemcget_tkstring alias tab_cget itemcget alias tab_cget_strict itemcget_strict alias tab_configure itemconfigure Index: ext/tk/lib/tkextlib/blt/stripchart.rb =================================================================== --- ext/tk/lib/tkextlib/blt/stripchart.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/stripchart.rb (working copy) @@ -22,7 +22,7 @@ private :__boolval_optkeys def __strval_optkeys - ['text', 'label', 'title', 'file', + ['text', 'label', 'title', 'file', 'background', 'plotbackground'] end private :__strval_optkeys Index: ext/tk/lib/tkextlib/blt/barchart.rb =================================================================== --- ext/tk/lib/tkextlib/blt/barchart.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/barchart.rb (working copy) @@ -22,7 +22,7 @@ private :__boolval_optkeys def __strval_optkeys - ['text', 'label', 'title', 'file', + ['text', 'label', 'title', 'file', 'background', 'plotbackground'] end private :__strval_optkeys Index: ext/tk/lib/tkextlib/blt/table.rb =================================================================== --- ext/tk/lib/tkextlib/blt/table.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/table.rb (working copy) @@ -26,6 +26,9 @@ self end + def blt_table_cget_tkstring(*args) + Tk::BLT::Table.cget_tkstring(self, *args) + end def blt_table_cget(*args) Tk::BLT::Table.cget(self, *args) end @@ -92,6 +95,9 @@ self end + def blt_table_itemcget_tkstring(*args) + Tk::BLT::Table.itemcget_tkstring(self, *args) + end def blt_table_itemcget(*args) Tk::BLT::Table.itemcget(self, *args) end @@ -141,13 +147,14 @@ end private :__item_pathname + alias __itemcget_tkstring itemcget_tkstring alias __itemcget itemcget alias __itemcget_strict itemcget_strict alias __itemconfigure itemconfigure alias __itemconfiginfo itemconfiginfo alias __current_itemconfiginfo current_itemconfiginfo - private :__itemcget, :__itemcget_strict + private :__itemcget_tkstring, :__itemcget, :__itemcget_strict private :__itemconfigure, :__itemconfiginfo, :__current_itemconfiginfo def __boolval_optkeys @@ -180,6 +187,9 @@ ############################################ + def cget_tkstring(container, option) + __itemcget_tkstring([container], option) + end def cget(container, option) __itemcget([container], option) end @@ -199,6 +209,9 @@ __current_itemconfiginfo([container], *args) end + def itemcget_tkstring(container, item, option) + __itemcget_tkstring([container, tagid(item)], option) + end def itemcget(container, item, option) __itemcget([container, tagid(item)], option) end Index: ext/tk/lib/tkextlib/blt/treeview.rb =================================================================== --- ext/tk/lib/tkextlib/blt/treeview.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/treeview.rb (working copy) @@ -95,6 +95,9 @@ end private :__item_pathname + def column_cget_tkstring(name, option) + itemcget_tkstring(['column', name], option) + end def column_cget(name, option) itemcget(['column', name], option) end @@ -111,6 +114,9 @@ current_itemconfiginfo(['column', name], slot) end + def button_cget_tkstring(option) + itemcget_tkstring('button', option) + end def button_cget(option) itemcget('button', option) end @@ -127,6 +133,9 @@ current_itemconfiginfo('button', slot) end + def entry_cget_tkstring(option) + itemcget_tkstring('entry', option) + end def entry_cget(option) ret = itemcget('entry', option) if option == 'bindtags' || option == :bindtags @@ -181,6 +190,9 @@ ret end + def sort_cget_tkstring(option) + itemcget_tkstring('sort', option) + end def sort_cget(option) itemcget('sort', option) end @@ -197,6 +209,9 @@ current_itemconfiginfo('sort', slot) end + def text_cget_tkstring(option) + itemcget_tkstring('text', option) + end def text_cget(option) itemcget('text', option) end @@ -213,7 +228,7 @@ current_itemconfiginfo('text', slot) end - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo end @@ -230,7 +245,7 @@ ######################## def __boolval_optkeys - ['autocreate', 'allowduplicates', 'exportselection', 'flat', 'hideroot', + ['autocreate', 'allowduplicates', 'exportselection', 'flat', 'hideroot', 'newtags', 'showtitles', 'sortselection'] end private :__boolval_optkeys @@ -245,17 +260,17 @@ class OpenCloseCommand < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst KEY_TBL = [ - [ ?W, ?w, :widget ], - [ ?p, ?s, :name ], - [ ?P, ?s, :fullpath ], - [ ?#, ?x, :node_id ], + [ ?W, ?w, :widget ], + [ ?p, ?s, :name ], + [ ?P, ?s, :fullpath ], + [ ?#, ?x, :node_id ], nil ] PROC_TBL = [ - [ ?x, TkComm.method(:num_or_str) ], - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], + [ ?x, TkComm.method(:num_or_str) ], + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], nil ] @@ -463,7 +478,7 @@ self end def entry_children(tag, first=None, last=None) - simplelist(tk_send('entry', 'children', tagid(tag), + simplelist(tk_send('entry', 'children', tagid(tag), first, last)).collect{|id| tagid2obj(id)} end def entry_delete(tag, first=None, last=None) @@ -500,17 +515,17 @@ class FindExecFlagValue < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst KEY_TBL = [ - [ ?W, ?w, :widget ], - [ ?p, ?s, :name ], - [ ?P, ?s, :fullpath ], - [ ?#, ?x, :node_id ], + [ ?W, ?w, :widget ], + [ ?p, ?s, :name ], + [ ?P, ?s, :fullpath ], + [ ?#, ?x, :node_id ], nil ] PROC_TBL = [ - [ ?x, TkComm.method(:num_or_str) ], - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], + [ ?x, TkComm.method(:num_or_str) ], + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], nil ] @@ -646,7 +661,7 @@ } end def range_open(first, last) - simplelist(tk_send('range', '-open', + simplelist(tk_send('range', '-open', tagid(first), tagid(last))).collect{|id| tagid2obj(id) } @@ -1118,7 +1133,7 @@ at = keys.delete['at'] if parent - if parent.kind_of?(Tk::BLT::Treeview::Node) || + if parent.kind_of?(Tk::BLT::Treeview::Node) || parent.kind_of?(Tk::BLT::Treeview::Tag) path = [get_full(parent.id)[0], name] at = nil # ignore 'at' option Index: ext/tk/lib/tkextlib/blt/winop.rb =================================================================== --- ext/tk/lib/tkextlib/blt/winop.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/winop.rb (working copy) @@ -38,7 +38,7 @@ tk_call('::blt::winop', 'image', 'readjpeg', file, photo) end def image_resample(src, dest, horiz_filter=None, vert_filter=None) - tk_call('::blt::winop', 'image', 'resample', + tk_call('::blt::winop', 'image', 'resample', src, dest, horiz_filter, vert_filter) end def image_rotate(src, dest, angle) @@ -47,9 +47,9 @@ def image_snap(win, photo, width=None, height=None) tk_call('::blt::winop', 'image', 'snap', win, photo, width, height) end - def image_subsample(src, dest, x, y, width, height, + def image_subsample(src, dest, x, y, width, height, horiz_filter=None, vert_filter=None) - tk_call('::blt::winop', 'image', 'subsample', + tk_call('::blt::winop', 'image', 'subsample', src, dest, x, y, width, height, horiz_filter, vert_filter) end @@ -66,13 +66,13 @@ end def resample(src, dest, horiz_filter=None, vert_filter=None) - tk_call('::blt::winop', 'resample', + tk_call('::blt::winop', 'resample', src, dest, horiz_filter, vert_filter) end - def subsample(src, dest, x, y, width, height, + def subsample(src, dest, x, y, width, height, horiz_filter=None, vert_filter=None) - tk_call('::blt::winop', 'subsample', + tk_call('::blt::winop', 'subsample', src, dest, x, y, width, height, horiz_filter, vert_filter) end Index: ext/tk/lib/tkextlib/blt/htext.rb =================================================================== --- ext/tk/lib/tkextlib/blt/htext.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/htext.rb (working copy) @@ -21,6 +21,7 @@ WidgetClassName = 'Htext'.freeze WidgetClassNames[WidgetClassName] = self + alias window_cget_tkstring itemcget_tkstring alias window_cget itemcget alias window_cget_strict itemcget_strict alias window_configure itemconfigure Index: ext/tk/lib/tkextlib/blt/tree.rb =================================================================== --- ext/tk/lib/tkextlib/blt/tree.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/tree.rb (working copy) @@ -182,7 +182,7 @@ def move(dest, keys={}) @tree.keys(@id, dest, keys) self - end + end def next() @tree.next(@id) @@ -397,10 +397,10 @@ NotifyID_TBL.mutex.synchronize{ if tree.kind_of?(Array) # not create - tpath = tree[0].path + tpath = tree[0].path NotifyID_TBL[tpath] ||= {} unless (obj = NotifyID_TBL[tpath][tree[1]]) - (NotifyID_TBL[tpath][tree[1]] = + (NotifyID_TBL[tpath][tree[1]] = obj = self.allocate).instance_eval{ @parent = @tree = tree[0] @tpath = @parent.path @@ -438,7 +438,7 @@ args = args.collect{|arg| '-' << arg.to_s} args << proc{|id, type| - cmd.call(Tk::BLT::Tree::Node.id2obj(@tree, id), + cmd.call(Tk::BLT::Tree::Node.id2obj(@tree, id), ((type[0] == ?-)? type[1..-1]: type)) } @@ -509,7 +509,7 @@ tpath = tree[0].path TraceID_TBL[tpath] ||= {} unless (obj = TraceID_TBL[tpath][tree[1]]) - (TraceID_TBL[tpath][tree[1]] = + (TraceID_TBL[tpath][tree[1]] = obj = self.allocate).instance_eval{ @parent = @tree = tree @tpath = @parent.path @@ -541,8 +541,8 @@ end end - @path = @id = tk_call(@tpath, 'trace', 'create', node, key, opts, - proc{|t, id, k, ops| + @path = @id = tk_call(@tpath, 'trace', 'create', node, key, opts, + proc{|t, id, k, ops| tobj = Tk::BLT::Tree.id2obj(t) if tobj.kind_of?(Tk::BLT::Tree) nobj = Tk::BLT::Tree::Node.id2obj(tobj, id) @@ -599,8 +599,8 @@ 'recurse'=>nil, 'tags'=>nil, # sort command - 'ascii'=>nil, 'decreasing'=>nil, 'disctionary'=>nil, - 'integer'=>nil, 'real'=>nil, 'recurse'=>nil, 'reorder'=>nil, + 'ascii'=>nil, 'decreasing'=>nil, 'disctionary'=>nil, + 'integer'=>nil, 'real'=>nil, 'recurse'=>nil, 'reorder'=>nil, } end @@ -624,7 +624,7 @@ def self.new(name = nil) TreeID_TBL.mutex.synchronize{ if name && TreeID_TBL[name] - TreeID_TBL[name] + TreeID_TBL[name] else (obj = self.allocate).instance_eval{ initialize(name) @@ -680,7 +680,7 @@ end def ancestor(node1, node2) - Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'ancestor', + Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'ancestor', tagid(node1), tagid(node2))) end @@ -701,14 +701,14 @@ end def copy(src, parent, keys={}) - id = tk_call('::blt::tree', 'copy', tagid(src), tagid(parent), + id = tk_call('::blt::tree', 'copy', tagid(src), tagid(parent), __conv_keyonly_opts(keys)) Tk::BLT::Tree::Node.new(self, nil, 'node'=>id) end def copy_to(src, dest_tree, parent, keys={}) return copy(src, parent, keys={}) unless dest_tree - id = tk_call('::blt::tree', 'copy', tagid(src), dest_tree, + id = tk_call('::blt::tree', 'copy', tagid(src), dest_tree, tagid(parent), __conv_keyonly_opts(keys)) Tk::BLT::Tree::Node.new(dest_tree, nil, 'node'=>id) end @@ -751,7 +751,7 @@ end def find(node, keys={}) - simplelist(tk_call('::blt::tree', 'find', tagid(node), + simplelist(tk_call('::blt::tree', 'find', tagid(node), __conv_keyonly_opts(keys))).collect{|n| Tk::BLT::Tree::Node.id2obj(self, n) } @@ -775,7 +775,7 @@ end def index(node) - Tk::BLT::Tree::Node.id2obj(self, + Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'index', tagid(node))) end @@ -785,11 +785,11 @@ end def ancestor?(node1, node2) - bool(tk_call('::blt::tree', 'is', 'ancestor', + bool(tk_call('::blt::tree', 'is', 'ancestor', tagid(node1), tagid(node2))) end def before?(node1, node2) - bool(tk_call('::blt::tree', 'is', 'before', + bool(tk_call('::blt::tree', 'is', 'before', tagid(node1), tagid(node2))) end def leaf?(node) @@ -806,7 +806,7 @@ if nodes.empty? simplelist(tk_call('blt::tree', 'keys', tagid(node))) else - simplelist(tk_call('blt::tree', 'keys', tagid(node), + simplelist(tk_call('blt::tree', 'keys', tagid(node), *(nodes.collect{|n| tagid(n)}))).collect{|lst| simplelist(lst) } @@ -828,7 +828,7 @@ end def link(parent, node, keys={}) - ret = tk_call('::blt::tree', 'link', tagid(parent), tagid(node), + ret = tk_call('::blt::tree', 'link', tagid(parent), tagid(node), __conv_keyonly_opts(keys)) (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret) end @@ -902,7 +902,7 @@ end def restore(node, str, keys={}) - tk_call('::blt::tree', 'restore', tagid(node), str, + tk_call('::blt::tree', 'restore', tagid(node), str, __conv_keyonly_opts(keys)) self end @@ -915,7 +915,7 @@ end def restore_from_file(node, file, keys={}) - tk_call('::blt::tree', 'restorefile', tagid(node), file, + tk_call('::blt::tree', 'restorefile', tagid(node), file, __conv_keyonly_opts(keys)) self end @@ -923,13 +923,13 @@ keys = __conv_keyonly_opts(keys) keys.delete('overwrite') keys.delete(:overwrite) - tk_call('::blt::tree', 'restorefile', tagid(node), file, + tk_call('::blt::tree', 'restorefile', tagid(node), file, '-overwrite', keys) self end def root(node=None) - Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'root', + Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'root', tagid(node))) end @@ -958,7 +958,7 @@ end def tag_delete(tag, *nodes) - tk_call(@path, 'tag', 'delete', tagid(tag), + tk_call(@path, 'tag', 'delete', tagid(tag), *(nodes.collect{|n| tagid(n)})) self end @@ -973,7 +973,7 @@ end def tag_get(node, *patterns) - simplelist(tk_call(@tpath, 'tag', 'get', tagid(node), + simplelist(tk_call(@tpath, 'tag', 'get', tagid(node), *(patterns.collect{|pat| tagid(pat)}))).collect{|str| Tk::BLT::Tree::Tag.id2obj(self, str) } @@ -997,7 +997,7 @@ end def tag_unset(node, *tags) - tk_call(@path, 'tag', 'unset', tagid(node), + tk_call(@path, 'tag', 'unset', tagid(node), *(tags.collect{|t| tagid(t)})) self end Index: ext/tk/lib/tkextlib/blt/setup.rb =================================================================== --- ext/tk/lib/tkextlib/blt/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/blt/dragdrop.rb =================================================================== --- ext/tk/lib/tkextlib/blt/dragdrop.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/dragdrop.rb (working copy) @@ -55,6 +55,7 @@ private :__item_strval_optkeys undef itemcget + undef itemcget_tkstring private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo def source_configure(win, slot, value=None) @@ -77,7 +78,7 @@ ] PROC_TBL = [ - [ ?w, TkComm.method(:window) ], + [ ?w, TkComm.method(:window) ], nil ] @@ -120,8 +121,8 @@ ] PROC_TBL = [ - [ ?b, TkComm.method(:bool) ], - [ ?w, TkComm.method(:window) ], + [ ?b, TkComm.method(:bool) ], + [ ?w, TkComm.method(:window) ], nil ] @@ -175,9 +176,9 @@ ] PROC_TBL = [ - [ ?i, TkComm.method(:string) ], - [ ?v, TkComm.method(:tk_tcl2ruby) ], - [ ?w, TkComm.method(:window) ], + [ ?i, TkComm.method(:string) ], + [ ?v, TkComm.method(:tk_tcl2ruby) ], + [ ?w, TkComm.method(:window) ], nil ] @@ -203,14 +204,14 @@ end def self.source_handler(win, datatype, cmd=Proc.new, *args) - _bind_for_event_class(DnD_Handle, - ['::blt::drag&drop', 'source', win, 'handler'], + _bind_for_event_class(DnD_Handle, + ['::blt::drag&drop', 'source', win, 'handler'], cmd, *args) end def self.target_handler(win, datatype, cmd=Proc.new, *args) - _bind_for_event_class(DnD_Handle, - ['::blt::drag&drop', 'target', win, 'handler'], + _bind_for_event_class(DnD_Handle, + ['::blt::drag&drop', 'target', win, 'handler'], cmd, *args) end Index: ext/tk/lib/tkextlib/blt/component.rb =================================================================== --- ext/tk/lib/tkextlib/blt/component.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/component.rb (working copy) @@ -22,15 +22,15 @@ private :__item_numstrval_optkeys def __item_boolval_optkeys(id) - ['hide', 'under', 'descending', 'logscale', 'loose', 'showticks', - 'titlealternate', 'scalesymbols', 'minor', 'raised', + ['hide', 'under', 'descending', 'logscale', 'loose', 'showticks', + 'titlealternate', 'scalesymbols', 'minor', 'raised', 'center', 'decoration', 'landscape', 'maxpect'] end private :__item_boolval_optkeys def __item_strval_optkeys(id) - ['text', 'label', 'limits', 'title', - 'show', 'file', 'maskdata', 'maskfile', + ['text', 'label', 'limits', 'title', + 'show', 'file', 'maskdata', 'maskfile', 'color', 'titlecolor', 'fill', 'outline', 'offdash'] end private :__item_strval_optkeys @@ -82,6 +82,9 @@ end private :__item_pathname + def axis_cget_tkstring(id, option) + ret = itemcget_tkstring(['axis', tagid(id)], option) + end def axis_cget(id, option) ret = itemcget(['axis', tagid(id)], option) end @@ -94,7 +97,7 @@ value = None slot = _symbolkey2str(slot) if cmd = slot.delete('command') - slot['command'] = proc{|w, tick| + slot['command'] = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end @@ -103,7 +106,7 @@ slot = args.pop if slot == :command || slot == 'command' cmd = value - value = proc{|w, tick| + value = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end @@ -118,6 +121,9 @@ current_itemconfiginfo(['axis', tagid(id)], slot) end + def crosshairs_cget_tkstring(option) + itemcget_tkstring('crosshairs', option) + end def crosshairs_cget(option) itemcget('crosshairs', option) end @@ -134,6 +140,9 @@ current_itemconfiginfo('crosshairs', slot) end + def element_cget_tkstring(id, option) + itemcget_tkstring(['element', tagid(id)], option) + end def element_cget(id, option) itemcget(['element', tagid(id)], option) end @@ -158,6 +167,9 @@ current_itemconfiginfo(['element', tagid(id)], slot) end + def bar_cget_tkstring(id, option) + itemcget_tkstring(['bar', tagid(id)], option) + end def bar_cget(id, option) itemcget(['bar', tagid(id)], option) end @@ -182,6 +194,9 @@ current_itemconfiginfo(['bar', tagid(id)], slot) end + def line_cget_tkstring(id, option) + itemcget_tkstring(['line', tagid(id)], option) + end def line_cget(id, option) itemcget(['line', tagid(id)], option) end @@ -206,6 +221,9 @@ current_itemconfiginfo(['line', tagid(id)], slot) end + def gridline_cget_tkstring(option) + itemcget_tkstring('grid', option) + end def gridline_cget(option) itemcget('grid', option) end @@ -222,6 +240,9 @@ current_itemconfiginfo('grid', slot) end + def legend_cget_tkstring(option) + itemcget_tkstring('legend', option) + end def legend_cget(option) itemcget('legend', option) end @@ -238,6 +259,9 @@ current_itemconfiginfo('legend', slot) end + def pen_cget_tkstring(id, option) + itemcget_tkstring(['pen', tagid(id)], option) + end def pen_cget(id, option) itemcget(['pen', tagid(id)], option) end @@ -262,6 +286,9 @@ current_itemconfiginfo(['pen', tagid(id)], slot) end + def postscript_cget_tkstring(option) + itemcget_tkstring('postscript', option) + end def postscript_cget(option) itemcget('postscript', option) end @@ -278,6 +305,9 @@ current_itemconfiginfo('postscript', slot) end + def marker_cget_tkstring(id, option) + itemcget_tkstring(['marker', tagid(id)], option) + end def marker_cget(id, option) itemcget(['marker', tagid(id)], option) end @@ -302,12 +332,16 @@ current_itemconfiginfo(['marker', tagid(id)], slot) end + alias __itemcget_tkstring itemcget_tkstring alias __itemcget itemcget alias __itemcget_strict itemcget_strict alias __itemconfiginfo itemconfiginfo alias __current_itemconfiginfo current_itemconfiginfo - private :__itemcget, :__itemconfiginfo, :__current_itemconfiginfo + private :__itemcget_tkstring, :__itemcget, :__itemconfiginfo, :__current_itemconfiginfo + def itemcget_tkstring(tagOrId, option) + __itemcget_tkstring(tagid(tagOrId), option) + end def itemcget_strict(tagOrId, option) ret = __itemcget(tagid(tagOrId), option) if option == 'bindtags' || option == :bindtags @@ -373,7 +407,7 @@ ret end - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo ################# @@ -477,6 +511,9 @@ @id end + def cget_tkstring(option) + @chart.axis_cget_tkstring(@id, option) + end def cget(option) @chart.axis_cget(@id, option) end @@ -520,7 +557,7 @@ def name @axis end - + def transform(val) @chart.axis_transform(@id, val) end @@ -582,6 +619,9 @@ @id end + def cget_tkstring(option) + @chart.crosshair_cget_tkstring(option) + end def cget(option) @chart.crosshair_cget(option) end @@ -729,6 +769,10 @@ @id end + def cget_tkstring(option) + # @chart.element_cget(@id, option) + @chart.__send__(@typename + '_cget_tkstring', @id, option) + end def cget(option) # @chart.element_cget(@id, option) @chart.__send__(@typename + '_cget', @id, option) @@ -833,6 +877,9 @@ @id end + def cget_tkstring(option) + @chart.gridline_cget_tkstring(option) + end def cget(option) @chart.gridline_cget(option) end @@ -907,6 +954,9 @@ @id end + def cget_tkstring(option) + @chart.legend_cget_tkstring(option) + end def cget(option) @chart.legend_cget(option) end @@ -1036,6 +1086,9 @@ @id end + def cget_tkstring(option) + @chart.pen_cget_tkstring(@id, option) + end def cget(option) @chart.pen_cget(@id, option) end @@ -1106,6 +1159,9 @@ @id end + def cget_tkstring(option) + @chart.postscript_cget_tkstring(option) + end def cget(option) @chart.postscript_cget(option) end @@ -1221,7 +1277,7 @@ fail RuntimeError, "#{self} is an abstract class" end args, fontkeys = _parse_create_args(keys) - idnum = tk_call_without_enc(chart.path, 'marker', 'create', + idnum = tk_call_without_enc(chart.path, 'marker', 'create', self::MarkerTypeName, *args) chart.marker_configure(idnum, fontkeys) unless fontkeys.empty? idnum.to_i # 'item id' is an integer number @@ -1229,7 +1285,7 @@ def self.create_type(chart, type, keys={}) args, fontkeys = _parse_create_args(keys) - idnum = tk_call_without_enc(chart.path, 'marker', 'create', + idnum = tk_call_without_enc(chart.path, 'marker', 'create', type, *args) chart.marker_configure(idnum, fontkeys) unless fontkeys.empty? id = idnum.to_i # 'item id' is an integer number @@ -1269,6 +1325,9 @@ @id end + def cget_tkstring(option) + @chart.marker_cget_tkstring(@id, option) + end def cget(option) @chart.marker_cget(@id, option) end @@ -1486,7 +1545,7 @@ list(tk_send('axis', 'limits', tagid(id))) end def axis_names(*pats) - simplelist(tk_send('axis', 'names', + simplelist(tk_send('axis', 'names', *(pats.collect{|pat| tagid(pat)}))).collect{|axis| Tk::BLT::PlotComponent::Axis.id2obj(self, axis) } @@ -1500,11 +1559,11 @@ end def axis_use(id, target=nil) if target - Tk::BLT::PlotComponent::Axis.id2obj(self, - tk_send('axis', 'use', + Tk::BLT::PlotComponent::Axis.id2obj(self, + tk_send('axis', 'use', tagid(id), tagid(target))) else - Tk::BLT::PlotComponent::Axis.id2obj(self, + Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('axis', 'use', tagid(id))) end end @@ -1544,10 +1603,10 @@ def element_closest(x, y, var, *args) if args[-1].kind_of?(Hash) keys = args.pop - bool(tk_send('element', 'closest', x, y, var, + bool(tk_send('element', 'closest', x, y, var, *(hash_kv(keys).concat(args.collect{|id| tagid(id)})))) else - bool(tk_send('element', 'closest', x, y, var, + bool(tk_send('element', 'closest', x, y, var, *(args.collect{|id| tagid(id)}))) end end @@ -1563,7 +1622,7 @@ bool(tk_send('element', 'exists', tagid(id))) end def element_names(*pats) - simplelist(tk_send('element', 'names', + simplelist(tk_send('element', 'names', *(pats.collect{|pat| tagid(pat)}))).collect{|elem| Tk::BLT::PlotComponent::Element.id2obj(self, elem) } @@ -1601,10 +1660,10 @@ def bar_closest(x, y, var, *args) if args[-1].kind_of?(Hash) keys = args.pop - bool(tk_send('bar', 'closest', x, y, var, + bool(tk_send('bar', 'closest', x, y, var, *(hash_kv(keys).concat(args.collect{|id| tagid(id)})))) else - bool(tk_send('bar', 'closest', x, y, var, + bool(tk_send('bar', 'closest', x, y, var, *(args.collect{|id| tagid(id)}))) end end @@ -1620,7 +1679,7 @@ bool(tk_send('bar', 'exists', tagid(id))) end def bar_names(*pats) - simplelist(tk_send('bar', 'names', + simplelist(tk_send('bar', 'names', *(pats.collect{|pat| tagid(pat)}))).collect{|elem| Tk::BLT::PlotComponent::Element.id2obj(self, elem) } @@ -1658,10 +1717,10 @@ def line_closest(x, y, var, *args) if args[-1].kind_of?(Hash) keys = args.pop - bool(tk_send('line', 'closest', x, y, var, + bool(tk_send('line', 'closest', x, y, var, *(hash_kv(keys).concat(args.collect{|id| tagid(id)})))) else - bool(tk_send('line', 'closest', x, y, var, + bool(tk_send('line', 'closest', x, y, var, *(args.collect{|id| tagid(id)}))) end end @@ -1677,7 +1736,7 @@ bool(tk_send('line', 'exists', tagid(id))) end def line_names(*pats) - simplelist(tk_send('line', 'names', + simplelist(tk_send('line', 'names', *(pats.collect{|pat| tagid(pat)}))).collect{|elem| Tk::BLT::PlotComponent::Element.id2obj(self, elem) } @@ -1723,7 +1782,7 @@ keys.delete('without_creating') end - legend = self.class.new(parent, :without_creating=>true, + legend = self.class.new(parent, :without_creating=>true, :widgetname=>widgetname) class << legend def __destroy_hook__ @@ -1740,24 +1799,24 @@ end def legend_activate(*pats) - list(tk_send('legend', 'activate', + list(tk_send('legend', 'activate', *(pats.collect{|pat| tagid(pat)}))).collect{|elem| Tk::BLT::PlotComponent::Element.id2obj(self, elem) } end def legend_deactivate(*pats) - list(tk_send('legend', 'deactivate', + list(tk_send('legend', 'deactivate', *(pats.collect{|pat| tagid(pat)}))).collect{|elem| Tk::BLT::PlotComponent::Element.id2obj(self, elem) } end def legend_get(pos, y=nil) if y - Tk::BLT::PlotComponent::Element.id2obj(self, - tk_send('legend', 'get', + Tk::BLT::PlotComponent::Element.id2obj(self, + tk_send('legend', 'get', _at(pos, y))) else - Tk::BLT::PlotComponent::Element.id2obj(self, + Tk::BLT::PlotComponent::Element.id2obj(self, tk_send('legend', 'get', pos)) end end @@ -1773,7 +1832,7 @@ self end def pen_names(*pats) - simplelist(tk_send('pen', 'names', + simplelist(tk_send('pen', 'names', *(pats.collect{|pat| tagid(pat)}))).collect{|pen| Tk::BLT::PlotComponent::Pen.id2obj(self, pen) } @@ -1843,7 +1902,7 @@ bool(tk_send('marker', 'exists', tagid(id))) end def marker_names(*pats) - simplelist(tk_send('marker', 'names', + simplelist(tk_send('marker', 'names', *(pats.collect{|pat| tagid(pat)}))).collect{|id| Tk::BLT::PlotComponent::Marker.id2obj(self, id) } @@ -1854,6 +1913,9 @@ ################### + def xaxis_cget_tkstring(option) + itemcget_tkstring('xaxis', option) + end def xaxis_cget(option) itemcget('xaxis', option) end @@ -1864,13 +1926,13 @@ if slot.kind_of?(Hash) slot = _symbolkey2str(slot) if cmd = slot.delete('command') - slot['command'] = proc{|w, tick| + slot['command'] = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end elsif slot == :command || slot == 'command' cmd = value - value = proc{|w, tick| + value = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end @@ -1918,14 +1980,17 @@ end def xaxis_use(target=nil) if target - Tk::BLT::PlotComponent::Axis.id2obj(self, - tk_send('xaxis', 'use', + Tk::BLT::PlotComponent::Axis.id2obj(self, + tk_send('xaxis', 'use', tagid(target))) else Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('xaxis', 'use')) end end + def x2axis_cget_tkstring(option) + itemcget_tkstring('x2axis', option) + end def x2axis_cget(option) itemcget('x2axis', option) end @@ -1936,13 +2001,13 @@ if slot.kind_of?(Hash) slot = _symbolkey2str(slot) if cmd = slot.delete('command') - slot['command'] = proc{|w, tick| + slot['command'] = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end elsif slot == :command || slot == 'command' cmd = value - value = proc{|w, tick| + value = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end @@ -1990,14 +2055,17 @@ end def x2axis_use(target=nil) if target - Tk::BLT::PlotComponent::Axis.id2obj(self, - tk_send('x2axis', 'use', + Tk::BLT::PlotComponent::Axis.id2obj(self, + tk_send('x2axis', 'use', tagid(target))) else Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('x2axis', 'use')) end end + def yaxis_cget_tkstring(option) + itemcget_tkstring('yaxis', option) + end def yaxis_cget(option) itemcget('yaxis', option) end @@ -2008,13 +2076,13 @@ if slot.kind_of?(Hash) slot = _symbolkey2str(slot) if cmd = slot.delete('command') - slot['command'] = proc{|w, tick| + slot['command'] = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end elsif slot == :command || slot == 'command' cmd = value - value = proc{|w, tick| + value = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end @@ -2062,14 +2130,17 @@ end def yaxis_use(target=nil) if target - Tk::BLT::PlotComponent::Axis.id2obj(self, - tk_send('yaxis', 'use', + Tk::BLT::PlotComponent::Axis.id2obj(self, + tk_send('yaxis', 'use', tagid(target))) else Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('yaxis', 'use')) end end + def y2axis_cget_tkstring(option) + itemcget_tkstring('y2axis', option) + end def y2axis_cget(option) itemcget('y2axis', option) end @@ -2080,13 +2151,13 @@ if slot.kind_of?(Hash) slot = _symbolkey2str(slot) if cmd = slot.delete('command') - slot['command'] = proc{|w, tick| + slot['command'] = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end elsif slot == :command || slot == 'command' cmd = value - value = proc{|w, tick| + value = proc{|w, tick| cmd.call(TkComm.window(w), TkComm.num_or_str(tick)) } end @@ -2134,8 +2205,8 @@ end def y2axis_use(target=nil) if target - Tk::BLT::PlotComponent::Axis.id2obj(self, - tk_send('y2axis', 'use', + Tk::BLT::PlotComponent::Axis.id2obj(self, + tk_send('y2axis', 'use', tagid(target))) else Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('y2axis', 'use')) Index: ext/tk/lib/tkextlib/blt/vector.rb =================================================================== --- ext/tk/lib/tkextlib/blt/vector.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/vector.rb (working copy) @@ -49,10 +49,10 @@ size = size.join(':') end if size - @id = TkCore::INTERP._invoke('::blt::vector', 'create', + @id = TkCore::INTERP._invoke('::blt::vector', 'create', "#auto(#{size})", *hash_kv(keys)) else - @id = TkCore::INTERP._invoke('::blt::vector', 'create', + @id = TkCore::INTERP._invoke('::blt::vector', 'create', "#auto", *hash_kv(keys)) end Index: ext/tk/lib/tkextlib/blt/tabnotebook.rb =================================================================== --- ext/tk/lib/tkextlib/blt/tabnotebook.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/tabnotebook.rb (working copy) @@ -99,7 +99,7 @@ pos = nil end pos = 'end' if pos.nil? - Tk::BLT::Tabnotebook::Tab.new(self, nil, + Tk::BLT::Tabnotebook::Tab.new(self, nil, tk_send('insert', tagindex(pos), keys)) end Index: ext/tk/lib/tkextlib/blt/unix_dnd.rb =================================================================== --- ext/tk/lib/tkextlib/blt/unix_dnd.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/unix_dnd.rb (working copy) @@ -30,9 +30,12 @@ end private :__item_config_cmd - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo + def cget_tkstring(win, option) + itemcget_tkstring(['cget', win], option) + end def cget(win, option) itemcget(['cget', win], option) end @@ -49,6 +52,9 @@ current_itemconfiginfo(['configure', win], slot) end + def token_cget_tkstring(win, option) + itemcget_tkstring(['token', 'cget', win], option) + end def token_cget(win, option) itemcget(['token', 'cget', win], option) end Index: ext/tk/lib/tkextlib/blt/ted.rb =================================================================== --- ext/tk/lib/tkextlib/blt/ted.rb (revision 23917) +++ ext/tk/lib/tkextlib/blt/ted.rb (working copy) @@ -30,9 +30,12 @@ end private :__item_config_cmd - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo + def cget_tkstring(master, option) + itemcget_tkstring(master, option) + end def cget(master, option) itemcget(master, option) end Index: ext/tk/lib/tkextlib/itk/setup.rb =================================================================== --- ext/tk/lib/tkextlib/itk/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/itk/setup.rb (working copy) @@ -2,8 +2,8 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/itk/incr_tk.rb =================================================================== --- ext/tk/lib/tkextlib/itk/incr_tk.rb (revision 23917) +++ ext/tk/lib/tkextlib/itk/incr_tk.rb (working copy) @@ -99,7 +99,7 @@ def itk_option_define(name, resource, klass, init, config=None) tk_call('itk_option', 'define', name, resource, klass, init, config) end - + def itk_option_remove(*args) tk_call('itk_option', 'remove', *args) end @@ -192,7 +192,7 @@ ComponentID_TBL.mutex.synchronize{ if ComponentID_TBL.key?(master) if ComponentID_TBL[master].key?(component) - return ComponentID_TBL[master][component] + return ComponentID_TBL[master][component] end else ComponentID_TBL[master] = {} Index: ext/tk/lib/tkextlib/winico/setup.rb =================================================================== --- ext/tk/lib/tkextlib/winico/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/winico/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/winico/winico.rb =================================================================== --- ext/tk/lib/tkextlib/winico/winico.rb (revision 23917) +++ ext/tk/lib/tkextlib/winico/winico.rb (working copy) @@ -46,7 +46,7 @@ end def self.info - simplelist(Tk.tk_call('winico', 'info')).collect{|id| + simplelist(Tk.tk_call('winico', 'info')).collect{|id| Tk::Winico.id2obj(id) } end @@ -82,7 +82,7 @@ elsif winico_id @id = winico_id else - fail ArgumentError, + fail ArgumentError, "must be given proper information from where loading icons" end @path = @id @@ -96,7 +96,7 @@ end def set_window(win_id, *opts) # opts := ?'big'|'small'?, ?pos? - # NOTE:: the window, which is denoted by win_id, MUST BE MAPPED. + # NOTE:: the window, which is denoted by win_id, MUST BE MAPPED. # If not, then this may fail or crash. tk_call('winico', 'setwindow', win_id, @id, *opts) end @@ -119,22 +119,22 @@ class Winico_callback < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst KEY_TBL = [ - [ ?m, ?s, :message ], - [ ?i, ?x, :icon ], - [ ?x, ?n, :x ], - [ ?y, ?n, :y ], - [ ?X, ?n, :last_x ], - [ ?Y, ?n, :last_y ], - [ ?t, ?n, :tickcount ], - [ ?w, ?n, :icon_idnum ], - [ ?l, ?n, :msg_idnum ], + [ ?m, ?s, :message ], + [ ?i, ?x, :icon ], + [ ?x, ?n, :x ], + [ ?y, ?n, :y ], + [ ?X, ?n, :last_x ], + [ ?Y, ?n, :last_y ], + [ ?t, ?n, :tickcount ], + [ ?w, ?n, :icon_idnum ], + [ ?l, ?n, :msg_idnum ], nil ] PROC_TBL = [ - [ ?n, TkComm.method(:number) ], - [ ?s, TkComm.method(:string) ], - [ ?x, proc{|id| + [ ?n, TkComm.method(:number) ], + [ ?s, TkComm.method(:string) ], + [ ?x, proc{|id| Tk::Winico::WinicoID_TBL.mutex.synchronize{ if Tk::Winico::WinicoID_TBL.key?(id) obj = Tk::Winico::WinicoID_TBL[id] @@ -146,7 +146,7 @@ end obj } - } ], + } ], nil ] Index: ext/tk/lib/tkextlib/setup.rb =================================================================== --- ext/tk/lib/tkextlib/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/setup.rb (working copy) @@ -1,8 +1,8 @@ # # setup.rb -- setup script before using Tk extension libraries # -# If you need some setup operations for Tk extensions (for example, -# modify the dynamic library path) required, please write the setup -# operations in this file. This file is required at the last of -# "require 'tk'". +# If you need some setup operations for Tk extensions (for example, +# modify the dynamic library path) required, please write the setup +# operations in this file. This file is required at the last of +# "require 'tk'". # Index: ext/tk/lib/tkextlib/tkDND/setup.rb =================================================================== --- ext/tk/lib/tkextlib/tkDND/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/tkDND/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/tkDND/tkdnd.rb =================================================================== --- ext/tk/lib/tkextlib/tkDND/tkdnd.rb (revision 23917) +++ ext/tk/lib/tkextlib/tkDND/tkdnd.rb (working copy) @@ -30,30 +30,30 @@ class DND_Subst < TkUtil::CallbackSubst KEY_TBL = [ - [ ?a, ?l, :actions ], - [ ?A, ?s, :action ], - [ ?b, ?L, :codes ], - [ ?c, ?s, :code ], - [ ?d, ?l, :descriptions ], - [ ?D, ?l, :data ], - [ ?L, ?l, :source_types ], - [ ?m, ?l, :modifiers ], - [ ?t, ?l, :types ], - [ ?T, ?s, :type ], - [ ?W, ?w, :widget ], - [ ?x, ?n, :x ], - [ ?X, ?n, :x_root ], - [ ?y, ?n, :y ], - [ ?Y, ?n, :y_root ], + [ ?a, ?l, :actions ], + [ ?A, ?s, :action ], + [ ?b, ?L, :codes ], + [ ?c, ?s, :code ], + [ ?d, ?l, :descriptions ], + [ ?D, ?l, :data ], + [ ?L, ?l, :source_types ], + [ ?m, ?l, :modifiers ], + [ ?t, ?l, :types ], + [ ?T, ?s, :type ], + [ ?W, ?w, :widget ], + [ ?x, ?n, :x ], + [ ?X, ?n, :x_root ], + [ ?y, ?n, :y ], + [ ?Y, ?n, :y_root ], nil ] PROC_TBL = [ - [ ?n, TkComm.method(:num_or_str) ], - [ ?s, TkComm.method(:string) ], - [ ?l, TkComm.method(:list) ], - [ ?L, TkComm.method(:simplelist) ], - [ ?w, TkComm.method(:window) ], + [ ?n, TkComm.method(:num_or_str) ], + [ ?s, TkComm.method(:string) ], + [ ?l, TkComm.method(:list) ], + [ ?L, TkComm.method(:simplelist) ], + [ ?w, TkComm.method(:window) ], nil ] @@ -101,11 +101,11 @@ #def dnd_bindtarget(type, event, cmd=Proc.new, prior=50, *args) # event = tk_event_sequence(event) # if prior.kind_of?(Numeric) - # tk_call('dnd', 'bindtarget', @path, type, event, - # install_bind_for_event_class(DND_Subst, cmd, *args), + # tk_call('dnd', 'bindtarget', @path, type, event, + # install_bind_for_event_class(DND_Subst, cmd, *args), # prior) # else - # tk_call('dnd', 'bindtarget', @path, type, event, + # tk_call('dnd', 'bindtarget', @path, type, event, # install_bind_for_event_class(DND_Subst, cmd, prior, *args)) # end # self @@ -123,11 +123,11 @@ event = tk_event_sequence(event) if prior.kind_of?(Numeric) - tk_call('dnd', 'bindtarget', @path, type, event, - install_bind_for_event_class(DND_Subst, cmd, *args), + tk_call('dnd', 'bindtarget', @path, type, event, + install_bind_for_event_class(DND_Subst, cmd, *args), prior) else - tk_call('dnd', 'bindtarget', @path, type, event, + tk_call('dnd', 'bindtarget', @path, type, event, install_bind_for_event_class(DND_Subst, cmd, prior, *args)) end self Index: ext/tk/lib/tkextlib/tcllib/cursor.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/cursor.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/cursor.rb (working copy) @@ -44,8 +44,8 @@ end def self.cursor_display(parent=None) - # Pops up a dialog with a listbox containing all the cursor names. - # Selecting a cursor name will display it in that dialog. + # Pops up a dialog with a listbox containing all the cursor names. + # Selecting a cursor name will display it in that dialog. # This is simply for viewing any available cursors on the platform . #tk_call_without_enc('::cursor::display', parent) Tk::Tcllib::Cursor.cursor_display(parent) @@ -54,15 +54,15 @@ class TkWindow def cursor_propagate(cursor) - # Sets the cursor for self and all its descendants to cursor. + # Sets the cursor for self and all its descendants to cursor. #tk_call_without_enc('::cursor::propagate', @path, cursor) Tk::Tcllib::Cursor.cursor_propagate(self, cursor) end def cursor_restore(cursor = None) - # Restore the original or previously set cursor for self and all its - # descendants. If cursor is specified, that will be used if on any - # widget that did not have a preset cursor (set by a previous call - # to TkWindow#cursor_propagate). + # Restore the original or previously set cursor for self and all its + # descendants. If cursor is specified, that will be used if on any + # widget that did not have a preset cursor (set by a previous call + # to TkWindow#cursor_propagate). #tk_call_without_enc('::cursor::restore', @path, cursor) Tk::Tcllib::Cursor.cursor_restore(self, cursor) end Index: ext/tk/lib/tkextlib/tcllib/datefield.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/datefield.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/datefield.rb (working copy) @@ -7,12 +7,12 @@ # # (The following is the original description of the library.) # -# The datefield package provides the datefield widget which is an enhanced -# text entry widget for the purpose of date entry. Only valid dates of the +# The datefield package provides the datefield widget which is an enhanced +# text entry widget for the purpose of date entry. Only valid dates of the # form MM/DD/YYYY can be entered. -# -# The datefield widget is, in fact, just an entry widget with specialized -# bindings. This means all the command and options for an entry widget apply +# +# The datefield widget is, in fact, just an entry widget with specialized +# bindings. This means all the command and options for an entry widget apply # equally here. require 'tk' @@ -47,7 +47,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) Index: ext/tk/lib/tkextlib/tcllib/autoscroll.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/autoscroll.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/autoscroll.rb (working copy) @@ -7,20 +7,20 @@ # # (The following is the original description of the library.) # -# This package allows scrollbars to be mapped and unmapped as needed -# depending on the size and content of the scrollbars scrolled widget. -# The scrollbar must be managed by either pack or grid, other geometry +# This package allows scrollbars to be mapped and unmapped as needed +# depending on the size and content of the scrollbars scrolled widget. +# The scrollbar must be managed by either pack or grid, other geometry # managers are not supported. # -# When managed by pack, any geometry changes made in the scrollbars parent -# between the time a scrollbar is unmapped, and when it is mapped will be -# lost. It is an error to destroy any of the scrollbars siblings while the -# scrollbar is unmapped. When managed by grid, if anything becomes gridded -# in the same row and column the scrollbar occupied it will be replaced by +# When managed by pack, any geometry changes made in the scrollbars parent +# between the time a scrollbar is unmapped, and when it is mapped will be +# lost. It is an error to destroy any of the scrollbars siblings while the +# scrollbar is unmapped. When managed by grid, if anything becomes gridded +# in the same row and column the scrollbar occupied it will be replaced by # the scrollbar when remapped. # -# This package may be used on any scrollbar-like widget as long as it -# supports the set subcommand in the same style as scrollbar. If the set +# This package may be used on any scrollbar-like widget as long as it +# supports the set subcommand in the same style as scrollbar. If the set # subcommand is not used then this package will have no effect. # @@ -110,14 +110,14 @@ class Tk::Scrollbar def autoscroll - # Arranges for the already existing scrollbar to be mapped + # Arranges for the already existing scrollbar to be mapped # and unmapped as needed. #tk_call_without_enc('::autoscroll::autoscroll', @path) Tk::Tcllib::Autoscroll.autoscroll(self) self end def unautoscroll - # Returns the scrollbar to its original static state. + # Returns the scrollbar to its original static state. #tk_call_without_enc('::autoscroll::unautoscroll', @path) Tk::Tcllib::Autoscroll.unautoscroll(self) self Index: ext/tk/lib/tkextlib/tcllib/ctext.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/ctext.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/ctext.rb (working copy) @@ -39,7 +39,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) @@ -48,7 +48,7 @@ private :create_self def __strval_optkeys - super() << 'linemapfg' << 'linemapbg' << + super() << 'linemapfg' << 'linemapbg' << 'linemap_select_fg' << 'linemap_select_bg' end private :__strval_optkeys @@ -96,19 +96,19 @@ end def add_highlight_class_for_special_chars(klass, col, *chrs) - tk_call('ctext::addHighlightClassForSpecialChars', + tk_call('ctext::addHighlightClassForSpecialChars', @path, klass, col, chrs.join('')) self end def add_highlight_class_for_regexp(klass, col, tcl_regexp) - tk_call('ctext::addHighlightClassForRegexp', + tk_call('ctext::addHighlightClassForRegexp', @path, klass, col, tcl_regexp) self end def add_highlight_class_with_only_char_start(klass, col, chr) - tk_call('ctext::addHighlightClassWithOnlyCharStart', + tk_call('ctext::addHighlightClassWithOnlyCharStart', @path, klass, col, chr) self end Index: ext/tk/lib/tkextlib/tcllib/ip_entry.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/ip_entry.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/ip_entry.rb (working copy) @@ -7,7 +7,7 @@ # # (The following is the original description of the library.) # -# This package provides a widget for the entering of a IP address. +# This package provides a widget for the entering of a IP address. # It guarantees a valid address at all times. require 'tk' @@ -43,7 +43,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) Index: ext/tk/lib/tkextlib/tcllib/ruler.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/ruler.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/ruler.rb (working copy) @@ -46,7 +46,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) Index: ext/tk/lib/tkextlib/tcllib/screenruler.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/screenruler.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/screenruler.rb (working copy) @@ -47,7 +47,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) Index: ext/tk/lib/tkextlib/tcllib/tooltip.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/tooltip.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/tooltip.rb (working copy) @@ -3,7 +3,7 @@ # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # # * Part of tcllib extension -# * Provides tooltips, a small text message that is displayed when the +# * Provides tooltips, a small text message that is displayed when the # mouse hovers over a widget. # Index: ext/tk/lib/tkextlib/tcllib/tablelist_core.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/tablelist_core.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/tablelist_core.rb (working copy) @@ -4,7 +4,7 @@ # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # # * Part of tcllib extension -# * This file is required by 'tkextlib/tcllib/tablelist.rb' or +# * This file is required by 'tkextlib/tcllib/tablelist.rb' or # 'tkextlib/tcllib/tablelist_tile.rb'. # @@ -54,7 +54,7 @@ elsif idx =~ /([^,]+),([^,]+)/ row = $1, column = $2 [num_or_str(row), num_or_str(column)] - else + else num_or_str(idx) end end @@ -67,6 +67,9 @@ [self.path, mixed_id[0] + 'configure', _to_idx(mixed_id[1])] end + def cell_cget_tkstring(tagOrId, option) + itemcget_tkstring(['cell', tagOrId], option) + end def cell_cget(tagOrId, option) itemcget(['cell', tagOrId], option) end @@ -82,12 +85,16 @@ def current_cell_configinfo(tagOrId, slot=nil) current_itemconfiginfo(['cell', tagOrId], slot) end + alias cellcget_tkstring cell_cget_tkstring alias cellcget cell_cget alias cellcget_strict cell_cget_strict alias cellconfigure cell_configure alias cellconfiginfo cell_configinfo alias current_cellconfiginfo current_cell_configinfo + def column_cget_tkstring(tagOrId, option) + itemcget_tkstring(['column', tagOrId], option) + end def column_cget(tagOrId, option) itemcget(['column', tagOrId], option) end @@ -103,12 +110,16 @@ def current_column_configinfo(tagOrId, slot=nil) current_itemconfiginfo(['column', tagOrId], slot) end + alias columncget_tkstring column_cget_tkstring alias columncget column_cget alias columncget_strict column_cget_strict alias columnconfigure column_configure alias columnconfiginfo column_configinfo alias current_columnconfiginfo current_column_configinfo + def row_cget_tkstring(tagOrId, option) + itemcget_tkstring(['row', tagOrId], option) + end def row_cget(tagOrId, option) itemcget(['row', tagOrId], option) end @@ -124,13 +135,14 @@ def current_row_configinfo(tagOrId, slot=nil) current_itemconfiginfo(['row', tagOrId], slot) end + alias rowcget_tkstring row_cget_tkstring alias rowcget row_cget alias rowcget_strict row_cget_strict alias rowconfigure row_configure alias rowconfiginfo row_configinfo alias current_rowconfiginfo current_row_configinfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo end @@ -144,7 +156,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) @@ -166,8 +178,8 @@ def __boolval_optkeys super() + [ - 'forceeditendcommand', 'movablecolumns', 'movablerows', - 'protecttitlecolumns', 'resizablecolumns', + 'forceeditendcommand', 'movablecolumns', 'movablerows', + 'protecttitlecolumns', 'resizablecolumns', 'showarrow', 'showlabels', 'showseparators' ] end @@ -194,7 +206,7 @@ # The method is used to convert a ruby's object to a opt-value. # When set the value of the option "key", "proc.call(value)" is called. # That is, "-#{key} #{proc.call(value)}". - super().update('stretch'=>proc{|v| + super().update('stretch'=>proc{|v| (v.kind_of?(Array))? v.collect{|e| _to_idx(e)}: v }) end @@ -218,7 +230,7 @@ def __item_boolval_optkeys(id) super(id) + [ - 'editable', 'hide', 'resizable', 'showarrow', 'stretchable', + 'editable', 'hide', 'resizable', 'showarrow', 'stretchable', ] end private :__item_boolval_optkeys @@ -249,7 +261,7 @@ tk_send('activatecell', _to_idx(index)) self end - alias activatecell activate_cell + alias activatecell activate_cell def get_attrib(name=nil) if name && name != None @@ -280,7 +292,7 @@ TkBindTag.new_by_name(tk_send('bodytag')) end - def cancel_editing + def cancel_editing tk_send('cancelediting') self end @@ -338,7 +350,7 @@ idx = _from_idx(tk_send('containingcell', x, y)) if idx.kind_of?(Array) [ - ((idx[0].kind_of?(Fixnum) && idx[0] < 0)? nil: idx[0]), + ((idx[0].kind_of?(Fixnum) && idx[0] < 0)? nil: idx[0]), ((idx[1].kind_of?(Fixnum) && idx[1] < 0)? nil: idx[1]) ] else @@ -698,7 +710,7 @@ ############################################################ - # with the BWidget package + # with the BWidget package def addBWidgetEntry(name=None) Tk.tk_call('::tablelist::addBWidgetEntry', name) end @@ -713,7 +725,7 @@ ############################################################ - # with the Iwidgets ([incr Widgets]) package + # with the Iwidgets ([incr Widgets]) package def addIncrEntryfield(name=None) Tk.tk_call('::tablelist::addIncrEntry', name) end Index: ext/tk/lib/tkextlib/tcllib/tkpiechart.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/tkpiechart.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/tkpiechart.rb (working copy) @@ -52,7 +52,7 @@ private :__config_cmd def __configinfo_struct - {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, + {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, :default_value=>1, :current_value=>2} end private :__configinfo_struct @@ -63,7 +63,7 @@ private :__boolval_optkeys def __strval_optkeys - super() << 'bordercolor' << 'textbackground' << + super() << 'bordercolor' << 'textbackground' << 'widestvaluetext' << 'title' end private :__strval_optkeys @@ -90,7 +90,7 @@ def create_self(x, y, width, height, keys=None) if keys and keys != None - @tag_key = tk_call_without_enc('::stooop::new', 'pie', + @tag_key = tk_call_without_enc('::stooop::new', 'pie', @c, x, y, *hash_kv(keys, true)) else @tag_key = tk_call_without_enc('::stooop::new', 'pie', @c, x, y) @@ -148,7 +148,7 @@ end def selected_slices - tk_split_simplelist(tk_call_without_enc('pie::selectedSlices', + tk_split_simplelist(tk_call_without_enc('pie::selectedSlices', @tag_key)).collect{|slice| @slice_tbl[slice] || Slice.new(:no_create, self, slice) } @@ -212,7 +212,7 @@ end def size(share, disp=None) - tk_call_without_enc('pie::sizeSlice', + tk_call_without_enc('pie::sizeSlice', @pie.tag_key, @tag_key, share, disp) self end @@ -236,7 +236,7 @@ def create_self(keys=None) if keys and keys != None - @tag_key = tk_call_without_enc('::stooop::new', 'pieBoxLabeler', + @tag_key = tk_call_without_enc('::stooop::new', 'pieBoxLabeler', *hash_kv(keys, true)) else @tag_key = tk_call_without_enc('::stooop::new', 'pieBoxLabeler') @@ -268,8 +268,8 @@ def create_self(keys=None) if keys and keys != None - @tag_key = tk_call_without_enc('::stooop::new', - 'piePeripheralLabeler', + @tag_key = tk_call_without_enc('::stooop::new', + 'piePeripheralLabeler', *hash_kv(keys, true)) else @tag_key = tk_call_without_enc('::stooop::new', 'piePeripheralLabeler') @@ -296,11 +296,11 @@ def create_self(x, y, keys=None) if keys and keys != None - @tag_key = tk_call_without_enc('::stooop::new', 'canvasLabel', - @c, x, y, width, height, + @tag_key = tk_call_without_enc('::stooop::new', 'canvasLabel', + @c, x, y, width, height, *hash_kv(keys, true)) else - @tag_key = tk_call_without_enc('::stooop::new', 'canvasLabel', + @tag_key = tk_call_without_enc('::stooop::new', 'canvasLabel', @c, x, y, width, height) end Index: ext/tk/lib/tkextlib/tcllib/dialog.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/dialog.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/dialog.rb (working copy) @@ -41,7 +41,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) Index: ext/tk/lib/tkextlib/tcllib/setup.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/tcllib/plotchart.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/plotchart.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/plotchart.rb (working copy) @@ -7,10 +7,10 @@ # # (The following is the original description of the library.) # -# Plotchart is a Tcl-only package that focuses on the easy creation of -# xy-plots, barcharts and other common types of graphical presentations. -# The emphasis is on ease of use, rather than flexibility. The procedures -# that create a plot use the entire canvas window, making the layout of the +# Plotchart is a Tcl-only package that focuses on the easy creation of +# xy-plots, barcharts and other common types of graphical presentations. +# The emphasis is on ease of use, rather than flexibility. The procedures +# that create a plot use the entire canvas window, making the layout of the # plot completely automatic. # # This results in the creation of an xy-plot in, say, ten lines of code: @@ -32,27 +32,27 @@ # $s title "Data series" # -------------------------------------------------------------------- # -# A drawback of the package might be that it does not do any data management. -# So if the canvas that holds the plot is to be resized, the whole plot must -# be redrawn. The advantage, though, is that it offers a number of plot and +# A drawback of the package might be that it does not do any data management. +# So if the canvas that holds the plot is to be resized, the whole plot must +# be redrawn. The advantage, though, is that it offers a number of plot and # chart types: # # * XY-plots like the one shown above with any number of data series. -# * Stripcharts, a kind of XY-plots where the horizontal axis is adjusted -# automatically. The result is a kind of sliding window on the data +# * Stripcharts, a kind of XY-plots where the horizontal axis is adjusted +# automatically. The result is a kind of sliding window on the data # series. # * Polar plots, where the coordinates are polar instead of cartesian. -# * Isometric plots, where the scale of the coordinates in the two -# directions is always the same, i.e. a circle in world coordinates +# * Isometric plots, where the scale of the coordinates in the two +# directions is always the same, i.e. a circle in world coordinates # appears as a circle on the screen. -# You can zoom in and out, as well as pan with these plots (Note: this -# works best if no axes are drawn, the zooming and panning routines do -# not distinguish the axes), using the mouse buttons with the control +# You can zoom in and out, as well as pan with these plots (Note: this +# works best if no axes are drawn, the zooming and panning routines do +# not distinguish the axes), using the mouse buttons with the control # key and the arrow keys with the control key. # * Piecharts, with automatic scaling to indicate the proportions. -# * Barcharts, with either vertical or horizontal bars, stacked bars or +# * Barcharts, with either vertical or horizontal bars, stacked bars or # bars side by side. -# * Timecharts, where bars indicate a time period and milestones or other +# * Timecharts, where bars indicate a time period and milestones or other # important moments in time are represented by triangles. # * 3D plots (both for displaying surfaces and 3D bars) # @@ -91,13 +91,13 @@ end def self.world_coordinates(w, *args) # args := xmin, ymin, xmax, ymax - tk_call_without_enc('::Plotchart::worldCoordinates', + tk_call_without_enc('::Plotchart::worldCoordinates', w.path, *(args.flatten)) end - def self.world_3D_coordinates(w, *args) + def self.world_3D_coordinates(w, *args) # args := xmin, ymin, zmin, xmax, ymax, zmax - tk_call_without_enc('::Plotchart::world3DCoordinates', + tk_call_without_enc('::Plotchart::world3DCoordinates', w.path, *(args.flatten)) end @@ -157,7 +157,7 @@ if key.kind_of?(Hash) tk_call_without_enc(@chart, 'xconfig', *hash_kv(key, true)) else - tk_call_without_enc(@chart, 'xconfig', + tk_call_without_enc(@chart, 'xconfig', "-#{key}", _get_eval_enc_str(value)) end self @@ -167,7 +167,7 @@ if key.kind_of?(Hash) tk_call_without_enc(@chart, 'yconfig', *hash_kv(key, true)) else - tk_call_without_enc(@chart, 'yconfig', + tk_call_without_enc(@chart, 'yconfig', "-#{key}", _get_eval_enc_str(value)) end self @@ -180,14 +180,14 @@ end def world_coordinates(*args) # args := xmin, ymin, xmax, ymax - tk_call_without_enc('::Plotchart::worldCoordinates', + tk_call_without_enc('::Plotchart::worldCoordinates', @path, *(args.flatten)) self end - def world_3D_coordinates(*args) + def world_3D_coordinates(*args) # args := xmin, ymin, zmin, xmax, ymax, zmax - tk_call_without_enc('::Plotchart::world3DCoordinates', + tk_call_without_enc('::Plotchart::world3DCoordinates', @path, *(args.flatten)) self end @@ -229,7 +229,7 @@ include ChartMethod TkCommandNames = [ - 'canvas'.freeze, + 'canvas'.freeze, '::Plotchart::createXYPlot'.freeze ].freeze @@ -259,7 +259,7 @@ def _create_chart p self.class::TkCommandNames[1] if $DEBUG - tk_call_without_enc(self.class::TkCommandNames[1], @path, + tk_call_without_enc(self.class::TkCommandNames[1], @path, array2tk_list(@xaxis), array2tk_list(@yaxis)) end private :_create_chart @@ -324,7 +324,7 @@ if key.kind_of?(Hash) tk_call_without_enc(@chart, 'dataconfig', series, *hash_kv(key, true)) else - tk_call_without_enc(@chart, 'dataconfig', series, + tk_call_without_enc(@chart, 'dataconfig', series, "-#{key}", _get_eval_enc_str(value)) end end @@ -333,7 +333,7 @@ ############################ class Stripchart < XYPlot TkCommandNames = [ - 'canvas'.freeze, + 'canvas'.freeze, '::Plotchart::createStripchart'.freeze ].freeze end @@ -343,7 +343,7 @@ include ChartMethod TkCommandNames = [ - 'canvas'.freeze, + 'canvas'.freeze, '::Plotchart::createPolarplot'.freeze ].freeze @@ -370,7 +370,7 @@ def _create_chart p self.class::TkCommandNames[1] if $DEBUG - tk_call_without_enc(self.class::TkCommandNames[1], @path, + tk_call_without_enc(self.class::TkCommandNames[1], @path, array2tk_list(@radius_data)) end private :_create_chart @@ -382,7 +382,7 @@ end def plot(series, radius, angle) - tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(series), + tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(series), radius, angle) self end @@ -391,7 +391,7 @@ if key.kind_of?(Hash) tk_call_without_enc(@chart, 'dataconfig', series, *hash_kv(key, true)) else - tk_call_without_enc(@chart, 'dataconfig', series, + tk_call_without_enc(@chart, 'dataconfig', series, "-#{key}", _get_eval_enc_str(value)) end end @@ -403,7 +403,7 @@ include ChartMethod TkCommandNames = [ - 'canvas'.freeze, + 'canvas'.freeze, '::Plotchart::createIsometricPlot'.freeze ].freeze @@ -446,8 +446,8 @@ def _create_chart p self.class::TkCommandNames[1] if $DEBUG - tk_call_without_enc(self.class::TkCommandNames[1], @path, - array2tk_list(@xaxis), array2tk_list(@yaxis), + tk_call_without_enc(self.class::TkCommandNames[1], @path, + array2tk_list(@xaxis), array2tk_list(@yaxis), @stepsize) end private :_create_chart @@ -483,7 +483,7 @@ include ChartMethod TkCommandNames = [ - 'canvas'.freeze, + 'canvas'.freeze, '::Plotchart::create3DPlot'.freeze ].freeze @@ -516,9 +516,9 @@ def _create_chart p self.class::TkCommandNames[1] if $DEBUG - tk_call_without_enc(self.class::TkCommandNames[1], @path, - array2tk_list(@xaxis), - array2tk_list(@yaxis), + tk_call_without_enc(self.class::TkCommandNames[1], @path, + array2tk_list(@xaxis), + array2tk_list(@yaxis), array2tk_list(@zaxis)) end private :_create_chart @@ -542,10 +542,10 @@ end def plot_data(dat) - # dat has to be provided as a 2 level array. - # 1st level contains rows, drawn in y-direction, - # and each row is an array whose elements are drawn in x-direction, - # for the columns. + # dat has to be provided as a 2 level array. + # 1st level contains rows, drawn in y-direction, + # and each row is an array whose elements are drawn in x-direction, + # for the columns. tk_call_without_enc(@chart, 'plotdata', dat) self end @@ -565,7 +565,7 @@ include ChartMethod TkCommandNames = [ - 'canvas'.freeze, + 'canvas'.freeze, '::Plotchart::createPiechart'.freeze ].freeze @@ -596,11 +596,11 @@ include ChartMethod TkCommandNames = [ - 'canvas'.freeze, + 'canvas'.freeze, '::Plotchart::createBarchart'.freeze ].freeze - def initialize(*args) + def initialize(*args) # args := ([parent,] xlabels, ylabels [, series] [, keys]) # xlabels, ylabels := labels | axis ( depend on normal or horizontal ) # labels := Array of [label, label, ...] @@ -642,8 +642,8 @@ def _create_chart p self.class::TkCommandNames[1] if $DEBUG - tk_call_without_enc(self.class::TkCommandNames[1], @path, - array2tk_list(@xlabels), array2tk_list(@ylabels), + tk_call_without_enc(self.class::TkCommandNames[1], @path, + array2tk_list(@xlabels), array2tk_list(@ylabels), @series_size) end private :_create_chart @@ -672,7 +672,7 @@ ############################ class HorizontalBarchart < Barchart TkCommandNames = [ - 'canvas'.freeze, + 'canvas'.freeze, '::Plotchart::createHorizontalBarchart'.freeze ].freeze end @@ -717,7 +717,7 @@ def _create_chart p self.class::TkCommandNames[1] if $DEBUG - tk_call_without_enc(self.class::TkCommandNames[1], @path, + tk_call_without_enc(self.class::TkCommandNames[1], @path, @time_begin, @time_end, @items) end private :_create_chart @@ -790,13 +790,13 @@ def _create_chart p self.class::TkCommandNames[1] if $DEBUG - tk_call_without_enc(self.class::TkCommandNames[1], @path, + tk_call_without_enc(self.class::TkCommandNames[1], @path, @time_begin, @time_end, @items, @text_width) end private :_create_chart def task(txt, time_begin, time_end, completed=0.0) - list(tk_call_without_enc(@chart, 'task', txt, time_begin, time_end, + list(tk_call_without_enc(@chart, 'task', txt, time_begin, time_end, completed)).collect!{|id| TkcItem.id2obj(self, id) } Index: ext/tk/lib/tkextlib/tcllib/getstring.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/getstring.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/getstring.rb (working copy) @@ -74,7 +74,7 @@ def show @variable.value = '' - @status = bool(tk_call(self.class::TkCommandNames[0], + @status = bool(tk_call(self.class::TkCommandNames[0], @path, @variable, @text, *hash_kv(@keys))) end alias display show Index: ext/tk/lib/tkextlib/tcllib/swaplist.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/swaplist.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/swaplist.rb (working copy) @@ -44,7 +44,7 @@ self.show(*args) end - def initialize(*args) + def initialize(*args) # args = (parent=nil, complete_list=[], selected_list=[], keys=nil) keys = args.pop if keys.kind_of?(Hash) @@ -74,9 +74,9 @@ def show @variable.value = '' - @status = bool(tk_call(self.class::TkCommandNames[0], - @path, @variable, - @complete_list, @selected_list, + @status = bool(tk_call(self.class::TkCommandNames[0], + @path, @variable, + @complete_list, @selected_list, *hash_kv(@keys))) end alias display show Index: ext/tk/lib/tkextlib/tcllib/superframe.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/superframe.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/superframe.rb (working copy) @@ -37,7 +37,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) Index: ext/tk/lib/tkextlib/tcllib/panelframe.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/panelframe.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/panelframe.rb (working copy) @@ -37,7 +37,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) Index: ext/tk/lib/tkextlib/tcllib/ico.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/ico.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/ico.rb (working copy) @@ -50,23 +50,23 @@ def self.get_data(file, index, keys={}) keys['format'] = 'data' - tk_split_list(tk_call_without_enc('::ico::getIcon', file, index, + tk_split_list(tk_call_without_enc('::ico::getIcon', file, index, *hash_kv(keys, true))) end def self.write(file, index, depth, data, keys=nil) - tk_call_without_enc('::ico::writeIcon', file, index, depth, data, + tk_call_without_enc('::ico::writeIcon', file, index, depth, data, *hash_kv(keys, true)) end def self.copy(from_file, from_index, to_file, to_index, keys=nil) - tk_call_without_enc('::ico::copyIcon', - from_file, from_index, to_file, to_index, + tk_call_without_enc('::ico::copyIcon', + from_file, from_index, to_file, to_index, *hash_kv(keys, true)) end def self.exe_to_ico(exe_file, ico_file, keys=nil) - tk_call_without_enc('::ico::copyIcon', exe_file, ico_file, + tk_call_without_enc('::ico::copyIcon', exe_file, ico_file, *hash_kv(keys, true)) end @@ -76,7 +76,7 @@ def self.transparent_color(image, color) if image.kind_of?(Array) - tk_split_list(tk_call_without_enc('::ico::transparentColor', + tk_split_list(tk_call_without_enc('::ico::transparentColor', image, color)) else tk_call_without_enc('::ico::transparentColor', image, color) @@ -99,7 +99,7 @@ Tk_Image_ID[1].succ! } end - tk_call_without_enc('::ico::getIcon', file, index, '-name', @path, + tk_call_without_enc('::ico::getIcon', file, index, '-name', @path, '-format', 'image', *hash_kv(keys, true)) Tk_IMGTBL[@path] = self end Index: ext/tk/lib/tkextlib/tcllib/scrollwin.rb =================================================================== --- ext/tk/lib/tkextlib/tcllib/scrollwin.rb (revision 23917) +++ ext/tk/lib/tkextlib/tcllib/scrollwin.rb (working copy) @@ -42,7 +42,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) Index: ext/tk/lib/tkextlib/ICONS/setup.rb =================================================================== --- ext/tk/lib/tkextlib/ICONS/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/ICONS/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/ICONS/icons.rb =================================================================== --- ext/tk/lib/tkextlib/ICONS/icons.rb (revision 23917) +++ ext/tk/lib/tkextlib/ICONS/icons.rb (working copy) @@ -34,10 +34,10 @@ def self.create(*args) # icon, icon, ..., ?option=>value, ...? if args[-1].kind_of?(Hash) keys = args.pop - icons = simplelist(tk_call('::icons::icons', 'create', + icons = simplelist(tk_call('::icons::icons', 'create', *(hash_kv(keys) << (args.flatten)))) else - icons = simplelist(tk_call('::icons::icons', 'create', + icons = simplelist(tk_call('::icons::icons', 'create', args.flatten)) end @@ -66,7 +66,7 @@ def self.query(*args) # icon, icon, ..., ?option=>value, ...? if args[-1].kind_of?(Hash) keys = args.pop - simplelist(tk_call('::icons::icons', 'query', + simplelist(tk_call('::icons::icons', 'query', *(hash_kv(keys) << (args.flatten)))) else simplelist(tk_call('::icons::icons', 'query', args.flatten)) @@ -121,7 +121,7 @@ end def query(keys={}) - list(simplelist(tk_call('::icons::icons', 'query', + list(simplelist(tk_call('::icons::icons', 'query', *(hash_kv(keys) << @name)) )[0]) end Index: ext/tk/lib/tkextlib/tkimg/setup.rb =================================================================== --- ext/tk/lib/tkextlib/tkimg/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/tkimg/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/treectrl/setup.rb =================================================================== --- ext/tk/lib/tkextlib/treectrl/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/treectrl/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/treectrl/tktreectrl.rb =================================================================== --- ext/tk/lib/tkextlib/treectrl/tktreectrl.rb (revision 23917) +++ ext/tk/lib/tkextlib/treectrl/tktreectrl.rb (working copy) @@ -32,14 +32,14 @@ end end - HasColumnCreateCommand = + HasColumnCreateCommand = (TkPackage.vcompare(self.package_version, '1.1') >= 0) - # dummy :: - # pkgIndex.tcl of TreeCtrl-1.0 doesn't support auto_load for - # 'loupe' command (probably it is bug, I think). - # So, calling a 'treectrl' command for loading the dll with - # the auto_load facility. + # dummy :: + # pkgIndex.tcl of TreeCtrl-1.0 doesn't support auto_load for + # 'loupe' command (probably it is bug, I think). + # So, calling a 'treectrl' command for loading the dll with + # the auto_load facility. begin tk_call('treectrl') rescue @@ -48,7 +48,7 @@ # NOTE: platform == 'unix' only # img => TkPhotoImage - # x, y => screen coords + # x, y => screen coords # w, h => magnifier width and height # zoom => zooming rate Tk.tk_call_without_enc('loupe', img, x, y, w, h, zoom) @@ -76,28 +76,28 @@ class Tk::TreeCtrl::NotifyEvent # [ <'%' subst-key char>, , ] KEY_TBL = [ - [ ?c, ?n, :item_num ], - [ ?d, ?s, :detail ], - [ ?D, ?l, :items ], - [ ?e, ?e, :event ], - [ ?I, ?n, :id ], - [ ?l, ?n, :lower_bound ], - [ ?p, ?n, :active_id ], - [ ?P, ?e, :pattern ], - [ ?S, ?l, :sel_items ], - [ ?T, ?w, :widget ], - [ ?u, ?n, :upper_bound ], - [ ?W, ?o, :object ], - [ ??, ?x, :parm_info ], + [ ?c, ?n, :item_num ], + [ ?d, ?s, :detail ], + [ ?D, ?l, :items ], + [ ?e, ?e, :event ], + [ ?I, ?n, :id ], + [ ?l, ?n, :lower_bound ], + [ ?p, ?n, :active_id ], + [ ?P, ?e, :pattern ], + [ ?S, ?l, :sel_items ], + [ ?T, ?w, :widget ], + [ ?u, ?n, :upper_bound ], + [ ?W, ?o, :object ], + [ ??, ?x, :parm_info ], nil ] # [ , ] PROC_TBL = [ - [ ?n, TkComm.method(:num_or_str) ], - [ ?s, TkComm.method(:string) ], - [ ?l, TkComm.method(:list) ], - [ ?w, TkComm.method(:window) ], + [ ?n, TkComm.method(:num_or_str) ], + [ ?s, TkComm.method(:string) ], + [ ?l, TkComm.method(:list) ], + [ ?w, TkComm.method(:window) ], [ ?e, proc{|val| case val @@ -109,9 +109,9 @@ val end } - ], + ], - [ ?o, proc{|val| TkComm.tk_tcl2ruby(val)} ], + [ ?o, proc{|val| TkComm.tk_tcl2ruby(val)} ], [ ?x, proc{|val| begin @@ -132,7 +132,7 @@ rescue val end - } ], + } ], nil ] @@ -157,15 +157,15 @@ # setup tables to be used by scan_args, _get_subst_key, _get_all_subst_keys # - # _get_subst_key() and _get_all_subst_keys() generates key-string - # which describe how to convert callback arguments to ruby objects. - # When binding parameters are given, use _get_subst_key(). - # But when no parameters are given, use _get_all_subst_keys() to - # create a Event class object as a callback parameter. + # _get_subst_key() and _get_all_subst_keys() generates key-string + # which describe how to convert callback arguments to ruby objects. + # When binding parameters are given, use _get_subst_key(). + # But when no parameters are given, use _get_all_subst_keys() to + # create a Event class object as a callback parameter. # - # scan_args() is used when doing callback. It convert arguments - # ( which are Tcl strings ) to ruby objects based on the key string - # that is generated by _get_subst_key() or _get_all_subst_keys(). + # scan_args() is used when doing callback. It convert arguments + # ( which are Tcl strings ) to ruby objects based on the key string + # that is generated by _get_subst_key() or _get_all_subst_keys(). # _setup_subst_table(KEY_TBL, PROC_TBL); end @@ -185,7 +185,7 @@ if (obj.kind_of?(Tk::TreeCtrl::Column) || obj.kind_of?(Tk::TreeCtrl::Element) || obj.kind_of?(Tk::TreeCtrl::Item) || - obj.kind_of?(Tk::TreeCtrl::Style)) + obj.kind_of?(Tk::TreeCtrl::Style)) obj = obj.id end @@ -236,7 +236,7 @@ def __item_cget_cmd(mixed_id) if mixed_id[0] == 'column' && mixed_id[1] == 'drag' return [self.path, 'column', 'dragcget'] - end + end if mixed_id[1].kind_of?(Array) id = mixed_id[1] @@ -255,7 +255,7 @@ def __item_config_cmd(mixed_id) if mixed_id[0] == 'column' && mixed_id[1] == 'drag' return [self.path, 'column', 'dragconfigure'] - end + end if mixed_id[1].kind_of?(Array) id = mixed_id[1] @@ -291,10 +291,10 @@ def __item_configinfo_struct(id) if id.kind_of?(Array) && id[0].to_s == 'notify' - {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, + {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, :default_value=>nil, :current_value=>1} else - {:key=>0, :alias=>1, :db_name=>1, :db_class=>2, + {:key=>0, :alias=>1, :db_name=>1, :db_class=>2, :default_value=>3, :current_value=>4} end end @@ -302,7 +302,7 @@ def __item_font_optkeys(id) - if id.kind_of?(Array) && (id[0] == 'element' || + if id.kind_of?(Array) && (id[0] == 'element' || (id[0].kind_of?(Array) && id[0][1] == 'element')) [] else @@ -335,7 +335,7 @@ if id[1] == 'drag' ['enable'] else - ['button', 'expand', 'resize', 'squeeze', 'sunken', + ['button', 'expand', 'resize', 'squeeze', 'sunken', 'visible', 'widthhack'] end when 'element' @@ -403,17 +403,20 @@ def __item_keyonly_optkeys(id) # { def_key=>(undef_key|nil), ... } { - 'notreally'=>nil, + 'notreally'=>nil, 'increasing'=>'decreasing', - 'decreasing'=>'increasing', + 'decreasing'=>'increasing', 'ascii'=>nil, - 'dictionary'=>nil, - 'integer'=>nil, + 'dictionary'=>nil, + 'integer'=>nil, 'real'=>nil } end private :__item_keyonly_optkeys + def column_cget_tkstring(tagOrId, option) + itemcget_tkstring(['column', tagOrId], option) + end def column_cget(tagOrId, option) itemcget(['column', tagOrId], option) end @@ -430,6 +433,9 @@ current_itemconfiginfo(['column', tagOrId], slot) end + def column_dragcget_tkstring(option) + itemcget_tkstring(['column', 'drag'], option) + end def column_dragcget(option) itemcget(['column', 'drag'], option) end @@ -446,6 +452,9 @@ current_itemconfiginfo(['column', 'drag'], slot) end + def debug_cget_tkstring(option) + itemcget_tkstring('debug', option) + end def debug_cget(option) itemcget('debug', option) end @@ -462,6 +471,9 @@ current_itemconfiginfo('debug', slot) end + def dragimage_cget_tkstring(option) + itemcget_tkstring('dragimage', option) + end def dragimage_cget(option) itemcget('dragimage', option) end @@ -478,6 +490,9 @@ current_itemconfiginfo('dragimage', slot) end + def element_cget_tkstring(tagOrId, option) + itemcget_tkstring(['element', tagOrId], option) + end def element_cget(tagOrId, option) itemcget(['element', tagOrId], option) end @@ -494,6 +509,9 @@ current_itemconfiginfo(['element', tagOrId], slot) end + def item_cget_tkstring(tagOrId, option) + itemcget_tkstring(['item', tagOrId], option) + end def item_cget(tagOrId, option) itemcget(['item', tagOrId], option) end @@ -510,6 +528,9 @@ current_itemconfiginfo(['item', tagOrId], slot) end + def item_element_cget_tkstring(item, column, elem, option) + itemcget_tkstring([['item', 'element'], [item, column, elem]], option) + end def item_element_cget(item, column, elem, option) itemcget([['item', 'element'], [item, column, elem]], option) end @@ -526,6 +547,9 @@ current_itemconfiginfo([['item', 'element'], [item, column, elem]], slot) end + def marquee_cget_tkstring(option) + itemcget_tkstring('marquee', option) + end def marquee_cget(option) itemcget('marquee', option) end @@ -542,6 +566,11 @@ current_itemconfiginfo('marquee', slot) end + def notify_cget_tkstring(win, pattern, option) + pattern = "<#{pattern}>" + # "notify" doesn't have cget subcommand. + tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(['notify', [win, pattern]])) << "-#{option}")), false, true)[-1] + end def notify_cget(win, pattern, option) pattern = "<#{pattern}>" # "notify" doesn't have cget subcommand. @@ -571,6 +600,9 @@ current_itemconfiginfo(['notify', [win, pattern]], slot) end + def style_cget_tkstring(tagOrId, option) + itemcget_tkstring(['style', tagOrId], option) + end def style_cget(tagOrId, option) itemcget(['style', tagOrId], option) end @@ -587,7 +619,7 @@ current_itemconfiginfo(['style', tagOrId], slot) end - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo end @@ -629,8 +661,8 @@ def __boolval_optkeys [ - 'itemwidthequal', 'usetheme', - 'showbuttons', 'showheader', 'showlines', 'showroot', + 'itemwidthequal', 'usetheme', + 'showbuttons', 'showheader', 'showlines', 'showroot', 'showrootbutton', 'showrootlines', ] end @@ -651,7 +683,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) @@ -680,7 +712,7 @@ end def collapse_recurse(*dsc) - tk_send_without_enc('collapse', '-recurse', + tk_send_without_enc('collapse', '-recurse', *(dsc.map!{|d| _get_eval_string(d, true)})) self end @@ -931,7 +963,7 @@ end def item_collapse_recurse(item) - tk_send_without_enc('item', 'collapse', + tk_send_without_enc('item', 'collapse', _get_eval_string(item, true), '-recurse') self end @@ -941,8 +973,8 @@ end def item_complex(item, *args) - tk_send_without_enc('item', 'complex', - _get_eval_string(item, true), + tk_send_without_enc('item', 'complex', + _get_eval_string(item, true), *(args.map!{|arg| _get_eval_string(arg, true)})) self end @@ -1008,12 +1040,12 @@ def item_firstchild(parent, child=nil) if child - tk_send_without_enc('item', 'firstchild', - _get_eval_string(parent, true), + tk_send_without_enc('item', 'firstchild', + _get_eval_string(parent, true), _get_eval_string(child, true)) self else - id = num_or_str(tk_send_without_enc('item', 'firstchild', + id = num_or_str(tk_send_without_enc('item', 'firstchild', _get_eval_string(parent, true))) Tk::TreeCtrl::Item.id2obj(self, id) end @@ -1022,11 +1054,11 @@ def item_hasbutton(item, st=None) if st == None - bool(tk_send_without_enc('item', 'hasbutton', + bool(tk_send_without_enc('item', 'hasbutton', _get_eval_string(item, true))) else - tk_send_without_enc('item', 'hasbutton', - _get_eval_string(item, true), + tk_send_without_enc('item', 'hasbutton', + _get_eval_string(item, true), _get_eval_string(st)) self end @@ -1086,12 +1118,12 @@ def item_lastchild(parent, child=nil) if child - tk_send_without_enc('item', 'lastchild', + tk_send_without_enc('item', 'lastchild', _get_eval_string(parent, true), _get_eval_string(child, true)) self else - id = num_or_str(tk_send_without_enc('item', 'lastchild', + id = num_or_str(tk_send_without_enc('item', 'lastchild', _get_eval_string(parent, true))) Tk::TreeCtrl::Item.id2obj(self, id) end @@ -1110,7 +1142,7 @@ alias item_next_sibling item_nextsibling def item_numchildren(item) - number(tk_send_without_enc('item', 'numchildren', + number(tk_send_without_enc('item', 'numchildren', _get_eval_string(item, true))) end alias item_num_children item_numchildren @@ -1271,20 +1303,20 @@ def item_style_set(item, column=nil, *args) if args.empty? if column - id = tk_send_without_enc('item', 'style', 'set', - _get_eval_string(item, true), + id = tk_send_without_enc('item', 'style', 'set', + _get_eval_string(item, true), _get_eval_string(column, true)) Tk::TreeCtrl::Style.id2obj(self, id) else - list(tk_send_without_enc('item', 'style', 'set', + list(tk_send_without_enc('item', 'style', 'set', _get_eval_string(item, true))).collect!{|id| Tk::TreeCtrl::Style.id2obj(self, id) } end else - tk_send_without_enc('item', 'style', 'set', - _get_eval_string(item, true), - _get_eval_string(column, true), + tk_send_without_enc('item', 'style', 'set', + _get_eval_string(item, true), + _get_eval_string(column, true), *(args.flatten.map!{|arg| _get_eval_string(arg, true) })) @@ -1640,8 +1672,8 @@ tk_send('style', 'layout', style, elem, *hash_kv(keys)) self else - _conv_style_layout_val(keys, - tk_send('style', 'layout', + _conv_style_layout_val(keys, + tk_send('style', 'layout', style, elem, "-#{keys}")) end else @@ -1717,7 +1749,7 @@ keys = _symbolkey2str(keys) Tk::TreeCtrl::Column::TreeCtrlColumnID.mutex.synchronize{ - @path = @id = + @path = @id = keys.delete('tag') || Tk::TreeCtrl::Column::TreeCtrlColumnID.join(TkCore::INTERP._ip_id_) Tk::TreeCtrl::Column::TreeCtrlColumnID[1].succ! @@ -1726,7 +1758,7 @@ keys['tag'] = @id Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.mutex.synchronize{ - Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath] ||= {} + Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath] ||= {} Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath][@id] = self } @@ -1741,6 +1773,9 @@ @id.to_s.dup end + def cget_tkstring(opt) + @tree.column_cget_tkstring(@tree.column_index(@id), opt) + end def cget(opt) @tree.column_cget(@tree.column_index(@id), opt) end @@ -1823,13 +1858,13 @@ @tpath = parent.path @type = type.to_s Tk::TreeCtrl::Element::TreeCtrlElementID.mutex.synchronize{ - @path = @id = + @path = @id = Tk::TreeCtrl::Element::TreeCtrlElementID.join(TkCore::INTERP._ip_id_) Tk::TreeCtrl::Element::TreeCtrlElementID[1].succ! } Tk::TreeCtrl::Element::TreeCtrlElementID_TBL.mutex.synchronize{ - Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[@tpath] ||= {} + Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[@tpath] ||= {} Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[@tpath][@id] = self } @@ -1844,6 +1879,9 @@ @id.dup end + def cget_tkstring(opt) + @tree.element_cget_tkstring(@id, opt) + end def cget(opt) @tree.element_cget(@id, opt) end @@ -1938,7 +1976,7 @@ @path = @id = @tree.item_create(keys) Tk::TreeCtrl::Item::TreeCtrlItemID_TBL.mutex.synchronize{ - Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[@tpath] ||= {} + Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[@tpath] ||= {} Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[@tpath][@id] = self } end @@ -1978,6 +2016,9 @@ self end + def cget_tkstring(opt) + @tree.item_cget_tkstring(@id, opt) + end def cget(opt) @tree.item_cget(@id, opt) end @@ -2014,9 +2055,12 @@ @tree.item_element_actual(@id, column, elem, key) end - def element_cget(opt) + def element_cget_tkstring(opt) @tree.item_element_cget(@id, opt) end + def element_cget_tkstring(opt) + @tree.item_element_cget(@id, opt) + end def element_cget_strict(opt) @tree.item_element_cget_strict(@id, opt) end @@ -2247,13 +2291,13 @@ @tpath = parent.path Tk::TreeCtrl::Style::TreeCtrlStyleID.mutex.synchronize{ - @path = @id = + @path = @id = Tk::TreeCtrl::Style::TreeCtrlStyleID.join(TkCore::INTERP._ip_id_) Tk::TreeCtrl::Style::TreeCtrlStyleID[1].succ! } Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.mutex.synchronize{ - Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath] ||= {} + Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath] ||= {} Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath][@id] = self } @@ -2268,6 +2312,9 @@ @id.dup end + def cget_tkstring(opt) + @tree.style_cget_tkstring(@id, opt) + end def cget(opt) @tree.style_cget(@id, opt) end Index: ext/tk/lib/tkextlib/bwidget/selectcolor.rb =================================================================== --- ext/tk/lib/tkextlib/bwidget/selectcolor.rb (revision 23917) +++ ext/tk/lib/tkextlib/bwidget/selectcolor.rb (working copy) @@ -57,7 +57,7 @@ def create @keys['type'] = 'dialog' # 'dialog' type returns color - tk_call(Tk::BWidget::SelectColor::TkCommandNames[0], + tk_call(Tk::BWidget::SelectColor::TkCommandNames[0], @path, *hash_kv(@keys)) end end @@ -67,7 +67,7 @@ keys = {} unless keys keys = _symbolkey2str(keys) keys['type'] = 'menubutton' # 'toolbar' type returns widget path - window(tk_call(Tk::BWidget::SelectColor::TkCommandNames[0], + window(tk_call(Tk::BWidget::SelectColor::TkCommandNames[0], @path, *hash_kv(keys))) end end Index: ext/tk/lib/tkextlib/bwidget/tree.rb =================================================================== --- ext/tk/lib/tkextlib/bwidget/tree.rb (revision 23917) +++ ext/tk/lib/tkextlib/bwidget/tree.rb (working copy) @@ -26,7 +26,7 @@ class Event_for_Items < TkEvent::Event def self._get_extra_args_tbl - [ + [ TkComm.method(:string) # item idenfier ] end @@ -38,7 +38,7 @@ private :__strval_optkeys def __boolval_optkeys - super() << 'dragenabled' << 'dropenabled' << + super() << 'dragenabled' << 'dropenabled' << 'redraw' << 'selectfill' << 'showlines' end private :__boolval_optkeys @@ -68,7 +68,7 @@ else cmd = Proc.new end - _bind_for_event_class(Event_for_Items, [path, 'bindImage'], + _bind_for_event_class(Event_for_Items, [path, 'bindImage'], context, cmd, *args) self end @@ -84,7 +84,7 @@ else cmd = Proc.new end - _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], + _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], context, cmd, *args) self end @@ -109,7 +109,7 @@ else cmd = Proc.new end - _bind_for_event_class(Event_for_Items, [path, 'bindText'], + _bind_for_event_class(Event_for_Items, [path, 'bindText'], context, cmd, *args) self end @@ -125,7 +125,7 @@ else cmd = Proc.new end - _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], + _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], context, cmd, *args) self end @@ -139,6 +139,37 @@ _bindinfo_for_event_class(Event_for_Items, [path, 'bindText'], *args) end + def areabind(context, *args) + if TkComm._callback_entry?(args[0]) || !block_given? + cmd = args.shift + else + cmd = Proc.new + end + _bind_for_event_class(Event_for_Items, [path, 'bindArea'], + context, cmd, *args) + self + end + + def areabind_append(context, *args) + if TkComm._callback_entry?(args[0]) || !block_given? + cmd = args.shift + else + cmd = Proc.new + end + _bind_append_for_event_class(Event_for_Items, [path, 'bindArea'], + context, cmd, *args) + self + end + + def areabind_remove(*args) + _bind_remove_for_event_class(Event_for_Items, [path, 'bindArea'], *args) + self + end + + def areabindinfo(*args) + _bindinfo_for_event_class(Event_for_Items, [path, 'bindArea'], *args) + end + def close_tree(node, recurse=None) tk_send('closetree', tagid(node), recurse) self @@ -183,7 +214,7 @@ end def open?(node) - bool(@tree.itemcget(tagid(node), 'open')) + bool(self.itemcget(tagid(node), 'open')) end def open_tree(node, recurse=None) @@ -206,7 +237,7 @@ end def selection_add(*args) - tk_send_without_enc('selection', 'add', + tk_send_without_enc('selection', 'add', *(args.collect{|node| tagid(node)})) self end @@ -221,30 +252,30 @@ end def selection_include?(*args) - bool(tk_send_without_enc('selection', 'get', + bool(tk_send_without_enc('selection', 'get', *(args.collect{|node| tagid(node)}))) end def selection_range(*args) - tk_send_without_enc('selection', 'range', + tk_send_without_enc('selection', 'range', *(args.collect{|node| tagid(node)})) self end def selection_remove(*args) - tk_send_without_enc('selection', 'remove', + tk_send_without_enc('selection', 'remove', *(args.collect{|node| tagid(node)})) self end def selection_set(*args) - tk_send_without_enc('selection', 'set', + tk_send_without_enc('selection', 'set', *(args.collect{|node| tagid(node)})) self end def selection_toggle(*args) - tk_send_without_enc('selection', 'toggle', + tk_send_without_enc('selection', 'toggle', *(args.collect{|node| tagid(node)})) self end @@ -298,7 +329,7 @@ @tree = tree.tree parent = tree.parent else - fail RuntimeError, + fail RuntimeError, "expect Tk::BWidget::Tree or Tk::BWidget::Tree::Node for 1st argument" end @@ -355,6 +386,9 @@ val end + def cget_tkstring(key) + @tree.itemcget_tkstring(@id, key) + end def cget(key) @tree.itemcget(@id, key) end @@ -450,4 +484,3 @@ @tree.visible(@id) end end - Index: ext/tk/lib/tkextlib/bwidget/setup.rb =================================================================== --- ext/tk/lib/tkextlib/bwidget/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/bwidget/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/bwidget/selectfont.rb =================================================================== --- ext/tk/lib/tkextlib/bwidget/selectfont.rb (revision 23917) +++ ext/tk/lib/tkextlib/bwidget/selectfont.rb (working copy) @@ -80,7 +80,7 @@ keys = {} unless keys keys = _symbolkey2str(keys) keys['type'] = 'toolbar' # 'toolbar' type returns widget path - window(tk_call(Tk::BWidget::SelectFont::TkCommandNames[0], + window(tk_call(Tk::BWidget::SelectFont::TkCommandNames[0], @path, *hash_kv(keys))) end end Index: ext/tk/lib/tkextlib/bwidget/messagedlg.rb =================================================================== --- ext/tk/lib/tkextlib/bwidget/messagedlg.rb (revision 23917) +++ ext/tk/lib/tkextlib/bwidget/messagedlg.rb (working copy) @@ -185,7 +185,7 @@ def create # return the index of the pressed button, or nil if it is destroyed - ret = num_or_str(tk_call(self.class::TkCommandNames[0], + ret = num_or_str(tk_call(self.class::TkCommandNames[0], @path, *hash_kv(@keys))) (ret < 0)? nil: ret end Index: ext/tk/lib/tkextlib/bwidget/notebook.rb =================================================================== --- ext/tk/lib/tkextlib/bwidget/notebook.rb (revision 23917) +++ ext/tk/lib/tkextlib/bwidget/notebook.rb (working copy) @@ -23,7 +23,7 @@ class Event_for_Tabs < TkEvent::Event def self._get_extra_args_tbl - [ + [ TkComm.method(:string) # page idenfier ] end @@ -57,7 +57,7 @@ else cmd = Proc.new end - _bind_for_event_class(Event_for_Tabs, [path, 'bindtabs'], + _bind_for_event_class(Event_for_Tabs, [path, 'bindtabs'], context, cmd, *args) self end @@ -73,7 +73,7 @@ else cmd = Proc.new end - _bind_append_for_event_class(Event_for_Tabs, [path, 'bindtabs'], + _bind_append_for_event_class(Event_for_Tabs, [path, 'bindtabs'], context, cmd, *args) self end Index: ext/tk/lib/tkextlib/bwidget/listbox.rb =================================================================== --- ext/tk/lib/tkextlib/bwidget/listbox.rb (revision 23917) +++ ext/tk/lib/tkextlib/bwidget/listbox.rb (working copy) @@ -11,7 +11,7 @@ module BWidget class ListBox < TkWindow # is NOT a subclass of a listbox widget class. - # because it constructed on a canvas widget. + # because it constructed on a canvas widget. class Item < TkObject end @@ -29,7 +29,7 @@ class Event_for_Items < TkEvent::Event def self._get_extra_args_tbl - [ + [ TkComm.method(:string) # item idenfier ] end @@ -60,7 +60,7 @@ else cmd = Proc.new end - _bind_for_event_class(Event_for_Items, [path, 'bindImage'], + _bind_for_event_class(Event_for_Items, [path, 'bindImage'], context, cmd, *args) self end @@ -76,7 +76,7 @@ else cmd = Proc.new end - _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], + _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], context, cmd, *args) self end @@ -101,7 +101,7 @@ else cmd = Proc.new end - _bind_for_event_class(Event_for_Items, [path, 'bindText'], + _bind_for_event_class(Event_for_Items, [path, 'bindText'], context, cmd, *args) self end @@ -117,7 +117,7 @@ else cmd = Proc.new end - _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], + _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], context, cmd, *args) self end @@ -183,19 +183,19 @@ end def selection_set(*args) - tk_send_without_enc('selection', 'set', + tk_send_without_enc('selection', 'set', *(args.collect{|item| tagid(item)})) self end def selection_add(*args) - tk_send_without_enc('selection', 'add', + tk_send_without_enc('selection', 'add', *(args.collect{|item| tagid(item)})) self end def selection_remove(*args) - tk_send_without_enc('selection', 'remove', + tk_send_without_enc('selection', 'remove', *(args.collect{|item| tagid(item)})) self end @@ -237,7 +237,7 @@ if lbox.kind_of?(Tk::BWidget::ListBox) @listbox = lbox else - fail RuntimeError, + fail RuntimeError, "expect Tk::BWidget::ListBox or Tk::BWidget::ListBox::Item for 1st argument" end @@ -294,6 +294,9 @@ val end + def cget_tkstring(key) + @listbox.itemcget_tkstring(@id, key) + end def cget(key) @listbox.itemcget(@id, key) end Index: ext/tk/lib/tkextlib/bwidget/passwddlg.rb =================================================================== --- ext/tk/lib/tkextlib/bwidget/passwddlg.rb (revision 23917) +++ ext/tk/lib/tkextlib/bwidget/passwddlg.rb (working copy) @@ -20,7 +20,7 @@ WidgetClassNames[WidgetClassName] = self def __strval_optkeys - super() << 'loginhelptext' << 'loginlabel' << 'logintext' << + super() << 'loginhelptext' << 'loginlabel' << 'logintext' << 'passwdlabel' << 'passwdtext' end private :__strval_optkeys @@ -31,13 +31,13 @@ private :__boolval_optkeys def __tkvariable_optkeys - super() << 'loginhelpvar' << 'logintextvariable' << + super() << 'loginhelpvar' << 'logintextvariable' << 'passwdhelpvar' << 'passwdtextvariable' end private :__tkvariable_optkeys def create - login, passwd = simplelist(tk_call(self.class::TkCommandNames[0], + login, passwd = simplelist(tk_call(self.class::TkCommandNames[0], @path, *hash_kv(@keys))) [login, passwd] end Index: ext/tk/lib/tkextlib/bwidget/dialog.rb =================================================================== --- ext/tk/lib/tkextlib/bwidget/dialog.rb (revision 23917) +++ ext/tk/lib/tkextlib/bwidget/dialog.rb (working copy) @@ -52,13 +52,20 @@ def create_self(keys) cmd = self.class::TkCommandNames[0] if keys and keys != None - tk_call_without_enc(cmd, @path, '-parent', @relative, + tk_call_without_enc(cmd, @path, '-parent', @relative, *hash_kv(keys, true)) else tk_call_without_enc(cmd, @path, '-parent', @relative) end end + def cget_tkstring(slot) + if slot.to_s == 'relative' + super('parent') + else + super(slot) + end + end def cget_strict(slot) if slot.to_s == 'relative' super('parent') Index: ext/tk/lib/tkextlib/tktrans/setup.rb =================================================================== --- ext/tk/lib/tkextlib/tktrans/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/tktrans/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/tktable/setup.rb =================================================================== --- ext/tk/lib/tkextlib/tktable/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/tktable/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/tktable/tktable.rb =================================================================== --- ext/tk/lib/tkextlib/tktable/tktable.rb (revision 23917) +++ ext/tk/lib/tkextlib/tktable/tktable.rb (working copy) @@ -74,6 +74,9 @@ end private :__item_val2ruby_optkeys + def tag_cget_tkstring(tagOrId, option) + itemcget_tkstring(['tag', tagid(tagOrId)], option) + end def tag_cget(tagOrId, option) itemcget(['tag', tagid(tagOrId)], option) end @@ -90,6 +93,9 @@ current_itemconfiginfo(['tag', tagid(tagOrId)], slot) end + def window_cget_tkstring(tagOrId, option) + itemcget_tkstring(['window', tagid(tagOrId)], option) + end def window_cget(tagOrId, option) itemcget(['window', tagid(tagOrId)], option) end @@ -114,7 +120,7 @@ current_itemconfiginfo(['window', tagid(tagOrId)], slot) end - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo end @@ -197,6 +203,9 @@ @t.tag_lower(@id, target) end + def cget_tkstring(key) + @t.tag_cget_tkstring(@id, key) + end def cget(key) @t.tag_cget(@id, key) end @@ -282,21 +291,21 @@ class BrowseCommand < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst KEY_TBL = [ - [ ?c, ?n, :column ], - [ ?C, ?s, :index ], - [ ?i, ?x, :cursor ], - [ ?r, ?n, :row ], - [ ?s, ?s, :last_index ], - [ ?S, ?s, :new_index ], - [ ?W, ?w, :widget ], + [ ?c, ?n, :column ], + [ ?C, ?s, :index ], + [ ?i, ?x, :cursor ], + [ ?r, ?n, :row ], + [ ?s, ?s, :last_index ], + [ ?S, ?s, :new_index ], + [ ?W, ?w, :widget ], nil ] PROC_TBL = [ - [ ?n, TkComm.method(:number) ], - [ ?x, TkComm.method(:num_or_str) ], - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], + [ ?n, TkComm.method(:number) ], + [ ?x, TkComm.method(:num_or_str) ], + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], nil ] @@ -333,21 +342,21 @@ class CellCommand < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst KEY_TBL = [ - [ ?c, ?n, :column ], - [ ?C, ?s, :index ], - [ ?i, ?m, :rw_mode ], - [ ?r, ?n, :row ], - [ ?s, ?v, :value ], - [ ?W, ?w, :widget ], + [ ?c, ?n, :column ], + [ ?C, ?s, :index ], + [ ?i, ?m, :rw_mode ], + [ ?r, ?n, :row ], + [ ?s, ?v, :value ], + [ ?W, ?w, :widget ], nil ] PROC_TBL = [ - [ ?n, TkComm.method(:number) ], - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], - [ ?m, proc{|val| (val == '0')? (:r) : (:w)} ], - [ ?v, proc{|val| TkComm.tk_tcl2ruby(val, true, false)} ], + [ ?n, TkComm.method(:number) ], + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], + [ ?m, proc{|val| (val == '0')? (:r) : (:w)} ], + [ ?v, proc{|val| TkComm.tk_tcl2ruby(val, true, false)} ], nil ] @@ -384,19 +393,19 @@ class SelectionCommand < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst KEY_TBL = [ - [ ?c, ?n, :sel_columns ], - [ ?C, ?s, :sel_area ], - [ ?i, ?n, :total ], - [ ?r, ?n, :sel_rows ], - [ ?s, ?s, :value ], - [ ?W, ?w, :widget ], + [ ?c, ?n, :sel_columns ], + [ ?C, ?s, :sel_area ], + [ ?i, ?n, :total ], + [ ?r, ?n, :sel_rows ], + [ ?s, ?s, :value ], + [ ?W, ?w, :widget ], nil ] PROC_TBL = [ - [ ?n, TkComm.method(:number) ], - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], + [ ?n, TkComm.method(:number) ], + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], nil ] @@ -433,22 +442,22 @@ class ValidateCommand < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst KEY_TBL = [ - [ ?c, ?n, :column ], - [ ?C, ?s, :index ], - [ ?i, ?x, :cursor ], - [ ?r, ?n, :row ], - [ ?s, ?v, :current_value ], - [ ?S, ?v, :new_value ], - [ ?W, ?w, :widget ], + [ ?c, ?n, :column ], + [ ?C, ?s, :index ], + [ ?i, ?x, :cursor ], + [ ?r, ?n, :row ], + [ ?s, ?v, :current_value ], + [ ?S, ?v, :new_value ], + [ ?W, ?w, :widget ], nil ] PROC_TBL = [ - [ ?n, TkComm.method(:number) ], - [ ?x, TkComm.method(:num_or_str) ], - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], - [ ?v, proc{|val| TkComm.tk_tcl2ruby(val, true, false)} ], + [ ?n, TkComm.method(:number) ], + [ ?x, TkComm.method(:num_or_str) ], + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], + [ ?v, proc{|val| TkComm.tk_tcl2ruby(val, true, false)} ], nil ] @@ -481,7 +490,7 @@ ################################# def __validation_class_list - super() << + super() << BrowseCommand << CellCommand << SelectionCommand << ValidateCommand end @@ -597,7 +606,7 @@ def hidden_list simplelist(tk_send('hidden')) - end + end def hidden?(idx, *args) if args.empty? if (ret = tk_send('hidden', tagid(idx))) == '' @@ -701,7 +710,7 @@ self end - def set(*pairs) # idx, val, idx, val, ... + def set(*pairs) # idx, val, idx, val, ... args = [] 0.step(pairs.size-1, 2){|i| args << tagid(pairs[i]) @@ -710,7 +719,7 @@ tk_send('set', *args) self end - def set_row(*pairs) # idx, val, idx, val, ... + def set_row(*pairs) # idx, val, idx, val, ... args = [] 0.step(pairs.size-1, 2){|i| args << tagid(pairs[i]) @@ -719,7 +728,7 @@ tk_send('set', 'row', *args) self end - def set_col(*pairs) # idx, val, idx, val, ... + def set_col(*pairs) # idx, val, idx, val, ... args = [] 0.step(pairs.size-1, 2){|i| args << tagid(pairs[i]) @@ -736,7 +745,7 @@ pairs.each{|idx, val| args << tagid(idx) << val } tk_send('set', *args) else - # idx, val, idx, val, ... + # idx, val, idx, val, ... args = [] 0.step(pairs.size-1, 2){|i| args << tagid(pairs[i]) @@ -753,7 +762,7 @@ pairs.each{|idx, val| args << tagid(idx) << val } tk_send('set', 'row', *args) else - # idx, val, idx, val, ... + # idx, val, idx, val, ... args = [] 0.step(pairs.size-1, 2){|i| args << tagid(pairs[i]) @@ -770,7 +779,7 @@ pairs.each{|idx, val| args << idx << val } tk_send('set', 'col', *args) else - # idx, val, idx, val, ... + # idx, val, idx, val, ... args = [] 0.step(pairs.size-1, 2){|i| args << tagid(pairs[i]) @@ -798,7 +807,7 @@ [idx [rows, cols]] end def set_spans(*pairs) - # idx, val, idx, val, ... + # idx, val, idx, val, ... args = [] 0.step(pairs.size-1, 2){|i| args << tagid(pairs[i]) @@ -827,7 +836,7 @@ } tk_send('spans', *args) else - # idx, val, idx, val, ... + # idx, val, idx, val, ... args = [] 0.step(pairs.size-1, 2){|i| args << tagid(pairs[i]) @@ -894,9 +903,9 @@ Tk::TkTable::CellTag::CellTagID_TBL.mutex.synchronize{ if Tk::TkTable::CellTag::CellTagID_TBL[@path] if tag.kind_of? Tk::TkTable::CellTag - Tk::TkTable::CellTag::CellTagID_TBL[@path].delete(tag.id) + Tk::TkTable::CellTag::CellTagID_TBL[@path].delete(tag.id) else - Tk::TkTable::CellTag::CellTagID_TBL[@path].delete(tag) + Tk::TkTable::CellTag::CellTagID_TBL[@path].delete(tag) end end } Index: ext/tk/lib/tkextlib/version.rb =================================================================== --- ext/tk/lib/tkextlib/version.rb (revision 23917) +++ ext/tk/lib/tkextlib/version.rb (working copy) @@ -2,5 +2,5 @@ # release date of tkextlib # module Tk - Tkextlib_RELEASE_DATE = '2008-11-25'.freeze + Tkextlib_RELEASE_DATE = '2009-07-01'.freeze end Index: ext/tk/lib/tkextlib/vu/pie.rb =================================================================== --- ext/tk/lib/tkextlib/vu/pie.rb (revision 23917) +++ ext/tk/lib/tkextlib/vu/pie.rb (working copy) @@ -173,6 +173,10 @@ val end + def cget_tkstring(slot) + @pie.itemcget_tkstring(@id, slot) + end + def cget(slot) @pie.itemcget(@id, slot) end Index: ext/tk/lib/tkextlib/vu/setup.rb =================================================================== --- ext/tk/lib/tkextlib/vu/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/vu/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/vu/spinbox.rb =================================================================== --- ext/tk/lib/tkextlib/vu/spinbox.rb (revision 23917) +++ ext/tk/lib/tkextlib/vu/spinbox.rb (working copy) @@ -7,7 +7,7 @@ # require 'tk' -if (Tk::TK_MAJOR_VERSION < 8 || +if (Tk::TK_MAJOR_VERSION < 8 || (Tk::TK_MAJOR_VERSION == 8 && Tk::TK_MINOR_VERSION < 4)) # call setup script -- /tkextlib/vu.rb require 'tkextlib/vu.rb' Index: ext/tk/lib/tkextlib/vu/charts.rb =================================================================== --- ext/tk/lib/tkextlib/vu/charts.rb (revision 23917) +++ ext/tk/lib/tkextlib/vu/charts.rb (working copy) @@ -18,7 +18,7 @@ private :__item_boolval_optkeys def __item_strval_optkeys(id) - super(id) << 'bar' << 'color' << 'outline' << + super(id) << 'bar' << 'color' << 'outline' << 'fill' << 'scaleline' << 'stripline' end private :__item_strval_optkeys Index: ext/tk/lib/tkextlib/vu/bargraph.rb =================================================================== --- ext/tk/lib/tkextlib/vu/bargraph.rb (revision 23917) +++ ext/tk/lib/tkextlib/vu/bargraph.rb (working copy) @@ -30,10 +30,10 @@ def __strval_optkeys super() + [ - 'title', - 'barbackground', 'barcolor', 'barcolour', - 'tickcolor', 'tickcolour', - 'textcolor', 'textcolour', + 'title', + 'barbackground', 'barcolor', 'barcolour', + 'tickcolor', 'tickcolour', + 'textcolor', 'textcolour', ] end private :__strval_optkeys Index: ext/tk/lib/tkextlib/itcl/setup.rb =================================================================== --- ext/tk/lib/tkextlib/itcl/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/itcl/setup.rb (working copy) @@ -2,8 +2,8 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/trofs/setup.rb =================================================================== --- ext/tk/lib/tkextlib/trofs/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/trofs/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/tile/tprogressbar.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tprogressbar.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tprogressbar.rb (working copy) @@ -13,9 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Progressbar, :TkProgressbar) - - class Tk::Tile::TProgressbar include Tk::Tile::TileWidget @@ -54,3 +51,7 @@ end end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Progressbar, :TkProgressbar) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tprogressbar.rb', + :Ttk, Tk::Tile::Progressbar, :TkProgressbar) Index: ext/tk/lib/tkextlib/tile/tframe.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tframe.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tframe.rb (working copy) @@ -13,9 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Frame, :TkFrame) - - class Tk::Tile::TFrame < Tk::Frame include Tk::Tile::TileWidget @@ -31,3 +28,7 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Frame, :TkFrame) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tframe.rb', + :Ttk, Tk::Tile::Frame, :TkFrame) Index: ext/tk/lib/tkextlib/tile/tlabelframe.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tlabelframe.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tlabelframe.rb (working copy) @@ -15,10 +15,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Labelframe, - :TkLabelframe, :TkLabelFrame) - - class Tk::Tile::TLabelframe < Tk::Tile::TFrame include Tk::Tile::TileWidget @@ -34,3 +30,9 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Labelframe, +# :TkLabelframe, :TkLabelFrame) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tlabelframe.rb', + :Ttk, Tk::Tile::Labelframe, + :TkLabelframe, :TkLabelFrame) Index: ext/tk/lib/tkextlib/tile/tradiobutton.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tradiobutton.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tradiobutton.rb (working copy) @@ -15,10 +15,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Radiobutton, - :TkRadiobutton, :TkRadioButton) - - class Tk::Tile::TRadioButton < Tk::RadioButton include Tk::Tile::TileWidget @@ -34,3 +30,9 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Radiobutton, +# :TkRadiobutton, :TkRadioButton) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tradiobutton.rb', + :Ttk, Tk::Tile::Radiobutton, + :TkRadiobutton, :TkRadioButton) Index: ext/tk/lib/tkextlib/tile/tseparator.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tseparator.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tseparator.rb (working copy) @@ -13,9 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Separator, :TkSeparator) - - class Tk::Tile::TSeparator < TkWindow include Tk::Tile::TileWidget @@ -31,3 +28,7 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Separator, :TkSeparator) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tseparator.rb', + :Ttk, Tk::Tile::Separator, :TkSeparator) Index: ext/tk/lib/tkextlib/tile/tmenubutton.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tmenubutton.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tmenubutton.rb (working copy) @@ -15,10 +15,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Menubutton, - :TkMenubutton, :TkMenuButton) - - class Tk::Tile::TMenubutton < Tk::Menubutton include Tk::Tile::TileWidget @@ -34,3 +30,9 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Menubutton, +# :TkMenubutton, :TkMenuButton) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tmenubutton.rb', + :Ttk, Tk::Tile::Menubutton, + :TkMenubutton, :TkMenuButton) Index: ext/tk/lib/tkextlib/tile/tentry.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tentry.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tentry.rb (working copy) @@ -13,9 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Entry, :TkEntry) - - class Tk::Tile::TEntry < Tk::Entry include Tk::Tile::TileWidget @@ -46,3 +43,7 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Entry, :TkEntry) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tentry.rb', + :Ttk, Tk::Tile::Entry, :TkEntry) Index: ext/tk/lib/tkextlib/tile/treeview.rb =================================================================== --- ext/tk/lib/tkextlib/tile/treeview.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/treeview.rb (working copy) @@ -12,15 +12,12 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview) - - module Tk::Tile::TreeviewConfig include TkItemConfigMethod def __item_configinfo_struct(id) # maybe need to override - {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, + {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, :default_value=>nil, :current_value=>1} end private :__item_configinfo_struct @@ -451,7 +448,7 @@ def __item_val2ruby_optkeys(id) case id[0] when :item, 'item' - { + { 'tags'=>proc{|arg_id, val| simplelist(val).collect{|tag| Tk::Tile::Treeview::Tag.id2obj(self, tag) @@ -498,7 +495,7 @@ end slot = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] end while(org_slot != slot) - fail RuntimeError, + fail RuntimeError, "there is a configure alias loop about '#{org_slot}'" else ret = {} @@ -519,16 +516,20 @@ end end + alias __itemcget_tkstring itemcget_tkstring alias __itemcget itemcget alias __itemcget_strict itemcget_strict alias __itemconfigure itemconfigure alias __itemconfiginfo itemconfiginfo alias __current_itemconfiginfo current_itemconfiginfo - private :__itemcget, :__itemcget_strict + private :__itemcget_tkstring, :__itemcget, :__itemcget_strict private :__itemconfigure, :__itemconfiginfo, :__current_itemconfiginfo # Treeview Item + def itemcget_tkstring(tagOrId, option) + __itemcget_tkstring([:item, tagOrId], option) + end def itemcget(tagOrId, option) __itemcget([:item, tagOrId], option) end @@ -546,6 +547,9 @@ end # Treeview Column + def columncget_tkstring(tagOrId, option) + __itemcget_tkstring([:column, tagOrId], option) + end def columncget(tagOrId, option) __itemcget([:column, tagOrId], option) end @@ -561,6 +565,7 @@ def current_columnconfiginfo(tagOrId, slot=nil) __current_itemconfiginfo([:column, tagOrId], slot) end + alias column_cget_tkstring columncget_tkstring alias column_cget columncget alias column_cget_strict columncget_strict alias column_configure columnconfigure @@ -568,6 +573,19 @@ alias current_column_configinfo current_columnconfiginfo # Treeview Heading + def headingcget_tkstring(tagOrId, option) + if __tile_specific_item_optkeys([:heading, tagOrId]).index(option.to_s) + begin + # On tile-0.7.{2-8}, 'state' options has no '-' at its head. + tk_call(*(__item_cget_cmd([:heading, tagOrId]) << option.to_s)) + rescue + # Maybe, 'state' option has '-' in future. + tk_call(*(__item_cget_cmd([:heading, tagOrId]) << "-#{option}")) + end + else + __itemcget_tkstring([:heading, tagOrId], option) + end + end def headingcget_strict(tagOrId, option) if __tile_specific_item_optkeys([:heading, tagOrId]).index(option.to_s) begin @@ -630,6 +648,7 @@ def current_headingconfiginfo(tagOrId, slot=nil) __current_itemconfiginfo([:heading, tagOrId], slot) end + alias heading_cget_tkstring headingcget_tkstring alias heading_cget headingcget alias heading_cget_strict headingcget_strict alias heading_configure headingconfigure @@ -637,6 +656,9 @@ alias current_heading_configinfo current_headingconfiginfo # Treeview Tag + def tagcget_tkstring(tagOrId, option) + __itemcget_tkstring([:tag, :configure, tagOrId], option) + end def tagcget(tagOrId, option) __itemcget([:tag, :configure, tagOrId], option) end @@ -652,6 +674,7 @@ def current_tagconfiginfo(tagOrId, slot=nil) __current_itemconfiginfo([:tag, :configure, tagOrId], slot) end + alias tag_cget_tkstring tagcget_tkstring alias tag_cget tagcget alias tag_cget_strict tagcget_strict alias tag_configure tagconfigure @@ -707,7 +730,7 @@ keys = _symbolkey2str(keys) id = keys.delete('id') if id - num_or_str(tk_call(tree, 'insert', + num_or_str(tk_call(tree, 'insert', parent_item, idx, '-id', id, *hash_kv(keys))) else num_or_str(tk_call(tree, 'insert', parent_item, idx, *hash_kv(keys))) @@ -737,6 +760,9 @@ @id end + def cget_tkstring(option) + @t.itemcget_tkstring(@id, option) + end def cget(option) @t.itemcget(@id, option) end @@ -979,6 +1005,9 @@ @t.tag_bindinfo(@id, seq) end + def cget_tkstring(option) + @t.tagcget_tkstring(@id, option) + end def cget(option) @t.tagcget(@id, option) end @@ -1030,7 +1059,7 @@ end def tagid(id) - if id.kind_of?(Tk::Tile::Treeview::Item) || + if id.kind_of?(Tk::Tile::Treeview::Item) || id.kind_of?(Tk::Tile::Treeview::Tag) id.id elsif id.kind_of?(Array) @@ -1055,7 +1084,7 @@ } end def set_children(item, *items) - tk_send_without_enc('children', item, + tk_send_without_enc('children', item, array2tk_list(items.flatten, true)) self end @@ -1237,3 +1266,7 @@ end alias tagbindinfo tag_bindinfo end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/treeview.rb', + :Ttk, Tk::Tile::Treeview, :TkTreeview) Index: ext/tk/lib/tkextlib/tile/sizegrip.rb =================================================================== --- ext/tk/lib/tkextlib/tile/sizegrip.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/sizegrip.rb (working copy) @@ -13,9 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Sizegrip, :TkSizegrip, :TkSizeGrip) - - class Tk::Tile::SizeGrip < TkWindow include Tk::Tile::TileWidget @@ -27,3 +24,9 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Sizegrip, +# :TkSizegrip, :TkSizeGrip) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/sizegrip.rb', + :Ttk, Tk::Tile::Sizegrip, + :TkSizegrip, :TkSizeGrip) Index: ext/tk/lib/tkextlib/tile/tcombobox.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tcombobox.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tcombobox.rb (working copy) @@ -13,9 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Combobox, :TkCombobox) - - class Tk::Tile::TCombobox < Tk::Tile::TEntry include Tk::Tile::TileWidget @@ -52,3 +49,7 @@ tk_send('set', val) end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Combobox, :TkCombobox) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tcombobox.rb', + :Ttk, Tk::Tile::Combobox, :TkCombobox) Index: ext/tk/lib/tkextlib/tile/tcheckbutton.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tcheckbutton.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tcheckbutton.rb (working copy) @@ -15,10 +15,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Checkbutton, - :TkCheckbutton, :TkCheckButton) - - class Tk::Tile::TCheckButton < Tk::CheckButton include Tk::Tile::TileWidget @@ -34,3 +30,9 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Checkbutton, +# :TkCheckbutton, :TkCheckButton) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tcheckbutton.rb', + :Ttk, Tk::Tile::Checkbutton, + :TkCheckbutton, :TkCheckButton) Index: ext/tk/lib/tkextlib/tile/tbutton.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tbutton.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tbutton.rb (working copy) @@ -13,9 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Button, :TkButton) - - class Tk::Tile::TButton < Tk::Button include Tk::Tile::TileWidget @@ -31,3 +28,7 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Button, :TkButton) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tbutton.rb', + :Ttk, Tk::Tile::Button, :TkButton) Index: ext/tk/lib/tkextlib/tile/style.rb =================================================================== --- ext/tk/lib/tkextlib/tile/style.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/style.rb (working copy) @@ -21,16 +21,16 @@ TkCommandNames = ['style'.freeze].freeze # --- Tk::Tile::Style.__define_wrapper_proc_for_compatibility__! --- - # On Ttk (Tile) extension, 'style' command has imcompatible changes - # depend on the version of the extention. It requires modifying the - # Tcl/Tk scripts to define local styles. The rule for modification - # is a simple one. But, if users want to keep compatibility between - # versions of the extension, they will have to contrive to do that. + # On Ttk (Tile) extension, 'style' command has imcompatible changes + # depend on the version of the extention. It requires modifying the + # Tcl/Tk scripts to define local styles. The rule for modification + # is a simple one. But, if users want to keep compatibility between + # versions of the extension, they will have to contrive to do that. # It may be troublesome, especially for Ruby/Tk users. - # This method may help such work. This method make some definitions - # on the Tcl/Tk interpreter to work with different version of style - # command format. Please give attention to use this method. It may - # conflict with some definitions on Tcl/Tk scripts. + # This method may help such work. This method make some definitions + # on the Tcl/Tk interpreter to work with different version of style + # command format. Please give attention to use this method. It may + # conflict with some definitions on Tcl/Tk scripts. if Tk::Tile::TILE_SPEC_VERSION_ID < 7 def __define_wrapper_proc_for_compatibility__! __define_themes_and_setTheme_proc__! @@ -210,7 +210,7 @@ end def lookup(style, opt, state=None, fallback_value=None) - tk_call(TkCommandNames[0], 'lookup', style, + tk_call(TkCommandNames[0], 'lookup', style, '-' << opt.to_s, state, fallback_value) end @@ -233,6 +233,8 @@ def element_create(name, type, *args) if type == 'image' || type == :image element_create_image(name, *args) + elsif type == 'vsapi' || type == :vsapi + element_create_vsapi(name, *args) else tk_call(TkCommandNames[0], 'element', 'create', name, type, *args) end @@ -253,7 +255,7 @@ # probably, command format is tile 0.8+ (Tcl/Tk8.5+) style if Tk::Tile::TILE_SPEC_VERSION_ID >= 8 if opts - tk_call(TkCommandNames[0], + tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec, opts) else tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec) @@ -262,7 +264,7 @@ fail ArgumentError, 'illegal arguments' if opts.key?('map') base = spec.shift opts['map'] = spec - tk_call(TkCommandNames[0], + tk_call(TkCommandNames[0], 'element', 'create', name, 'image', base, opts) end else @@ -271,7 +273,7 @@ spec = [spec, *(opts.delete('map'))] if opts.key?('map') end if opts - tk_call(TkCommandNames[0], + tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec, opts) else tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec) @@ -279,6 +281,24 @@ end end + def element_create_vsapi(name, class_name, part_id, *args) + # supported on Tcl/Tk 8.6 or later + + # argument check + if (state_map = args.shift || None) + if state_map.kind_of?(Hash) + opts = _symbolkey2str(state_map) + state_map = None + end + end + opts = args.shift || None + fail ArgumentError, "too many arguments" unless args.empty? + + # define a Microsoft Visual Styles element + tk_call(TkCommandNames[0], 'element', 'create', name, 'vsapi', + class_name, part_id, state_map, opts) + end + def element_names() list(tk_call(TkCommandNames[0], 'element', 'names')) end Index: ext/tk/lib/tkextlib/tile/setup.rb =================================================================== --- ext/tk/lib/tkextlib/tile/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/tile/tlabel.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tlabel.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tlabel.rb (working copy) @@ -13,9 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Label, :TkLabel) - - class Tk::Tile::TLabel < Tk::Label include Tk::Tile::TileWidget @@ -31,3 +28,7 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Label, :TkLabel) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tlabel.rb', + :Ttk, Tk::Tile::Label, :TkLabel) Index: ext/tk/lib/tkextlib/tile/tnotebook.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tnotebook.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tnotebook.rb (working copy) @@ -13,13 +13,10 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Notebook, :TkNotebook) - - class Tk::Tile::TNotebook < TkWindow ################################ include TkItemConfigMethod - + def __item_cget_cmd(id) [self.path, 'tab', id] end @@ -46,8 +43,11 @@ alias tabconfiginfo itemconfiginfo alias current_tabconfiginfo current_itemconfiginfo + def tabcget_tkstring(tagOrId, option) + tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{option}")), false, true)[-1] + end def tabcget_strict(tagOrId, option) - tabconfigure(tagOrId, option)[-1] + tabconfiginfo(tagOrId, option)[-1] end def tabcget(tagOrId, option) unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ @@ -109,7 +109,7 @@ def forget(idx) tk_send('forget', idx) self - end + end def index(idx) number(tk_send('index', idx)) @@ -137,3 +137,7 @@ list(tk_send('tabs')) end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Notebook, :TkNotebook) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tnotebook.rb', + :Ttk, Tk::Tile::Notebook, :TkNotebook) Index: ext/tk/lib/tkextlib/tile/tspinbox.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tspinbox.rb (revision 0) +++ ext/tk/lib/tkextlib/tile/tspinbox.rb (revision 0) @@ -0,0 +1,107 @@ +# +# ttk::spinbox widget (Tcl/Tk 8.6b1 or later) +# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) +# +require 'tk' +require 'tkextlib/tile.rb' + +module Tk + module Tile + class TSpinbox < Tk::Tile::TEntry + end + Spinbox = TSpinbox + end +end + +class Tk::Tile::TSpinbox < Tk::Tile::TEntry + include Tk::Tile::TileWidget + + if Tk::Tile::USE_TTK_NAMESPACE + TkCommandNames = ['::ttk::spinbox'.freeze].freeze + else + TkCommandNames = ['::tspinbox'.freeze].freeze + end + WidgetClassName = 'TSpinbox'.freeze + WidgetClassNames[WidgetClassName] = self + + class SpinCommand < TkValidateCommand + class ValidateArgs < TkUtil::CallbackSubst + KEY_TBL = [ + [ ?d, ?s, :direction ], + [ ?s, ?e, :current ], + [ ?W, ?w, :widget ], + nil + ] + + PROC_TBL = [ + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], + + [ ?e, proc{|val| + #enc = Tk.encoding + enc = ((Tk.encoding)? Tk.encoding : Tk.encoding_system) + if enc + Tk.fromUTF8(TkComm::string(val), enc) + else + TkComm::string(val) + end + } + ], + + nil + ] + + _setup_subst_table(KEY_TBL, PROC_TBL); + + def self.ret_val(val) + (val)? '1': '0' + end + end + + def self._config_keys + ['command'] + end + end + + def __validation_class_list + super() << SpinCommand + end + + Tk::ValidateConfigure.__def_validcmd(binding, SpinCommand) + + def __boolval_optkeys + super() << 'wrap' + end + private :__boolval_optkeys + + def __strval_optkeys + super() << 'buttonbackground' << 'format' + end + private :__strval_optkeys + + def __listval_optkeys + super() << 'values' + end + private :__listval_optkeys + + def self.style(*args) + [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') + end + + def current + number(tk_send_without_enc('current')) + end + def current=(idx) + tk_send_without_enc('current', idx) + end + + def set(val) + tk_send('set', val) + end + + alias identify ttk_identify +end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Spinbox, :TkSpinbox) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tspinbox.rb', + :Ttk, Tk::Tile::Spinbox, :TkSpinbox) Index: ext/tk/lib/tkextlib/tile/tscrollbar.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tscrollbar.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tscrollbar.rb (working copy) @@ -13,9 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scrollbar, :TkScrollbar) - - class Tk::Tile::TScrollbar < Tk::Scrollbar include Tk::Tile::TileWidget @@ -30,8 +27,16 @@ def self.style(*args) [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end + + alias identify ttk_identify end +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scrollbar, :TkScrollbar) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tscrollbar.rb', + :Ttk, Tk::Tile::Scrollbar, :TkScrollbar) + +####################################################################### + class Tk::Tile::XScrollbar < Tk::Tile::TScrollbar def create_self(keys) keys = {} unless keys @@ -50,5 +55,9 @@ private :create_self end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::XScrollbar, :TkXScrollbar) -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::YScrollbar, :TkYScrollbar) +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::XScrollbar, :TkXScrollbar) +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::YScrollbar, :TkYScrollbar) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tscrollbar.rb', + :Ttk, Tk::Tile::XScrollbar, :TkXScrollbar) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tscrollbar.rb', + :Ttk, Tk::Tile::YScrollbar, :TkYScrollbar) Index: ext/tk/lib/tkextlib/tile/tpaned.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tpaned.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tpaned.rb (working copy) @@ -13,10 +13,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Panedwindow, - :TkPanedwindow, :TkPanedWindow) - - class Tk::Tile::TPaned < TkWindow include Tk::Tile::TileWidget @@ -66,6 +62,12 @@ self end + def panecget_tkstring(pane, slot) + pane = _epath(pane) + tk_send_without_enc('pane', pane, "-#{slot}") + end + alias pane_cget_tkstring panecget_tkstring + def panecget_strict(pane, slot) pane = _epath(pane) tk_tcl2ruby(tk_send_without_enc('pane', pane, "-#{slot}")) @@ -127,7 +129,7 @@ end conf else - tk_split_simplelist(tk_send_without_enc('pane', + tk_split_simplelist(tk_send_without_enc('pane', win)).collect{|conflist| conf = tk_split_simplelist(conflist) conf[0] = conf[0][1..-1] @@ -135,18 +137,18 @@ if conf[0] == 'hide' conf[3] = bool(conf[3]) unless conf[3].empty? elsif conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf[4] if conf[0] == 'hide' conf[4] = bool(conf[4]) unless conf[4].empty? elsif conf[4].index('{') - conf[4] = tk_split_list(conf[4]) + conf[4] = tk_split_list(conf[4]) else - conf[4] = tk_tcl2ruby(conf[4]) + conf[4] = tk_tcl2ruby(conf[4]) end end conf[1] = conf[1][1..-1] if conf.size == 2 # alias info @@ -165,7 +167,7 @@ { key => conf } else ret = {} - tk_split_simplelist(tk_send_without_enc('pane', + tk_split_simplelist(tk_send_without_enc('pane', win)).each{|conflist| conf = tk_split_simplelist(conflist) key = conf.shift[1..-1] @@ -173,18 +175,18 @@ if key == 'hide' conf[2] = bool(conf[2]) unless conf[2].empty? elsif conf[2].index('{') - conf[2] = tk_split_list(conf[2]) + conf[2] = tk_split_list(conf[2]) else - conf[2] = tk_tcl2ruby(conf[2]) + conf[2] = tk_tcl2ruby(conf[2]) end end if conf[3] if key == 'hide' conf[3] = bool(conf[3]) unless conf[3].empty? elsif conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf.size == 1 @@ -222,10 +224,16 @@ alias current_pane_configinfo current_paneconfiginfo def identify(x, y) - list(tk_send_without_enc('identify', x, y)) + num_or_nil(tk_send_without_enc('identify', x, y)) end def sashpos(idx, newpos=None) num_or_str(tk_send_without_enc('sashpos', idx, newpos)) end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Panedwindow, +# :TkPanedwindow, :TkPanedWindow) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tpaned.rb', + :Ttk, Tk::Tile::Panedwindow, + :TkPanedwindow, :TkPanedWindow) Index: ext/tk/lib/tkextlib/tile/tscale.rb =================================================================== --- ext/tk/lib/tkextlib/tile/tscale.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile/tscale.rb (working copy) @@ -17,9 +17,6 @@ end end -Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scale, :TkScale) - - class Tk::Tile::TScale < Tk::Scale include Tk::Tile::TileWidget @@ -34,6 +31,8 @@ def self.style(*args) [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end + + alias identify ttk_identify end class Tk::Tile::TProgress < Tk::Tile::TScale @@ -51,3 +50,7 @@ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.') end end + +#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scale, :TkScale) +Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tscale.rb', + :Ttk, Tk::Tile::Scale, :TkScale) Index: ext/tk/lib/tkextlib/tile.rb =================================================================== --- ext/tk/lib/tkextlib/tile.rb (revision 23917) +++ ext/tk/lib/tkextlib/tile.rb (working copy) @@ -16,14 +16,41 @@ # TkPackage.require('tile', '0.4') # TkPackage.require('tile', '0.6') # TkPackage.require('tile', '0.7') -if Tk::TK_MAJOR_VERSION > 8 || +if Tk::TK_MAJOR_VERSION > 8 || (Tk::TK_MAJOR_VERSION == 8 && Tk::TK_MINOR_VERSION >= 5) - TkPackage.require('tile') # for compatibility (version check of 'tile') - verstr = TkPackage.require('Ttk') + begin + TkPackage.require('tile') # for compatibility (version check of 'tile') + rescue RuntimeError + # ignore, even if cannot find package 'tile' + end + pkgname = 'Ttk' else - verstr = TkPackage.require('tile') + pkgname = 'tile' end +begin + verstr = TkPackage.require(pkgname) +rescue RuntimeError + # define dummy methods + module Tk + module Tile + CANNOT_FIND_PACKAGE = true + def self.const_missing(sym) + TkPackage.require(PACKAGE_NAME) + end + def self.method_missing(*args) + TkPackage.require(PACKAGE_NAME) + end + end + end + Tk.__cannot_find_tk_package_for_widget_set__(:Ttk, pkgname) + if pkgname == 'Ttk' + verstr = Tk::TK_PATCHLEVEL # dummy + else + verstr = '0.7' # dummy + end +end + ver = verstr.split('.') if ver[0].to_i == 0 # Tile extension package @@ -105,17 +132,17 @@ def self.__define_LoadImages_proc_for_compatibility__! # Ttk 8.5 (Tile 0.8) lost 'LoadImages' utility procedure. - # So, some old scripts doen't work, because those scripts use the - # procedure to define local styles. - # Of course, rewriting such Tcl/Tk scripts isn't difficult for - # Tcl/Tk users. However, it may be troublesome for Ruby/Tk users + # So, some old scripts doen't work, because those scripts use the + # procedure to define local styles. + # Of course, rewriting such Tcl/Tk scripts isn't difficult for + # Tcl/Tk users. However, it may be troublesome for Ruby/Tk users # who use such Tcl/Tk scripts as it is. - # This method may help Ruby/Tk users who don't want to modify old + # This method may help Ruby/Tk users who don't want to modify old # Tcl/Tk scripts for the latest version of Ttk (Tile) extension. - # This method defines a comaptible 'LoadImages' procedure on the - # Tcl/Tk interpreter working under Ruby/Tk. - # Please give attention to use this method. It may conflict with - # some definitions on Tcl/Tk scripts. + # This method defines a comaptible 'LoadImages' procedure on the + # Tcl/Tk interpreter working under Ruby/Tk. + # Please give attention to use this method. It may conflict with + # some definitions on Tcl/Tk scripts. klass_name = self.name proc_name = 'LoadImages' if Tk::Tile::USE_TTK_NAMESPACE @@ -140,7 +167,7 @@ next end TkNamespace.eval(ns){ - TkCore::INTERP.add_tk_procs(proc_name, 'imgdir {patterns {*.gif}}', + TkCore::INTERP.add_tk_procs(proc_name, 'imgdir {patterns {*.gif}}', <<-'EOS') foreach pattern $patterns { foreach file [glob -directory $imgdir $pattern] { @@ -166,7 +193,7 @@ pat ||= TkComm::None images = Hash[*TkComm.simplelist(Tk.tk_call(cmd, imgdir, pat))] images.keys.each{|k| - images[k] = TkPhotoImage.new(:imagename=>images[k], + images[k] = TkPhotoImage.new(:imagename=>images[k], :without_creating=>true) } else ## TILE_SPEC_VERSION_ID >= 8 @@ -181,7 +208,7 @@ Dir.glob(pat).each{|f| img = File.basename(f, '.*') unless TkComm.bool(Tk.info('exists', "images(#{img})")) - Tk.tk_call('set', "images(#{img})", + Tk.tk_call('set', "images(#{img})", Tk.tk_call('image', 'create', 'photo', '-file', f)) end } @@ -189,7 +216,7 @@ } images = Hash[*TkComm.simplelist(Tk.tk_call('array', 'get', 'images'))] images.keys.each{|k| - images[k] = TkPhotoImage.new(:imagename=>images[k], + images[k] = TkPhotoImage.new(:imagename=>images[k], :without_creating=>true) } end @@ -213,8 +240,8 @@ begin TkComm.simplelist(Tk.tk_call_without_enc(*cmd)) rescue - TkComm.simplelist(Tk.tk_call('lsearch', '-all', '-inline', - Tk::Tile::Style.theme_names, + TkComm.simplelist(Tk.tk_call('lsearch', '-all', '-inline', + Tk::Tile::Style.theme_names, glob_ptn)) end end @@ -264,8 +291,8 @@ Icon = 'TkIconFont' TkFont::SYSTEM_FONT_NAMES.add [ - 'TkDefaultFont', 'TkTextFont', 'TkHeadingFont', - 'TkCaptionFont', 'TkTooltipFont', 'TkFixedFont', + 'TkDefaultFont', 'TkTextFont', 'TkHeadingFont', + 'TkCaptionFont', 'TkTooltipFont', 'TkFixedFont', 'TkMenuFont', 'TkSmallCaptionFont', 'TkIconFont' ] end @@ -280,7 +307,7 @@ until lst.empty? if lst[0][0] == ?- k = lst.shift[1..-1] - children = lst.shift + children = lst.shift children = _style_layout(children) if children.kind_of?(Array) keys[k] = children else @@ -332,7 +359,7 @@ end alias tile_identify ttk_identify - # remove instate/state/identify method + # remove instate/state/identify method # to avoid the conflict with widget options if Tk.const_defined?(:USE_OBSOLETE_TILE_STATE_METHOD) && Tk::USE_OBSOLETE_TILE_STATE_METHOD alias instate ttk_instate @@ -404,6 +431,9 @@ autoload :TSeparator, 'tkextlib/tile/tseparator' autoload :Separator, 'tkextlib/tile/tseparator' + autoload :TSpinbox, 'tkextlib/tile/tspinbox' + autoload :Spinbox, 'tkextlib/tile/tspinbox' + autoload :TSquare, 'tkextlib/tile/tsquare' autoload :Square, 'tkextlib/tile/tsquare' Index: ext/tk/lib/tkextlib/tkHTML/setup.rb =================================================================== --- ext/tk/lib/tkextlib/tkHTML/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/tkHTML/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb =================================================================== --- ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb (revision 23917) +++ ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb (working copy) @@ -73,7 +73,7 @@ ppath = ppath2 end - + parent = TkComm._genobj_for_tkwidget(ppath) unless parent.kind_of?(Tk::HTML_Widget) fail ArgumentError, "parent must be a Tk::HTML_Widget instance" @@ -105,7 +105,7 @@ def create_self(keys) if keys and keys != None - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else tk_call_without_enc(self.class::TkCommandNames[0], @path) Index: ext/tk/lib/tkextlib/pkg_checker.rb =================================================================== --- ext/tk/lib/tkextlib/pkg_checker.rb (revision 23917) +++ ext/tk/lib/tkextlib/pkg_checker.rb (working copy) @@ -151,7 +151,7 @@ if err.empty? print 'Ready : ', path, ' : require->', suc.inspect, "\n" else - print '*LACK : ', path, ' : require->', suc.inspect, + print '*LACK : ', path, ' : require->', suc.inspect, ' FAIL->', err.inspect, "\n" end end @@ -176,7 +176,7 @@ if err.empty? print 'Ready : ', f, ' : require->', suc.inspect, "\n" else - print '*LACK : ', f, ' : require->', suc.inspect, + print '*LACK : ', f, ' : require->', suc.inspect, ' FAIL->', err.inspect, "\n" end Index: ext/tk/lib/tkextlib/tclx/setup.rb =================================================================== --- ext/tk/lib/tkextlib/tclx/setup.rb (revision 23917) +++ ext/tk/lib/tkextlib/tclx/setup.rb (working copy) @@ -2,7 +2,7 @@ # setup.rb -- setup script before calling TkPackage.require() # # If you need some setup operations (for example, add a library path -# to the library search path) before using Tcl/Tk library packages -# wrapped by Ruby scripts in this directory, please write the setup +# to the library search path) before using Tcl/Tk library packages +# wrapped by Ruby scripts in this directory, please write the setup # operations in this file. # Index: ext/tk/lib/multi-tk.rb =================================================================== --- ext/tk/lib/multi-tk.rb (revision 23917) +++ ext/tk/lib/multi-tk.rb (working copy) @@ -28,14 +28,20 @@ if Thread.current.group != ThreadGroup::Default raise SecurityError, 'only ThreadGroup::Default can call TclTkIp.new' end - __new__(*args) + obj = __new__(*args) + obj.instance_eval{ + @force_default_encoding ||= [false].taint + @encoding ||= [nil].taint + def @encoding.to_s; self.join(nil); end + } + obj end end ################################################ # use pseudo-toplevel feature of MultiTkIp ? -if (!defined?(Use_PseudoToplevel_Feature_of_MultiTkIp) || +if (!defined?(Use_PseudoToplevel_Feature_of_MultiTkIp) || Use_PseudoToplevel_Feature_of_MultiTkIp) module MultiTkIp_PseudoToplevel_Evaluable #def pseudo_toplevel_eval(body = Proc.new) @@ -67,9 +73,9 @@ def method_missing(id, *args) begin - has_top = (top = MultiTkIp.__getip.__pseudo_toplevel) && - top.respond_to?(:pseudo_toplevel_evaluable?) && - top.pseudo_toplevel_evaluable? && + has_top = (top = MultiTkIp.__getip.__pseudo_toplevel) && + top.respond_to?(:pseudo_toplevel_evaluable?) && + top.pseudo_toplevel_evaluable? && top.respond_to?(id) rescue Exception => e has_top = false @@ -115,7 +121,8 @@ BASE_DIR = File.dirname(__FILE__) WITH_RUBY_VM = Object.const_defined?(:VM) && ::VM.class == Class - WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class + WITH_ENCODING = defined?(::Encoding.default_external) + #WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class (@@SLAVE_IP_ID = ['slave'.freeze, '0'.taint]).instance_eval{ @mutex = Mutex.new @@ -135,13 +142,13 @@ # @@TK_CMD_TBL.instance_variable_set('@tbl', {}.taint) @@TK_CMD_TBL.instance_variable_set('@tbl', Hash.new{|hash,key| - fail IndexError, + fail IndexError, "unknown command ID '#{key}'" }.taint) class << @@TK_CMD_TBL allow = [ - '__send__', '__id__', 'freeze', 'inspect', 'kind_of?', 'object_id', + '__send__', '__id__', 'freeze', 'inspect', 'kind_of?', 'object_id', '[]', '[]=', 'delete', 'each', 'has_key?' ] instance_methods.each{|m| undef_method(m) unless allow.index(m.to_s)} @@ -180,7 +187,7 @@ def delete(idx, &blk) # if gets an entry, is permited to delete if self[idx] - @tbl.delete(idx) + @tbl.delete(idx) elsif blk blk.call(idx) else @@ -226,8 +233,8 @@ def call(*args) unless @ip.deleted? current = Thread.current - backup_ip = current['callback_ip'] - current['callback_ip'] = @ip + backup_ip = current[:callback_ip] + current[:callback_ip] = @ip begin ret = @ip.cb_eval(@cmd, *args) fail ret if ret.kind_of?(Exception) @@ -260,7 +267,7 @@ fail e end ensure - current['callback_ip'] = backup_ip + current[:callback_ip] = backup_ip end end end @@ -436,7 +443,7 @@ rescue SystemExit => e # delete IP unless @interp.deleted? - @slave_ip_tbl.each{|name, subip| + @slave_ip_tbl.each{|name, subip| _destroy_slaves_of_slaveIP(subip) begin # subip._eval_without_enc("foreach i [after info] {after cancel $i}") @@ -459,11 +466,11 @@ next if subip.deleted? end end - if subip.respond_to?(:safe_base?) && subip.safe_base? && + if subip.respond_to?(:safe_base?) && subip.safe_base? && !subip.deleted? # do 'exit' to call the delete_hook procedure begin - subip._eval_without_enc('exit') + subip._eval_without_enc('exit') rescue Exception end else @@ -538,11 +545,11 @@ next if subip.deleted? end end - if subip.respond_to?(:safe_base?) && subip.safe_base? && + if subip.respond_to?(:safe_base?) && subip.safe_base? && !subip.deleted? # do 'exit' to call the delete_hook procedure begin - subip._eval_without_enc('exit') + subip._eval_without_enc('exit') rescue Exception end else @@ -657,12 +664,12 @@ case cmd when 'set_safe_level' begin - safe_level = args[0] if safe_level < args[0] + safe_level = args[0] if safe_level < args[0] rescue Exception end when 'call_mainloop' thread = args.shift - _check_and_return(thread, + _check_and_return(thread, MultiTkIp_OK.new(_receiver_mainloop(*args))) else # ignore @@ -670,8 +677,8 @@ else # procedure - last_thread[thread] = _receiver_eval_proc(last_thread[thread], - safe_level, thread, + last_thread[thread] = _receiver_eval_proc(last_thread[thread], + safe_level, thread, cmd, *args) end end @@ -696,7 +703,7 @@ if @interp.deleted? thread.raise RuntimeError, 'the interpreter is already deleted' else - thread.raise RuntimeError, + thread.raise RuntimeError, 'the interpreter no longer receives command procedures' end end @@ -748,19 +755,36 @@ else ### Ruby 1.9 !!!!!!!!!!! @interp_thread = Thread.new{ current = Thread.current - current[:interp] = interp = TclTkIp.new(name, _keys2opts(keys)) + begin + current[:interp] = interp = TclTkIp.new(name, _keys2opts(keys)) + rescue e + current[:interp] = e + raise e + end #sleep current[:mutex] = mutex = Mutex.new current[:root_check] = cond_var = ConditionVariable.new + status = [nil] + def status.value + self[0] + end + def status.value=(val) + self[0] = val + end + current[:status] = status + begin - current[:status] = interp.mainloop(true) + current[:status].value = interp.mainloop(true) + rescue SystemExit=>e + current[:status].value = e rescue Exception=>e - current[:status] = e + current[:status].value = e + retry if interp.has_mainwindow? ensure mutex.synchronize{ cond_var.broadcast } end - current[:status] = interp.mainloop(false) + current[:status].value = interp.mainloop(false) } until @interp_thread[:interp] Thread.pass @@ -778,6 +802,12 @@ end end + @interp.instance_eval{ + @force_default_encoding ||= [false].taint + @encoding ||= [nil].taint + def @encoding.to_s; self.join(nil); end + } + @ip_name = nil @callback_status = [].taint @@ -809,13 +839,13 @@ @pseudo_toplevel = [false, nil] def self.__pseudo_toplevel - Thread.current.group == ThreadGroup::Default && + Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER && self.__pseudo_toplevel_evaluable? && @pseudo_toplevel[1] end def self.__pseudo_toplevel=(m) - unless (Thread.current.group == ThreadGroup::Default && + unless (Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER) fail SecurityError, "no permission to manipulate" end @@ -839,7 +869,7 @@ end def self.__pseudo_toplevel_evaluable=(mode) - unless (Thread.current.group == ThreadGroup::Default && + unless (Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER) fail SecurityError, "no permission to manipulate" end @@ -866,7 +896,7 @@ rescue @assign_request=>req begin req.ret[0] = req.target.instance_eval{ - @cmd_receiver, @receiver_watchdog = + @cmd_receiver, @receiver_watchdog = _create_receiver_and_watchdog(@safe_level[0]) @threadgroup.add @cmd_receiver @threadgroup.add @receiver_watchdog @@ -951,8 +981,9 @@ begin class << subclass self.methods.each{|m| + name = m.to_s begin - unless m == '__id__' || m == '__send__' || m == 'freeze' + unless name == '__id__' || name == '__send__' || name == 'freeze' undef_method(m) end rescue Exception @@ -962,7 +993,7 @@ end ensure subclass.freeze - fail SecurityError, + fail SecurityError, "cannot create subclass of MultiTkIp on a untrusted ThreadGroup" end end @@ -971,9 +1002,9 @@ ###################################### @@SAFE_OPT_LIST = [ - 'accessPath'.freeze, - 'statics'.freeze, - 'nested'.freeze, + 'accessPath'.freeze, + 'statics'.freeze, + 'nested'.freeze, 'deleteHook'.freeze ].freeze @@ -986,7 +1017,7 @@ keys.each{|k,v| k_str = k.to_s if k_str == 'name' - name = v + name = v elsif k_str == 'safe' safe = v elsif @@SAFE_OPT_LIST.member?(k_str) @@ -1058,8 +1089,8 @@ # match display? if assoc_display != new_keys['display'] if optkeys.key?(:display) || optkeys.key?('display') - fail RuntimeError, - "conflicting 'display'=>#{new_keys['display']} " + + fail RuntimeError, + "conflicting 'display'=>#{new_keys['display']} " + "and display '#{assoc_display}' on 'use'=>#{new_keys['use']}" else new_keys['display'] = assoc_display @@ -1126,14 +1157,14 @@ fc.bindtags = fc.bindtags.unshift(tag) TkFrame.new(fc, :bd=>0){|f| - TkButton.new(f, - :text=>'Delete', :bd=>1, :padx=>2, :pady=>0, + TkButton.new(f, + :text=>'Delete', :bd=>1, :padx=>2, :pady=>0, :highlightthickness=>0, :command=>slave_delete_proc ).pack(:side=>:right, :fill=>:both) f.pack(:side=>:right, :fill=>:both, :expand=>true) } - TkLabel.new(fc, :text=>msg, :padx=>2, :pady=>0, + TkLabel.new(fc, :text=>msg, :padx=>2, :pady=>0, :anchor=>:w).pack(:side=>:left, :fill=>:both, :expand=>true) fc.pack(:side=>:bottom, :fill=>:x) @@ -1157,6 +1188,11 @@ # safe interpreter ip_name = _create_slave_ip_name slave_ip = @interp.create_slave(ip_name, true) + slave_ip.instance_eval{ + @force_default_encoding ||= [false].taint + @encoding ||= [nil].taint + def @encoding.to_s; self.join(nil); end + } @slave_ip_tbl[ip_name] = slave_ip def slave_ip.safe_base? true @@ -1171,7 +1207,7 @@ if tk_opts.key?('use') @slave_ip_top[ip_name] = '' else - tk_opts, top_path = __create_safetk_frame(slave_ip, ip_name, app_name, + tk_opts, top_path = __create_safetk_frame(slave_ip, ip_name, app_name, tk_opts) @slave_ip_top[ip_name] = top_path end @@ -1181,11 +1217,11 @@ end if safe_opts.key?('deleteHook') || safe_opts.key?(:deleteHook) - @interp._eval("::safe::interpConfigure #{ip_name} " + + @interp._eval("::safe::interpConfigure #{ip_name} " + _keys2opts(safe_opts)) else - @interp._eval("::safe::interpConfigure #{ip_name} " + - _keys2opts(safe_opts) + '-deleteHook {' + + @interp._eval("::safe::interpConfigure #{ip_name} " + + _keys2opts(safe_opts) + '-deleteHook {' + TkComm._get_eval_string(proc{|slave| self._default_delete_hook(slave) }) + '}') @@ -1199,6 +1235,11 @@ ip_name = _create_slave_ip_name slave_ip = @interp.create_slave(ip_name, false) + slave_ip.instance_eval{ + @force_default_encoding ||= [false].taint + @encoding ||= [nil].taint + def @encoding.to_s; self.join(nil); end + } slave_ip._invoke('set', 'argv0', name) if name.kind_of?(String) slave_ip._invoke('set', 'argv', _keys2opts(keys)) @interp._invoke('load', '', 'Tk', ip_name) @@ -1268,9 +1309,21 @@ # create master-ip unless WITH_RUBY_VM @interp = TclTkIp.new(name, _keys2opts(tk_opts)) + @interp.instance_eval{ + @force_default_encoding ||= [false].taint + @encoding ||= [nil].taint + def @encoding.to_s; self.join(nil); end + } + else ### Ruby 1.9 !!!!!!!!!!! @interp_thread = Thread.new{ Thread.current[:interp] = interp = TclTkIp.new(name, _keys2opts(tk_opts)) + interp.instance_eval{ + @force_default_encoding ||= [false].taint + @encoding ||= [nil].taint + def @encoding.to_s; self.join(nil); end + } + #sleep TclTkLib.mainloop(true) } @@ -1292,7 +1345,7 @@ # create slave-ip if safeip || master.safe? @safe_base = true - @interp, @ip_name = master.__create_safe_slave_obj(safe_opts, + @interp, @ip_name = master.__create_safe_slave_obj(safe_opts, name, tk_opts) # @interp_thread = nil if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!! @interp_thread = nil unless WITH_RUBY_VM ### Ruby 1.9 !!!!!!!!!!! @@ -1313,7 +1366,7 @@ @safe_level = [master.safe_level] end end - @set_alias_proc = proc{|name| + @set_alias_proc = proc{|name| master._invoke('interp', 'alias', @ip_name, name, '', name) }.freeze end @@ -1340,7 +1393,7 @@ @@DEFAULT_MASTER.assign_receiver_and_watchdog(self) @@IP_TABLE[@threadgroup] = self - @@TK_TABLE_LIST.size.times{ + @@TK_TABLE_LIST.size.times{ (tbl = {}).tainted? || tbl.taint @tk_table_list << tbl } @@ -1400,15 +1453,15 @@ def self.__getip current = Thread.current - if TclTkLib.mainloop_thread? != false && current['callback_ip'] - return current['callback_ip'] + if TclTkLib.mainloop_thread? != false && current[:callback_ip] + return current[:callback_ip] end if current.group == ThreadGroup::Default @@DEFAULT_MASTER else ip = @@IP_TABLE[current.group] unless ip - fail SecurityError, + fail SecurityError, "cannot call Tk methods on #{Thread.current.inspect}" end ip @@ -1425,7 +1478,7 @@ def new_master(safe=nil, keys={}) if MultiTkIp::WITH_RUBY_VM #### TODO !!!!!! - fail RuntimeError, + fail RuntimeError, 'sorry, still not support multiple master-interpreters on Ruby VM' end @@ -1576,7 +1629,7 @@ def slaves(all = false) raise SecurityError, "no permission to manipulate" unless self.manipulable? - @interp._invoke('interp','slaves').split.map!{|name| + @interp._invoke('interp','slaves').split.map!{|name| if @slave_ip_tbl.key?(name) @slave_ip_tbl[name] elsif all @@ -1623,7 +1676,7 @@ end def _add_new_tables - (@@TK_TABLE_LIST.size - @tk_table_list.size).times{ + (@@TK_TABLE_LIST.size - @tk_table_list.size).times{ (tbl = {}).tainted? || tbl.taint @tk_table_list << tbl } @@ -1660,7 +1713,7 @@ def _init_ip_internal(init_ip_env, add_tk_procs) #init_ip_env.each{|script| self.eval_proc{script.call(self)}} init_ip_env.each{|script| self._init_ip_env(script)} - add_tk_procs.each{|name, args, body| + add_tk_procs.each{|name, args, body| if master? @interp._invoke('proc', name, args, body) if args && body else @@ -1683,7 +1736,7 @@ __getip._tk_table_list[id] end def self.create_table - if __getip.slave? + if __getip.slave? begin raise SecurityError, "slave-IP has no permission creating a new table" rescue SecurityError => e @@ -1733,7 +1786,7 @@ end end - # @@IP_TABLE.each{|tg, ip| + # @@IP_TABLE.each{|tg, ip| # ip._init_ip_env(script) # } @@DEFAULT_MASTER.__init_ip_env__(@@IP_TABLE, script) @@ -1745,7 +1798,7 @@ else name = name.to_s @@ADD_TK_PROCS << [name, args, body] - @@IP_TABLE.each{|tg, ip| + @@IP_TABLE.each{|tg, ip| ip._add_tk_procs(name, args, body) } end @@ -1754,11 +1807,11 @@ def self.remove_tk_procs(*names) names.each{|name| name = name.to_s - @@ADD_TK_PROCS.delete_if{|elem| + @@ADD_TK_PROCS.delete_if{|elem| elem.kind_of?(Array) && elem[0].to_s == name } } - @@IP_TABLE.each{|tg, ip| + @@IP_TABLE.each{|tg, ip| ip._remove_tk_procs(*names) } end @@ -1858,7 +1911,7 @@ end def __pseudo_toplevel=(m) - unless (Thread.current.group == ThreadGroup::Default && + unless (Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER) fail SecurityError, "no permission to manipulate" end @@ -1882,7 +1935,7 @@ end def __pseudo_toplevel_evaluable=(mode) - unless (Thread.current.group == ThreadGroup::Default && + unless (Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER) fail SecurityError, "no permission to manipulate" end @@ -1902,7 +1955,7 @@ end # on IP thread - if @cmd_receiver == Thread.current || + if @cmd_receiver == Thread.current || (!req_val && TclTkLib.mainloop_thread? != false) # callback begin ret = cmd.call(safe_level, *args) @@ -1917,8 +1970,8 @@ ret = nil rescue Exception => e if $DEBUG - warn("Warning: " + e.class.inspect + - ((e.message.length > 0)? ' "' + e.message + '"': '') + + warn("Warning: " + e.class.inspect + + ((e.message.length > 0)? ' "' + e.message + '"': '') + " on " + self.inspect) end =begin @@ -1945,9 +1998,9 @@ rescue Exception => e # ignore if $DEBUG - warn("Warning: " + e.class.inspect + - ((e.message.length > 0)? ' "' + e.message + '"': '') + - " on " + self.inspect) + warn("Warning: " + e.class.inspect + + ((e.message.length > 0)? ' "' + e.message + '"': '') + + " on " + self.inspect) end return e end @@ -1976,9 +2029,9 @@ end rescue Exception => e if $DEBUG - warn("Warning: " + e.class.inspect + - ((e.message.length > 0)? ' "' + e.message + '"': '') + - " on " + self.inspect) + warn("Warning: " + e.class.inspect + + ((e.message.length > 0)? ' "' + e.message + '"': '') + + " on " + self.inspect) end return e end @@ -1993,18 +2046,18 @@ cmd = args.shift end current = Thread.current - backup_ip = current['callback_ip'] - current['callback_ip'] = self + backup_ip = current[:callback_ip] + current[:callback_ip] = self begin eval_proc_core(false, cmd, *args) ensure - current['callback_ip'] = backup_ip + current[:callback_ip] = backup_ip end end def eval_proc(*args) - # The scope of the eval-block of 'eval_proc' method is different from - # the external. If you want to pass local values to the eval-block, + # The scope of the eval-block of 'eval_proc' method is different from + # the external. If you want to pass local values to the eval-block, # use arguments of eval_proc method. They are passed to block-arguments. if block_given? cmd = Proc.new @@ -2016,20 +2069,20 @@ if TclTkLib.mainloop_thread? == true # call from eventloop current = Thread.current - backup_ip = current['callback_ip'] - current['callback_ip'] = self + backup_ip = current[:callback_ip] + current[:callback_ip] = self begin - eval_proc_core(false, + eval_proc_core(false, proc{|safe, *params| $SAFE=safe if $SAFE < safe cmd.call(*params) }, *args) ensure - current['callback_ip'] = backup_ip + current[:callback_ip] = backup_ip end else - eval_proc_core(true, - proc{|safe, *params| + eval_proc_core(true, + proc{|safe, *params| $SAFE=safe if $SAFE < safe Thread.new(*params, &cmd).value }, @@ -2049,8 +2102,8 @@ Thread.new{ eval_proc(cmd, *args) =begin - eval_proc_core(false, - proc{|safe, *params| + eval_proc_core(false, + proc{|safe, *params| $SAFE=safe if $SAFE < safe Thread.new(*params, &cmd).value }, @@ -2069,8 +2122,8 @@ raise RuntimeError, "A String object is expected for the 'cmd' argument" end - eval_proc_core(true, - proc{|safe| + eval_proc_core(true, + proc{|safe| Kernel.eval("$SAFE=#{safe} if $SAFE < #{safe};" << cmd, *eval_args) }) @@ -2083,8 +2136,8 @@ raise RuntimeError, "A String object is expected for the 'cmd' argument" end Thread.new{ - eval_proc_core(true, - proc{|safe| + eval_proc_core(true, + proc{|safe| Kernel.eval("$SAFE=#{safe} if $SAFE < #{safe};" << cmd, *eval_args) }) @@ -2169,6 +2222,11 @@ # event loop # all master/slave IPs are controled by only one event-loop +class MultiTkIp + def self.default_master? + __getip == @@DEFAULT_MASTER + end +end class << MultiTkIp def mainloop(check_root = true) __getip.mainloop(check_root) @@ -2444,7 +2502,7 @@ if $SAFE >= 4 _receiver_mainloop(check_root).join else - @cmd_queue.enq([@system, 'call_mainloop', + @cmd_queue.enq([@system, 'call_mainloop', Thread.current, check_root]) Thread.stop end @@ -2465,9 +2523,9 @@ self.delete rescue StandardError => e if $DEBUG - warn("Warning: " + e.class.inspect + - ((e.message.length > 0)? ' "' + e.message + '"': '') + - " on " + self.inspect) + warn("Warning: " + e.class.inspect + + ((e.message.length > 0)? ' "' + e.message + '"': '') + + " on " + self.inspect) end return e rescue Exception => e @@ -2486,9 +2544,9 @@ @interp.mainloop(check_root) rescue StandardError => e if $DEBUG - warn("Warning: " + e.class.inspect + - ((e.message.length > 0)? ' "' + e.message + '"': '') + - " on " + self.inspect) + warn("Warning: " + e.class.inspect + + ((e.message.length > 0)? ' "' + e.message + '"': '') + + " on " + self.inspect) end end =end @@ -2513,7 +2571,7 @@ @interp.mainloop(check_root) rescue StandardError => e if TclTkLib.mainloop_abort_on_exception != nil - #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect, + #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect, # " exception (ignore) : ", $!.message, "\n"); if $DEBUG warn("Warning: Tk mainloop receives " << e.class.inspect << @@ -2524,7 +2582,7 @@ rescue Exception => e =begin if TclTkLib.mainloop_abort_on_exception != nil - #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect, + #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect, # " exception (ignore) : ", $!.message, "\n"); if $DEBUG warn("Warning: Tk mainloop receives " << e.class.inspect << @@ -2595,11 +2653,11 @@ next if subip.deleted? end end - if subip.respond_to?(:safe_base?) && subip.safe_base? && + if subip.respond_to?(:safe_base?) && subip.safe_base? && !subip.deleted? # do 'exit' to call the delete_hook procedure begin - subip._eval_without_enc('exit') + subip._eval_without_enc('exit') rescue Exception end else @@ -2893,7 +2951,7 @@ def def_alias(slave, new_cmd, org_cmd, *args) raise SecurityError, "no permission to manipulate" unless self.manipulable? - ret = @interp._invoke('interp', 'alias', _slavearg(slave), new_cmd, + ret = @interp._invoke('interp', 'alias', _slavearg(slave), new_cmd, '', org_cmd, *args) (ret == new_cmd)? self: nil end @@ -2986,7 +3044,7 @@ end keys << _slavearg(slave) if Tk::TCL_MAJOR_VERSION > 8 || - (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5) + (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5) keys << '--' end keys << cmd @@ -3007,7 +3065,7 @@ keys << _slavearg(slave) keys << '-global' if Tk::TCL_MAJOR_VERSION > 8 || - (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5) + (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5) keys << '--' end keys << cmd @@ -3083,11 +3141,11 @@ raise SecurityError, "no permission to manipulate" unless self.manipulable? if slot - num_or_str(@interp._invoke('interp', 'limit', _slavearg(slave), + num_or_str(@interp._invoke('interp', 'limit', _slavearg(slave), limit_type, slot)) else - l = @interp._split_tklist(@interp._invoke_without_enc('interp', 'limit', - _slavearg(slave), + l = @interp._split_tklist(@interp._invoke_without_enc('interp', 'limit', + _slavearg(slave), limit_type)) l.map!{|s| _fromUTF8(s)} r = {} @@ -3106,7 +3164,7 @@ def recursion_limit(slave = '', limit = None) raise SecurityError, "no permission to manipulate" unless self.manipulable? - number(@interp._invoke('interp', 'recursionlimit', + number(@interp._invoke('interp', 'recursionlimit', _slavearg(slave), limit)) end def self.recursion_limit(slave = '', limit = None) @@ -3216,7 +3274,7 @@ ip = MultiTkIp.__getip ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + _keys2opts(slot)) else - ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + + ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + "-#{slot} #{_get_eval_string(value)}") end self @@ -3226,7 +3284,7 @@ ip = MultiTkIp.__getip ret = {} if slot - conf = _lst2ary(ip._eval("::safe::interpConfigure " + + conf = _lst2ary(ip._eval("::safe::interpConfigure " + @ip_name + " -#{slot}")) if conf[0] == '-deleteHook' =begin @@ -3242,7 +3300,7 @@ ret[conf[0][1..-1]] = conf[1] end else - Hash[*_lst2ary(ip._eval("::safe::interpConfigure " + + Hash[*_lst2ary(ip._eval("::safe::interpConfigure " + @ip_name))].each{|k, v| if k == '-deleteHook' =begin @@ -3289,6 +3347,42 @@ def encoding_table __getip.encoding_table end + + def force_default_encoding=(mode) + __getip.force_default_encoding=(mode) + end + + def force_default_encoding? + __getip.force_default_encoding? + end + + def default_encoding=(enc) + __getip.default_encoding=(enc) + end + + def encoding=(enc) + __getip.encoding=(enc) + end + + def encoding_name + __getip.encoding_name + end + + def encoding_obj + __getip.encoding_obj + end + alias encoding encoding_name + alias default_encoding encoding_name + + def encoding_convertfrom(str, enc=None) + __getip.encoding_convertfrom(str, enc) + end + alias encoding_convert_from encoding_convertfrom + + def encoding_convertto(str, enc=None) + __getip.encoding_convertto(str, enc) + end + alias encoding_convert_to encoding_convertto end class MultiTkIp def encoding_table @@ -3339,20 +3433,48 @@ # remove methods for security -if MultiTkIp::WITH_RUBY_VM && +=begin +class MultiTkIp + INTERP_THREAD = @@DEFAULT_MASTER.instance_variable_get('@interp_thread') + INTERP_MUTEX = INTERP_THREAD[:mutex] + INTERP_ROOT_CHECK = INTERP_THREAD[:root_check] + + # undef_method :instance_eval + undef_method :instance_variable_get + undef_method :instance_variable_set +end + +module TkCore + if MultiTkIp::WITH_RUBY_VM && + ! MultiTkIp::RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!! + INTERP_THREAD = MultiTkIp::INTERP_THREAD + INTERP_MUTEX = MultiTkIp::INTERP_MUTEX + INTERP_ROOT_CHECK = MultiTkIp::INTERP_ROOT_CHECK + end +end +class MultiTkIp + remove_const(:INTERP_THREAD) + remove_const(:INTERP_MUTEX) + remove_const(:INTERP_ROOT_CHECK) +end +=end +if MultiTkIp::WITH_RUBY_VM && ! MultiTkIp::RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!! class MultiTkIp INTERP_THREAD = @@DEFAULT_MASTER.instance_variable_get('@interp_thread') + INTERP_THREAD_STATUS = INTERP_THREAD[:status] INTERP_MUTEX = INTERP_THREAD[:mutex] INTERP_ROOT_CHECK = INTERP_THREAD[:root_check] end module TkCore INTERP_THREAD = MultiTkIp::INTERP_THREAD + INTERP_THREAD_STATUS = MultiTkIp::INTERP_THREAD_STATUS INTERP_MUTEX = MultiTkIp::INTERP_MUTEX INTERP_ROOT_CHECK = MultiTkIp::INTERP_ROOT_CHECK end class MultiTkIp remove_const(:INTERP_THREAD) + remove_const(:INTERP_THREAD_STATUS) remove_const(:INTERP_MUTEX) remove_const(:INTERP_ROOT_CHECK) end Index: ext/tk/lib/remote-tk.rb =================================================================== --- ext/tk/lib/remote-tk.rb (revision 23917) +++ ext/tk/lib/remote-tk.rb (working copy) @@ -88,6 +88,10 @@ @slave_ip_tbl = {} @slave_ip_top = {} + @force_default_encoding ||= [false].taint + @encoding ||= [nil].taint + def @encoding.to_s; self.join(nil); end + @tk_windows.taint unless @tk_windows.tainted? @tk_table_list.taint unless @tk_table_list.tainted? @slave_ip_tbl.taint unless @slave_ip_tbl.tainted? @@ -114,7 +118,7 @@ @@DEFAULT_MASTER.assign_receiver_and_watchdog(self) @@IP_TABLE[@threadgroup] = self - @@TK_TABLE_LIST.size.times{ + @@TK_TABLE_LIST.size.times{ (tbl = {}).tainted? || tbl.taint @tk_table_list << tbl } @@ -154,13 +158,13 @@ return nil if timeout < 1 @ret_val.value = '' - @interp._invoke('send', '-async', @remote, - 'send', '-async', Tk.appname, + @interp._invoke('send', '-async', @remote, + 'send', '-async', Tk.appname, "set #{@ret_val.id} ready") Tk.update if @ret_val != 'ready' (1..(timeout*5)).each{ - sleep 0.2 + sleep 0.2 Tk.update break if @ret_val == 'ready' } @@ -204,10 +208,10 @@ cmds = @interp._merge_tklist(*TkUtil::_conv_args([], enc_mode, *cmds)) if @displayof if async - @interp.__invoke('send', '-async', '-displayof', @displayof, + @interp.__invoke('send', '-async', '-displayof', @displayof, '--', @remote, *cmds) else - @interp.__invoke('send', '-displayof', @displayof, + @interp.__invoke('send', '-displayof', @displayof, '--', @remote, *cmds) end else @@ -229,7 +233,7 @@ def is_rubytk? return false if _appsend(false, false, 'info', 'command', 'ruby') == "" - [ _appsend(false, false, 'ruby', 'RUBY_VERSION'), + [ _appsend(false, false, 'ruby', 'RUBY_VERSION'), _appsend(false, false, 'set', 'tk_patchLevel') ] end @@ -298,7 +302,7 @@ raise SecurityError, "no permission to manipulate" unless self.manipulable? if @displayof - lst = @interp._invoke_without_enc('winfo', 'interps', + lst = @interp._invoke_without_enc('winfo', 'interps', '-displayof', @displayof) else lst = @interp._invoke_without_enc('winfo', 'interps') Index: ext/tk/lib/tk/msgcat.rb =================================================================== --- ext/tk/lib/tk/msgcat.rb (revision 23917) +++ ext/tk/lib/tk/msgcat.rb (working copy) @@ -11,13 +11,13 @@ #extend TkMsgCatalog TkCommandNames = [ - '::msgcat::mc'.freeze, - '::msgcat::mcmax'.freeze, - '::msgcat::mclocale'.freeze, - '::msgcat::mcpreferences'.freeze, - '::msgcat::mcload'.freeze, - '::msgcat::mcset'.freeze, - '::msgcat::mcmset'.freeze, + '::msgcat::mc'.freeze, + '::msgcat::mcmax'.freeze, + '::msgcat::mclocale'.freeze, + '::msgcat::mcpreferences'.freeze, + '::msgcat::mcload'.freeze, + '::msgcat::mcset'.freeze, + '::msgcat::mcmset'.freeze, '::msgcat::mcunknown'.freeze ].freeze @@ -69,10 +69,10 @@ exit!(1) rescue Exception => e begin - msg = _toUTF8(e.class.inspect) + ': ' + - _toUTF8(e.message) + "\n" + - "\n---< backtrace of Ruby side >-----\n" + - _toUTF8(e.backtrace.join("\n")) + + msg = _toUTF8(e.class.inspect) + ': ' + + _toUTF8(e.message) + "\n" + + "\n---< backtrace of Ruby side >-----\n" + + _toUTF8(e.backtrace.join("\n")) + "\n---< backtrace of Tk side >-------" if TkCore::WITH_ENCODING msg.force_encoding('utf-8') @@ -80,9 +80,9 @@ msg.instance_variable_set(:@encoding, 'utf-8') end rescue Exception - msg = e.class.inspect + ': ' + e.message + "\n" + - "\n---< backtrace of Ruby side >-----\n" + - e.backtrace.join("\n") + + msg = e.class.inspect + ': ' + e.message + "\n" + + "\n---< backtrace of Ruby side >-----\n" + + e.backtrace.join("\n") + "\n---< backtrace of Tk side >-------" end fail(e, msg) @@ -153,7 +153,7 @@ end def translate(*args) dst = args.collect{|src| - @namespace.eval{tk_call_without_enc('::msgcat::mc', + @namespace.eval{tk_call_without_enc('::msgcat::mc', _get_eval_string(src, true))} } Tk.UTF8_String(sprintf(*dst)) @@ -229,29 +229,29 @@ def self.set_translation(locale, src_str, trans_str=None, enc='utf-8') if trans_str && trans_str != None trans_str = Tk.UTF8_String(_toUTF8(trans_str, enc)) - Tk.UTF8_String(tk_call_without_enc('::msgcat::mcset', - locale, - _get_eval_string(src_str, true), + Tk.UTF8_String(tk_call_without_enc('::msgcat::mcset', + locale, + _get_eval_string(src_str, true), trans_str)) else - Tk.UTF8_String(tk_call_without_enc('::msgcat::mcset', - locale, + Tk.UTF8_String(tk_call_without_enc('::msgcat::mcset', + locale, _get_eval_string(src_str, true))) end end def set_translation(locale, src_str, trans_str=None, enc='utf-8') if trans_str && trans_str != None - trans_str = Tk.UTF8_String(_toUTF8(trans_str, enc)) + trans_str = Tk.UTF8_String(_toUTF8(trans_str, enc)) Tk.UTF8_String(@namespace.eval{ - tk_call_without_enc('::msgcat::mcset', - locale, - _get_eval_string(src_str, true), + tk_call_without_enc('::msgcat::mcset', + locale, + _get_eval_string(src_str, true), trans_str) }) else Tk.UTF8_String(@namespace.eval{ - tk_call_without_enc('::msgcat::mcset', - locale, + tk_call_without_enc('::msgcat::mcset', + locale, _get_eval_string(src_str, true))}) end end @@ -261,7 +261,7 @@ list = [] trans_list.each{|src, trans| if trans && trans != None - list << _get_eval_string(src, true) + list << _get_eval_string(src, true) list << Tk.UTF8_Stirng(_toUTF8(trans, enc)) else list << _get_eval_string(src, true) << '' @@ -274,7 +274,7 @@ list = [] trans_list.each{|src, trans| if trans && trans != None - list << _get_eval_string(src, true) + list << _get_eval_string(src, true) list << Tk.UTF8_String(_toUTF8(trans, enc)) else list << _get_eval_string(src, true) << '' Index: ext/tk/lib/tk/optiondb.rb =================================================================== --- ext/tk/lib/tk/optiondb.rb (revision 23917) +++ ext/tk/lib/tk/optiondb.rb (working copy) @@ -44,7 +44,7 @@ def read_entries(file, f_enc=nil) if TkCore::INTERP.safe? - fail SecurityError, + fail SecurityError, "can't call 'TkOptionDB.read_entries' on a safe interpreter" end @@ -86,7 +86,7 @@ ent end module_function :read_entries - + def read_with_encoding(file, f_enc=nil, pri=None) # try to read the file as an OptionDB file read_entries(file, f_enc).each{|pat, val| @@ -136,7 +136,7 @@ @@resource_proc_class.const_set(:CARRIER, '.'.freeze) - @@resource_proc_class.instance_variable_set('@method_tbl', + @@resource_proc_class.instance_variable_set('@method_tbl', TkCore::INTERP.create_table) @@resource_proc_class.instance_variable_set('@add_method', false) @@resource_proc_class.instance_variable_set('@safe_mode', 4) @@ -144,7 +144,7 @@ class << @@resource_proc_class private :new -=begin +=begin CARRIER = '.'.freeze METHOD_TBL = TkCore::INTERP.create_table ADD_METHOD = false @@ -171,7 +171,7 @@ def __check_proc_string__(str) # If you want to check the proc_string, do it in this method. - # Please define this in the block given to 'new_proc_class' method. + # Please define this in the block given to 'new_proc_class' method. str end @@ -186,20 +186,20 @@ unless TkComm._callback_entry?(res_proc) #if id == :new || !(self::METHOD_TBL.has_key?(id) || self::ADD_METHOD) if id == :new || !(@method_tbl.has_key?(id) || @add_method) - raise NoMethodError, + raise NoMethodError, "not support resource-proc '#{id.id2name}' for #{self.name}" end proc_str = proc_source proc_str = '{' + proc_str + '}' unless /\A\{.*\}\Z/ =~ proc_str #proc_str = __closed_block_check__(proc_str) proc_str = __check_proc_string__(proc_str) - res_proc = proc{ + res_proc = proc{ begin #eval("$SAFE = #{self::SAFE_MODE};\nProc.new" + proc_str) eval("$SAFE = #{@safe_mode};\nProc.new" + proc_str) rescue SyntaxError=>err - raise SyntaxError, - TkCore::INTERP._toUTF8(err.message.gsub(/\(eval\):\d:/, + raise SyntaxError, + TkCore::INTERP._toUTF8(err.message.gsub(/\(eval\):\d:/, "(#{id.id2name}):")) end }.call @@ -291,7 +291,7 @@ cmd_klass.instance_variable_set('@method_tbl', TkCore::INTERP.create_table) cmd_klass.instance_variable_set('@add_method', add) cmd_klass.instance_variable_set('@safe_mode', safe) - func.each{|f| + func.each{|f| cmd_klass.instance_variable_get('@method_tbl')[f.to_s.intern] = nil } =begin @@ -310,14 +310,14 @@ # for security, make these methods invalid class << klass def __null_method(*args); nil; end - [ :class_eval, :name, :superclass, :clone, :dup, :autoload, :autoload?, - :ancestors, :const_defined?, :const_get, :const_set, :const_missing, - :class_variables, :constants, :included_modules, :instance_methods, - :method_defined?, :module_eval, :private_instance_methods, - :protected_instance_methods, :public_instance_methods, - :singleton_methods, :remove_const, :remove_method, :undef_method, - :to_s, :inspect, :display, :method, :methods, :respond_to?, - :instance_variable_get, :instance_variable_set, :instance_method, + [ :class_eval, :name, :superclass, :clone, :dup, :autoload, :autoload?, + :ancestors, :const_defined?, :const_get, :const_set, :const_missing, + :class_variables, :constants, :included_modules, :instance_methods, + :method_defined?, :module_eval, :private_instance_methods, + :protected_instance_methods, :public_instance_methods, + :singleton_methods, :remove_const, :remove_method, :undef_method, + :to_s, :inspect, :display, :method, :methods, :respond_to?, + :instance_variable_get, :instance_variable_set, :instance_method, :instance_eval, :instance_exec, :instance_variables, :kind_of?, :is_a?, :private_methods, :protected_methods, :public_methods ].each{|m| alias_method(m, :__null_method) @@ -331,7 +331,7 @@ RAND_BASE_HEAD = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' RAND_BASE_CHAR = RAND_BASE_HEAD + 'abcdefghijklmnopqrstuvwxyz0123456789_' def __get_random_basename - name = '%s%03d' % [RAND_BASE_HEAD[rand(RAND_BASE_HEAD.size),1], + name = '%s%03d' % [RAND_BASE_HEAD[rand(RAND_BASE_HEAD.size),1], RAND_BASE_CNT[0]] len = RAND_BASE_CHAR.size (6+rand(10)).times{ @@ -344,9 +344,9 @@ private_class_method :__get_random_basename # define new proc class : - # If you want to modify the new class or create a new subclass, - # you must do such operation in the block parameter. - # Because the created class is flozen after evaluating the block. + # If you want to modify the new class or create a new subclass, + # you must do such operation in the block parameter. + # Because the created class is flozen after evaluating the block. def new_proc_class(klass, func, safe = 4, add = false, parent = nil, &b) new_klass = __create_new_class(klass, func, safe, add, parent) new_klass.class_eval(&b) if block_given? @@ -357,7 +357,7 @@ module_function :new_proc_class def eval_under_random_base(parent = nil, &b) - new_klass = __create_new_class(__get_random_basename(), + new_klass = __create_new_class(__get_random_basename(), [], 4, false, parent) ret = new_klass.class_eval(&b) if block_given? __remove_methods_of_proc_class(new_klass) Index: ext/tk/lib/tk/timer.rb =================================================================== --- ext/tk/lib/tk/timer.rb (revision 23917) +++ ext/tk/lib/tk/timer.rb (working copy) @@ -76,7 +76,7 @@ rescue Interrupt exit!(1) rescue Exception => e - if @cancel_on_exception && + if @cancel_on_exception && @cancel_on_exception.find{|exc| e.kind_of?(exc)} cancel @return_value = e @@ -180,12 +180,12 @@ @after_script = nil @cancel_on_exception = DEFAULT_IGNORE_EXCEPTIONS - # Unless @cancel_on_exception, Ruby/Tk shows an error dialog box when - # an excepsion is raised on TkTimer callback procedure. - # If @cancel_on_exception is an array of exception classes and the raised - # exception is included in the array, Ruby/Tk cancels executing TkTimer - # callback procedures silently (TkTimer#cancel is called and no dialog is - # shown). + # Unless @cancel_on_exception, Ruby/Tk shows an error dialog box when + # an excepsion is raised on TkTimer callback procedure. + # If @cancel_on_exception is an array of exception classes and the raised + # exception is included in the array, Ruby/Tk cancels executing TkTimer + # callback procedures silently (TkTimer#cancel is called and no dialog is + # shown). if b case args.size @@ -229,7 +229,7 @@ end def current_status - [@running, @current_sleep, @current_proc, @current_args, + [@running, @current_sleep, @current_proc, @current_args, @do_loop, @cancel_on_exception] end @@ -484,11 +484,11 @@ def at_end(*arg, &b) if arg.empty? - if b + if b @at_end_proc = b - else + else # no proc - return @at_end_proc + return @at_end_proc end else fail ArgumentError, "wrong number of arguments" if arg.length != 1 || b @@ -504,17 +504,17 @@ unless @running if @return_value.kind_of?(Exception) - fail @return_value + fail @return_value else - return @return_value + return @return_value end end @wait_var.wait(on_thread, check_root) if @return_value.kind_of?(Exception) - fail @return_value + fail @return_value else - @return_value + @return_value end end def eventloop_wait(check_root = false) @@ -628,12 +628,12 @@ if @est_time @est_time = Time.at(@est_time.to_i, @est_time.usec + sleep*1000) else - @est_time = Time.at(@cb_start_time.to_i, + @est_time = Time.at(@cb_start_time.to_i, @cb_start_time.usec + sleep*1000) end now = Time.now - real_sleep = ((@est_time.to_i - now.to_i + @offset_s)*1000.0 + + real_sleep = ((@est_time.to_i - now.to_i + @offset_s)*1000.0 + (@est_time.usec - now.usec + @offset_u)/1000.0).round if real_sleep <= 0 real_sleep = 0 @@ -653,7 +653,7 @@ if @current_sleep == 0 @offset_list.push([ - @offset_s - @cb_start_time.to_i, + @offset_s - @cb_start_time.to_i, @offset_u - @cb_start_time.usec ]) else Index: ext/tk/lib/tk/busy.rb =================================================================== --- ext/tk/lib/tk/busy.rb (revision 0) +++ ext/tk/lib/tk/busy.rb (revision 0) @@ -0,0 +1,118 @@ +# +# tk/busy.rb: support 'tk busy' command (Tcl/Tk8.6 or later) +# +require 'tk' + +module Tk::Busy + include TkCore + extend TkCore + extend TkItemConfigMethod +end + +class << Tk::Busy + def __item_cget_cmd(win) + # maybe need to override + ['tk', 'busy', 'cget', win.path] + end + private :__item_cget_cmd + + def __item_config_cmd(win) + # maybe need to override + ['tk', 'busy', 'configure', win.path] + end + private :__item_config_cmd + + def __item_confinfo_cmd(win) + # maybe need to override + __item_config_cmd(win) + end + private :__item_confinfo_cmd + + alias cget_tkstring itemcget_tkstring + alias cget itemcget + alias cget_strict itemcget_strict + alias configure itemconfigure + alias configinfo itemconfiginfo + alias current_configinfo current_itemconfiginfo + + private :itemcget_tkstring, :itemcget, :itemcget_strict + private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo + + def method_missing(id, *args) + name = id.id2name + case args.length + when 1 + if name[-1] == ?= + configure name[0..-2], args[0] + args[0] + else + configure name, args[0] + self + end + when 0 + begin + cget(name) + rescue + super(id, *args) + end + else + super(id, *args) + end + end + + def hold(win, keys={}) + tk_call_without_enc('tk', 'busy', 'hold', win, *hash_kv(keys)) + win + end + + def forget(*wins) + tk_call_without_enc('tk', 'busy', 'forget', *wins) + self + end + + def current(pat=None) + list(tk_call_without_enc('tk', 'busy', 'current', pat)) + end + + def status(win) + bool(tk_call_without_enc('tk', 'busy', 'status', win)) + end +end + +module Tk::Busy + def busy_configinfo(option=nil) + Tk::Busy.configinfo(self, option) + end + + def busy_current_configinfo(option=nil) + Tk::Busy.current_configinfo(self, option) + end + + def busy_configure(option, value=None) + Tk::Busy.configure(self, option, value) + self + end + + def busy_cget(option) + Tk::Busy.configure(self, option) + end + + def busy(keys={}) + Tk::Busy.hold(self, keys) + self + end + alias busy_hold busy + + def busy_forget + Tk::Busy.forget(self) + self + end + + def busy_current? + ! Tk::Busy.current(self.path).empty? + end + + def busy_status + Tk::Busy.status(self) + end +end Index: ext/tk/lib/tk/wm.rb =================================================================== --- ext/tk/lib/tk/wm.rb (revision 23917) +++ ext/tk/lib/tk/wm.rb (working copy) @@ -123,7 +123,7 @@ TOPLEVEL_METHODCALL_OPTKEYS['focusmodel'] = 'focusmodel' def Wm.forget(win) - # Tcl/Tk 8.5+ + # Tcl/Tk 8.5+ # work with dockable frames tk_call_without_enc('wm', 'forget', win.epath) win @@ -200,7 +200,7 @@ if imgs.empty? win.instance_eval{ @wm_iconphoto = nil unless defined? @wm_iconphoto - return @wm_iconphoto + return @wm_iconphoto } end @@ -308,10 +308,10 @@ def Wm.manage(win, use_id = nil) # Tcl/Tk 8.5+ feature # -------------------------------------------------------------- - # In the future release, I want to support to embed the 'win' + # In the future release, I want to support to embed the 'win' # into the container which has window-id 'use-id'. - # It may give users frexibility on controlling their GUI. - # However, it may be difficult for current Tcl/Tk (Tcl/Tk8.5.1), + # It may give users frexibility on controlling their GUI. + # However, it may be difficult for current Tcl/Tk (Tcl/Tk8.5.1), # because it seems to require to modify Tcl/Tk's source code. # -------------------------------------------------------------- if use_id Index: ext/tk/lib/tk/labelframe.rb =================================================================== --- ext/tk/lib/tk/labelframe.rb (revision 23917) +++ ext/tk/lib/tk/labelframe.rb (working copy) @@ -26,4 +26,6 @@ Tk::Labelframe = Tk::LabelFrame #TkLabelFrame = Tk::LabelFrame unless Object.const_defined? :TkLabelFrame #TkLabelframe = Tk::Labelframe unless Object.const_defined? :TkLabelframe -Tk.__set_toplevel_aliases__(:Tk, Tk::LabelFrame, :TkLabelFrame, :TkLabelframe) +#Tk.__set_toplevel_aliases__(:Tk, Tk::LabelFrame, :TkLabelFrame, :TkLabelframe) +Tk.__set_loaded_toplevel_aliases__('tk/labelframe.rb', :Tk, Tk::LabelFrame, + :TkLabelFrame, :TkLabelframe) Index: ext/tk/lib/tk/frame.rb =================================================================== --- ext/tk/lib/tk/frame.rb (revision 23917) +++ ext/tk/lib/tk/frame.rb (working copy) @@ -128,4 +128,5 @@ end #TkFrame = Tk::Frame unless Object.const_defined? :TkFrame -Tk.__set_toplevel_aliases__(:Tk, Tk::Frame, :TkFrame) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Frame, :TkFrame) +Tk.__set_loaded_toplevel_aliases__('tk/frame.rb', :Tk, Tk::Frame, :TkFrame) Index: ext/tk/lib/tk/toplevel.rb =================================================================== --- ext/tk/lib/tk/toplevel.rb (revision 23917) +++ ext/tk/lib/tk/toplevel.rb (working copy) @@ -38,7 +38,7 @@ # s << "-class" << @classname if @classname # s << "-colormap" << @colormap if @colormap # s << "-container" << @container if @container -# s << "-screen" << @screen if @screen +# s << "-screen" << @screen if @screen # s << "-use" << @use if @use # s << "-visual" << @visual if @visual # tk_call 'toplevel', @path, *s @@ -113,7 +113,7 @@ @use = keys['use'] @visual = keys['visual'] if !@classname && my_class_name - keys['class'] = @classname = my_class_name + keys['class'] = @classname = my_class_name end if @classname.kind_of? TkBindTag @db_class = @classname @@ -127,7 +127,7 @@ end keys, cmds = _wm_command_option_chk(keys) super(keys) - cmds.each{|k,v| + cmds.each{|k,v| if v.kind_of? Array self.__send__(k,*v) else @@ -162,7 +162,7 @@ keys = {} end if !@classname && my_class_name - keys['class'] = @classname = my_class_name + keys['class'] = @classname = my_class_name end if @classname.kind_of? TkBindTag @db_class = @classname @@ -176,7 +176,7 @@ end keys, cmds = _wm_command_option_chk(keys) super(parent, keys) - cmds.each{|k,v| + cmds.each{|k,v| if v.kind_of? Array self.send(k,*v) else @@ -200,8 +200,8 @@ def add_menu(menu_info, tearoff=false, opts=nil) # See tk/menuspec.rb for menu_info. - # opts is a hash of default configs for all of cascade menus. - # Configs of menu_info can override it. + # opts is a hash of default configs for all of cascade menus. + # Configs of menu_info can override it. if tearoff.kind_of?(Hash) opts = tearoff tearoff = false @@ -212,7 +212,7 @@ def add_menubar(menu_spec, tearoff=false, opts=nil) # See tk/menuspec.rb for menu_spec. # opts is a hash of default configs for all of cascade menus. - # Configs of menu_spec can override it. + # Configs of menu_spec can override it. menu_spec.each{|info| add_menu(info, tearoff, opts)} self.menu end @@ -259,4 +259,6 @@ end #TkToplevel = Tk::Toplevel unless Object.const_defined? :TkToplevel -Tk.__set_toplevel_aliases__(:Tk, Tk::Toplevel, :TkToplevel) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Toplevel, :TkToplevel) +Tk.__set_loaded_toplevel_aliases__('tk/toplevel.rb', :Tk, Tk::Toplevel, + :TkToplevel) Index: ext/tk/lib/tk/mngfocus.rb =================================================================== --- ext/tk/lib/tk/mngfocus.rb (revision 23917) +++ ext/tk/lib/tk/mngfocus.rb (working copy) @@ -8,8 +8,8 @@ extend Tk TkCommandNames = [ - 'tk_focusFollowMouse'.freeze, - 'tk_focusNext'.freeze, + 'tk_focusFollowMouse'.freeze, + 'tk_focusNext'.freeze, 'tk_focusPrev'.freeze ].freeze Index: ext/tk/lib/tk/winfo.rb =================================================================== --- ext/tk/lib/tk/winfo.rb (revision 23917) +++ ext/tk/lib/tk/winfo.rb (working copy) @@ -14,7 +14,7 @@ def TkWinfo.atom(name, win=nil) if win - number(tk_call_without_enc('winfo', 'atom', '-displayof', win, + number(tk_call_without_enc('winfo', 'atom', '-displayof', win, _get_eval_enc_str(name))) else number(tk_call_without_enc('winfo', 'atom', _get_eval_enc_str(name))) @@ -26,7 +26,7 @@ def TkWinfo.atomname(id, win=nil) if win - _fromUTF8(tk_call_without_enc('winfo', 'atomname', + _fromUTF8(tk_call_without_enc('winfo', 'atomname', '-displayof', win, id)) else _fromUTF8(tk_call_without_enc('winfo', 'atomname', id)) @@ -67,7 +67,7 @@ def TkWinfo.containing(rootX, rootY, win=nil) if win - window(tk_call_without_enc('winfo', 'containing', + window(tk_call_without_enc('winfo', 'containing', '-displayof', win, rootX, rootY)) else window(tk_call_without_enc('winfo', 'containing', rootX, rootY)) @@ -128,7 +128,7 @@ false, true) else #tk_split_simplelist(tk_call_without_enc('winfo', 'interps')) - tk_split_simplelist(tk_call_without_enc('winfo', 'interps'), + tk_split_simplelist(tk_call_without_enc('winfo', 'interps'), false, true) end end @@ -303,7 +303,7 @@ def TkWinfo.visualsavailable(win, includeids=false) if includeids - list(tk_call_without_enc('winfo', 'visualsavailable', + list(tk_call_without_enc('winfo', 'visualsavailable', win, "includeids")) else list(tk_call_without_enc('winfo', 'visualsavailable', win)) Index: ext/tk/lib/tk/scrollbar.rb =================================================================== --- ext/tk/lib/tk/scrollbar.rb (revision 23917) +++ ext/tk/lib/tk/scrollbar.rb (working copy) @@ -10,7 +10,7 @@ def create_self(keys) @assigned = [] - @scroll_proc = proc{|*args| + @scroll_proc = proc{|*args| if self.orient == 'horizontal' @assigned.each{|w| w.xview(*args)} else # 'vertical' @@ -21,11 +21,11 @@ if keys and keys != None unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ #tk_call_without_enc('scrollbar', @path, *hash_kv(keys, true)) - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else begin - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) rescue tk_call_without_enc(self.class::TkCommandNames[0], @path) @@ -38,7 +38,7 @@ configure(keys) else # re-create widget - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) end end @@ -148,7 +148,9 @@ end #TkScrollbar = Tk::Scrollbar unless Object.const_defined? :TkScrollbar -Tk.__set_toplevel_aliases__(:Tk, Tk::Scrollbar, :TkScrollbar) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Scrollbar, :TkScrollbar) +Tk.__set_loaded_toplevel_aliases__('tk/scrollbar.rb', :Tk, Tk::Scrollbar, + :TkScrollbar) class Tk::XScrollbarval}) end else - tk_send_without_enc('tag', 'configure', _get_eval_enc_str(tag), + tk_send_without_enc('tag', 'configure', _get_eval_enc_str(tag), "-#{key}", _get_eval_enc_str(val)) end end @@ -878,16 +884,16 @@ else if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf[4] if conf[4].index('{') - conf[4] = tk_split_list(conf[4]) + conf[4] = tk_split_list(conf[4]) else - conf[4] = tk_tcl2ruby(conf[4]) + conf[4] = tk_tcl2ruby(conf[4]) end end end @@ -926,16 +932,16 @@ else if conf[2] if conf[2].index('{') - conf[2] = tk_split_list(conf[2]) + conf[2] = tk_split_list(conf[2]) else - conf[2] = tk_tcl2ruby(conf[2]) + conf[2] = tk_tcl2ruby(conf[2]) end end if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end end @@ -980,19 +986,19 @@ =end def tag_raise(tag, above=None) - tk_send_without_enc('tag', 'raise', _get_eval_enc_str(tag), + tk_send_without_enc('tag', 'raise', _get_eval_enc_str(tag), _get_eval_enc_str(above)) self end def tag_lower(tag, below=None) - tk_send_without_enc('tag', 'lower', _get_eval_enc_str(tag), + tk_send_without_enc('tag', 'lower', _get_eval_enc_str(tag), _get_eval_enc_str(below)) self end def tag_remove(tag, *indices) - tk_send_without_enc('tag', 'remove', _get_eval_enc_str(tag), + tk_send_without_enc('tag', 'remove', _get_eval_enc_str(tag), *(indices.collect{|idx| _get_eval_enc_str(idx)})) self end @@ -1001,7 +1007,7 @@ #l = tk_split_simplelist(tk_send_without_enc('tag', 'ranges', # _get_eval_enc_str(tag))) l = tk_split_simplelist(tk_send_without_enc('tag', 'ranges', - _get_eval_enc_str(tag)), + _get_eval_enc_str(tag)), false, true) r = [] while key=l.shift @@ -1011,18 +1017,18 @@ end def tag_nextrange(tag, first, last=None) - simplelist(tk_send_without_enc('tag', 'nextrange', - _get_eval_enc_str(tag), - _get_eval_enc_str(first), + simplelist(tk_send_without_enc('tag', 'nextrange', + _get_eval_enc_str(tag), + _get_eval_enc_str(first), _get_eval_enc_str(last))).collect{|idx| Tk::Text::IndexString.new(idx) } end def tag_prevrange(tag, first, last=None) - simplelist(tk_send_without_enc('tag', 'prevrange', - _get_eval_enc_str(tag), - _get_eval_enc_str(first), + simplelist(tk_send_without_enc('tag', 'prevrange', + _get_eval_enc_str(tag), + _get_eval_enc_str(first), _get_eval_enc_str(last))).collect{|idx| Tk::Text::IndexString.new(idx) } @@ -1032,7 +1038,7 @@ def window_cget(index, slot) case slot.to_s when 'text', 'label', 'show', 'data', 'file' - _fromUTF8(tk_send_without_enc('window', 'cget', + _fromUTF8(tk_send_without_enc('window', 'cget', _get_eval_enc_str(index), "-#{slot}")) when 'font', 'kanjifont' #fnt = tk_tcl2ruby(tk_send('window', 'cget', index, "-#{slot}")) @@ -1076,12 +1082,12 @@ slot['create'] = install_cmd(proc{_epath(p_create.call)}) end end - tk_send_without_enc('window', 'configure', - _get_eval_enc_str(index), + tk_send_without_enc('window', 'configure', + _get_eval_enc_str(index), *hash_kv(slot, true)) else if slot == 'window' || slot == :window - # id = value + # id = value # value = id.epath if id.kind_of?(TkWindow) value = _epath(value) end @@ -1101,8 +1107,8 @@ value = install_cmd(proc{_epath(p_create.call)}) end end - tk_send_without_enc('window', 'configure', - _get_eval_enc_str(index), + tk_send_without_enc('window', 'configure', + _get_eval_enc_str(index), "-#{slot}", _get_eval_enc_str(value)) end end @@ -1129,16 +1135,16 @@ else if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf[4] if conf[4].index('{') - conf[4] = tk_split_list(conf[4]) + conf[4] = tk_split_list(conf[4]) else - conf[4] = tk_tcl2ruby(conf[4]) + conf[4] = tk_tcl2ruby(conf[4]) end end end @@ -1166,16 +1172,16 @@ else if conf[2] if conf[2].index('{') - conf[2] = tk_split_list(conf[2]) + conf[2] = tk_split_list(conf[2]) else - conf[2] = tk_tcl2ruby(conf[2]) + conf[2] = tk_tcl2ruby(conf[2]) end end if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end end @@ -1231,11 +1237,11 @@ # $KCODE == 'NONE' if JAPANIZED_TK - tk_call_without_enc('kstring', 'length', + tk_call_without_enc('kstring', 'length', _get_eval_enc_str(txt)).to_i else begin - tk_call_without_enc('encoding', 'convertto', 'ascii', + tk_call_without_enc('encoding', 'convertto', 'ascii', _get_eval_enc_str(txt)).length rescue StandardError, NameError # sorry, I have no plan @@ -1324,11 +1330,11 @@ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 if pat.kind_of?(String) #return [index(start + " + #{pos} chars"), pat.split('').length] - return [index(start + " + #{pos} chars"), + return [index(start + " + #{pos} chars"), _ktext_length(pat), pat.dup] else #return [index(start + " + #{pos} chars"), $&.split('').length] - return [index(start + " + #{pos} chars"), + return [index(start + " + #{pos} chars"), _ktext_length(match), match] end else @@ -1342,11 +1348,11 @@ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 if pat.kind_of?(String) #return [index(start + " + #{pos} chars"), pat.split('').length] - return [index(start + " + #{pos} chars"), + return [index(start + " + #{pos} chars"), _ktext_length(pat), pat.dup] else #return [index(start + " + #{pos} chars"), $&.split('').length] - return [index(start + " + #{pos} chars"), + return [index(start + " + #{pos} chars"), _ktext_length(match), match] end else @@ -1357,7 +1363,7 @@ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 if pat.kind_of?(String) #return [index("1.0 + #{pos} chars"), pat.split('').length] - return [index("1.0 + #{pos} chars"), + return [index("1.0 + #{pos} chars"), _ktext_length(pat), pat.dup] else #return [index("1.0 + #{pos} chars"), $&.split('').length] @@ -1447,7 +1453,7 @@ idx = str.index(/ /, i) result.push str[i..(idx-1)] i = idx + 1 - + # retrieve value case result[-1] when 'text' @@ -1505,7 +1511,7 @@ break end end - + kvis = [] until result.empty? kvis.push [result.shift, result.shift, result.shift] @@ -1570,7 +1576,8 @@ end #TkText = Tk::Text unless Object.const_defined? :TkText -Tk.__set_toplevel_aliases__(:Tk, Tk::Text, :TkText) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Text, :TkText) +Tk.__set_loaded_toplevel_aliases__('tk/text.rb', :Tk, Tk::Text, :TkText) ####################################### Index: ext/tk/lib/tk/itemfont.rb =================================================================== --- ext/tk/lib/tk/itemfont.rb (revision 23917) +++ ext/tk/lib/tk/itemfont.rb (working copy) @@ -32,22 +32,22 @@ if key pathname = [win, tag, key].join(';') - TkFont.used_on(pathname) || - TkFont.init_widget_font(pathname, + TkFont.used_on(pathname) || + TkFont.init_widget_font(pathname, *(__item_confinfo_cmd(tagid(tagOrId)))) elsif optkeys.size == 1 pathname = [win, tag, optkeys[0]].join(';') - TkFont.used_on(pathname) || - TkFont.init_widget_font(pathname, + TkFont.used_on(pathname) || + TkFont.init_widget_font(pathname, *(__item_confinfo_cmd(tagid(tagOrId)))) else fonts = {} optkeys.each{|key| key = key.to_s pathname = [win, tag, key].join(';') - fonts[key] = - TkFont.used_on(pathname) || - TkFont.init_widget_font(pathname, + fonts[key] = + TkFont.used_on(pathname) || + TkFont.init_widget_font(pathname, *(__item_confinfo_cmd(tagid(tagOrId)))) } fonts @@ -73,13 +73,13 @@ slot.delete(a_optkey) slot.delete(k_optkey) - fnt.call_font_configure([pathname, optkey], + fnt.call_font_configure([pathname, optkey], *(__item_config_cmd(tagid(tagOrId)) << {})) next else if fnt - if (slot.key?(l_optkey) || - slot.key?(a_optkey) || + if (slot.key?(l_optkey) || + slot.key?(a_optkey) || slot.key?(k_optkey)) fnt = TkFont.new(fnt) @@ -90,7 +90,7 @@ fnt.latin_replace(lfnt) if lfnt fnt.kanji_replace(kfnt) if kfnt - fnt.call_font_configure([pathname, optkey], + fnt.call_font_configure([pathname, optkey], *(__item_config_cmd(tagid(tagOrId)) << {})) next else @@ -115,7 +115,7 @@ kfnt = slot.delete(k_optkey) if lfnt && kfnt - TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey], + TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey], *(__item_config_cmd(tagid(tagOrId)) << {})) elsif lfnt latintagfont_configure([lfnt, optkey]) @@ -264,10 +264,10 @@ end if targetkey - fnt.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey], + fnt.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey], *(__item_config_cmd(tagid(tagOrId)) << {})) else - fnt.call_font_configure(__item_pathname(tagid(tagOrId)), + fnt.call_font_configure(__item_pathname(tagid(tagOrId)), *(__item_config_cmd(tagid(tagOrId)) << {})) end self @@ -276,10 +276,10 @@ def latintagfont_copy(tagOrId, win, wintag=nil, winkey=nil, targetkey=nil) if targetkey - fontobj(targetkey).dup.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey], + fontobj(targetkey).dup.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey], *(__item_config_cmd(tagid(tagOrId)) << {})) else - fontobj.dup.call_font_configure(__item_pathname(tagid(tagOrId)), + fontobj.dup.call_font_configure(__item_pathname(tagid(tagOrId)), *(__item_config_cmd(tagid(tagOrId)) << {})) end @@ -302,10 +302,10 @@ def kanjifont_copy(tagOrId, win, wintag=nil, winkey=nil, targetkey=nil) if targetkey - fontobj(targetkey).dup.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey], + fontobj(targetkey).dup.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey], *(__item_config_cmd(tagid(tagOrId)) << {})) else - fontobj.dup.call_font_configure(__item_pathname(tagid(tagOrId)), + fontobj.dup.call_font_configure(__item_pathname(tagid(tagOrId)), *(__item_config_cmd(tagid(tagOrId)) << {})) end Index: ext/tk/lib/tk/scale.rb =================================================================== --- ext/tk/lib/tk/scale.rb (revision 23917) +++ ext/tk/lib/tk/scale.rb (working copy) @@ -16,11 +16,11 @@ end unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ #tk_call_without_enc('scale', @path, *hash_kv(keys, true)) - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) else begin - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) rescue tk_call_without_enc(self.class::TkCommandNames[0], @path) @@ -33,7 +33,7 @@ configure(keys) else # re-create widget - tk_call_without_enc(self.class::TkCommandNames[0], @path, + tk_call_without_enc(self.class::TkCommandNames[0], @path, *hash_kv(keys, true)) end end @@ -69,7 +69,7 @@ def configure(slot, value=None) if (slot == 'command' || slot == :command) configure('command'=>value) - elsif slot.kind_of?(Hash) && + elsif slot.kind_of?(Hash) && (slot.key?('command') || slot.key?(:command)) slot = _symbolkey2str(slot) slot['command'] = _wrap_command_arg(slot.delete('command')) @@ -108,4 +108,5 @@ end #TkScale = Tk::Scale unless Object.const_defined? :TkScale -Tk.__set_toplevel_aliases__(:Tk, Tk::Scale, :TkScale) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Scale, :TkScale) +Tk.__set_loaded_toplevel_aliases__('tk/scale.rb', :Tk, Tk::Scale, :TkScale) Index: ext/tk/lib/tk/validation.rb =================================================================== --- ext/tk/lib/tk/validation.rb (revision 23917) +++ ext/tk/lib/tk/validation.rb (working copy) @@ -211,21 +211,21 @@ class ValidateArgs < TkUtil::CallbackSubst KEY_TBL = [ - [ ?d, ?n, :action ], - [ ?i, ?x, :index ], - [ ?s, ?e, :current ], - [ ?v, ?s, :type ], - [ ?P, ?e, :value ], - [ ?S, ?e, :string ], - [ ?V, ?s, :triggered ], - [ ?W, ?w, :widget ], + [ ?d, ?n, :action ], + [ ?i, ?x, :index ], + [ ?s, ?e, :current ], + [ ?v, ?s, :type ], + [ ?P, ?e, :value ], + [ ?S, ?e, :string ], + [ ?V, ?s, :triggered ], + [ ?W, ?w, :widget ], nil ] PROC_TBL = [ - [ ?n, TkComm.method(:number) ], - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], + [ ?n, TkComm.method(:number) ], + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], [ ?e, proc{|val| #enc = Tk.encoding @@ -236,7 +236,7 @@ TkComm::string(val) end } - ], + ], [ ?x, proc{|val| idx = TkComm::number(val) @@ -246,7 +246,7 @@ idx end } - ], + ], nil ] @@ -272,7 +272,7 @@ _setup_subst_table(KEY_TBL, PROC_TBL); # - # NOTE: The order of parameters which passed to callback procedure is + # NOTE: The order of parameters which passed to callback procedure is # , , ... , , , ... # Index: ext/tk/lib/tk/namespace.rb =================================================================== --- ext/tk/lib/tk/namespace.rb (revision 23917) +++ ext/tk/lib/tk/namespace.rb (working copy) @@ -8,7 +8,7 @@ extend Tk TkCommandNames = [ - 'namespace'.freeze, + 'namespace'.freeze, ].freeze Tk_Namespace_ID_TBL = TkCore::INTERP.create_table @@ -46,7 +46,7 @@ private :__config_cmd def __configinfo_struct - {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, + {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil, :default_value=>nil, :current_value=>2} end private :__configinfo_struct @@ -122,8 +122,8 @@ if TkComm::GET_CONFIGINFO_AS_ARRAY Tk_Namespace_ID_TBL.mutex.synchronize{ - info.map!{|inf| - if inf[0] == 'namespace' && + info.map!{|inf| + if inf[0] == 'namespace' && TkNamespace::Tk_Namespace_ID_TBL.key?(inf[-1]) [inf[0], TkNamespace::Tk_Namespace_ID_TBL[inf[-1]]] else @@ -160,19 +160,19 @@ def tk_call(*args) #super('namespace', 'eval', @namespace, *args) args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''} - super('namespace', 'eval', @namespace, + super('namespace', 'eval', @namespace, TkCore::INTERP._merge_tklist(*args)) end def tk_call_without_enc(*args) #super('namespace', 'eval', @namespace, *args) args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''} - super('namespace', 'eval', @namespace, + super('namespace', 'eval', @namespace, TkCore::INTERP._merge_tklist(*args)) end def tk_call_with_enc(*args) #super('namespace', 'eval', @namespace, *args) args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''} - super('namespace', 'eval', @namespace, + super('namespace', 'eval', @namespace, TkCore::INTERP._merge_tklist(*args)) end @@ -223,19 +223,19 @@ def tk_call(*args) #super('namespace', 'eval', @fullname, *args) args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''} - super('namespace', 'eval', @fullname, + super('namespace', 'eval', @fullname, TkCore::INTERP._merge_tklist(*args)) end def tk_call_without_enc(*args) #super('namespace', 'eval', @fullname, *args) args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''} - super('namespace', 'eval', @fullname, + super('namespace', 'eval', @fullname, TkCore::INTERP._merge_tklist(*args)) end def tk_call_with_enc(*args) #super('namespace', 'eval', @fullname, *args) args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''} - super('namespace', 'eval', @fullname, + super('namespace', 'eval', @fullname, TkCore::INTERP._merge_tklist(*args)) end alias ns_tk_call tk_call @@ -318,7 +318,7 @@ else fail ArgumentError, "String or Proc is expected" end - TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code', + TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code', _get_eval_string(cmd, false))) end =end @@ -350,8 +350,8 @@ else fail ArgumentError, "String or Proc is expected" end - TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code', - _get_eval_string(cmd, false)), + TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code', + _get_eval_string(cmd, false)), true) end Index: ext/tk/lib/tk/entry.rb =================================================================== --- ext/tk/lib/tk/entry.rb (revision 23917) +++ ext/tk/lib/tk/entry.rb (working copy) @@ -116,4 +116,5 @@ end #TkEntry = Tk::Entry unless Object.const_defined? :TkEntry -Tk.__set_toplevel_aliases__(:Tk, Tk::Entry, :TkEntry) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Entry, :TkEntry) +Tk.__set_loaded_toplevel_aliases__('tk/entry.rb', :Tk, Tk::Entry, :TkEntry) Index: ext/tk/lib/tk/ttk_selector.rb =================================================================== --- ext/tk/lib/tk/ttk_selector.rb (revision 23917) +++ ext/tk/lib/tk/ttk_selector.rb (working copy) @@ -5,70 +5,92 @@ # toplevel classes/modules module Tk @TOPLEVEL_ALIAS_TABLE[:Ttk] = { - :TkButton => 'tkextlib/tile/tbutton', + :TkButton => 'tkextlib/tile/tbutton', - :TkCheckbutton => 'tkextlib/tile/tcheckbutton', - :TkCheckButton => 'tkextlib/tile/tcheckbutton', + :TkCheckbutton => 'tkextlib/tile/tcheckbutton', + :TkCheckButton => 'tkextlib/tile/tcheckbutton', - # :TkDialog => 'tkextlib/tile/dialog', + # :TkDialog => 'tkextlib/tile/dialog', - :TkEntry => 'tkextlib/tile/tentry', + :TkEntry => 'tkextlib/tile/tentry', - :TkCombobox => 'tkextlib/tile/tcombobox', + :TkCombobox => 'tkextlib/tile/tcombobox', - :TkFrame => 'tkextlib/tile/tframe', + :TkFrame => 'tkextlib/tile/tframe', - :TkLabel => 'tkextlib/tile/tlabel', + :TkLabel => 'tkextlib/tile/tlabel', - :TkLabelframe => 'tkextlib/tile/tlabelframe', - :TkLabelFrame => 'tkextlib/tile/tlabelframe', + :TkLabelframe => 'tkextlib/tile/tlabelframe', + :TkLabelFrame => 'tkextlib/tile/tlabelframe', - :TkMenubutton => 'tkextlib/tile/tmenubutton', - :TkMenuButton => 'tkextlib/tile/tmenubutton', + :TkMenubutton => 'tkextlib/tile/tmenubutton', + :TkMenuButton => 'tkextlib/tile/tmenubutton', - :TkNotebook => 'tkextlib/tile/tnotebook', + :TkNotebook => 'tkextlib/tile/tnotebook', - # :TkPaned => 'tkextlib/tile/tpaned', - :TkPanedwindow => 'tkextlib/tile/tpaned', - :TkPanedWindow => 'tkextlib/tile/tpaned', + # :TkPaned => 'tkextlib/tile/tpaned', + :TkPanedwindow => 'tkextlib/tile/tpaned', + :TkPanedWindow => 'tkextlib/tile/tpaned', - :TkProgressbar => 'tkextlib/tile/tprogressbar', + :TkProgressbar => 'tkextlib/tile/tprogressbar', - :TkRadiobutton => 'tkextlib/tile/tradiobutton', - :TkRadioButton => 'tkextlib/tile/tradiobutton', + :TkRadiobutton => 'tkextlib/tile/tradiobutton', + :TkRadioButton => 'tkextlib/tile/tradiobutton', - :TkScale => 'tkextlib/tile/tscale', - # :TkProgress => 'tkextlib/tile/tscale', + :TkScale => 'tkextlib/tile/tscale', + # :TkProgress => 'tkextlib/tile/tscale', - :TkScrollbar => 'tkextlib/tile/tscrollbar', - :TkXScrollbar => 'tkextlib/tile/tscrollbar', - :TkYScrollbar => 'tkextlib/tile/tscrollbar', + :TkScrollbar => 'tkextlib/tile/tscrollbar', + :TkXScrollbar => 'tkextlib/tile/tscrollbar', + :TkYScrollbar => 'tkextlib/tile/tscrollbar', - :TkSeparator => 'tkextlib/tile/tseparator', + :TkSeparator => 'tkextlib/tile/tseparator', - :TkSizeGrip => 'tkextlib/tile/sizegrip', - :TkSizegrip => 'tkextlib/tile/sizegrip', + :TkSizeGrip => 'tkextlib/tile/sizegrip', + :TkSizegrip => 'tkextlib/tile/sizegrip', - # :TkSquare => 'tkextlib/tile/tsquare', + # :TkSquare => 'tkextlib/tile/tsquare', - :TkTreeview => 'tkextlib/tile/treeview', + :TkTreeview => 'tkextlib/tile/treeview', } - @TOPLEVEL_ALIAS_TABLE[:Tile] = @TOPLEVEL_ALIAS_TABLE[:Ttk] + # @TOPLEVEL_ALIAS_TABLE[:Tile] = @TOPLEVEL_ALIAS_TABLE[:Ttk] + Tk.__create_widget_set__(:Tile, :Ttk) + + ############################################ + # depend on the version of Tcl/Tk + major, minor, type, patchlevel = TclTkLib.get_version + + # ttk::spinbox is supported on Tcl/Tk8.6b1 or later + if ([major,minor,type,patchlevel] <=> + [8,6,TclTkLib::RELEASE_TYPE::BETA,1]) >= 0 + @TOPLEVEL_ALIAS_TABLE[:Ttk].update( + :TkSpinbox => 'tkextlib/tile/tspinbox' + ) + end + ################################################ # register some Ttk widgets as default # (Ttk is a standard library on Tcl/Tk8.5+) @TOPLEVEL_ALIAS_TABLE[:Ttk].each{|sym, file| - unless Object.autoload?(sym) || Object.const_defined?(sym) - Object.autoload(sym, file) - end + #unless Tk::TOPLEVEL_ALIASES.autoload?(sym) || Tk::TOPLEVEL_ALIASES.const_defined?(sym) + # @TOPLEVEL_ALIAS_OWNER[sym] = :Ttk + # Tk::TOPLEVEL_ALIASES.autoload(sym, file) + #end + Tk.__regist_toplevel_aliases__(:Ttk, file, sym) } ################################################ - @TOPLEVEL_ALIAS_SETUP_PROC[:Tile] = - @TOPLEVEL_ALIAS_SETUP_PROC[:Ttk] = proc{|mod| - unless Tk.autoload?(:Tile) || Tk.const_defined?(:Tile) + # @TOPLEVEL_ALIAS_SETUP_PROC[:Tile] = + # @TOPLEVEL_ALIAS_SETUP_PROC[:Ttk] = proc{|mod| + # unless Tk.autoload?(:Tile) || Tk.const_defined?(:Tile) + # Object.autoload :Ttk, 'tkextlib/tile' + # Tk.autoload :Tile, 'tkextlib/tile' + # end + # } + Tk.__toplevel_alias_setup_proc__(:Ttk, :Tile){|mod| + unless Tk.autoload?(:Tile) || Tk.const_defined?(:Tile) Object.autoload :Ttk, 'tkextlib/tile' Tk.autoload :Tile, 'tkextlib/tile' end Index: ext/tk/lib/tk/menu.rb =================================================================== --- ext/tk/lib/tk/menu.rb (revision 23917) +++ ext/tk/lib/tk/menu.rb (working copy) @@ -33,13 +33,14 @@ end private :__item_val2ruby_optkeys + alias entrycget_tkstring itemcget_tkstring alias entrycget itemcget alias entrycget_strict itemcget_strict alias entryconfigure itemconfigure alias entryconfiginfo itemconfiginfo alias current_entryconfiginfo current_itemconfiginfo - private :itemcget, :itemcget_strict + private :itemcget_tkstring, :itemcget, :itemcget_strict private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo end @@ -155,13 +156,13 @@ _fromUTF8(tk_send_without_enc('invoke', _get_eval_enc_str(index))) end def insert(index, type, keys=nil) - tk_send_without_enc('insert', _get_eval_enc_str(index), + tk_send_without_enc('insert', _get_eval_enc_str(index), type, *hash_kv(keys, true)) self end def delete(first, last=nil) if last - tk_send_without_enc('delete', _get_eval_enc_str(first), + tk_send_without_enc('delete', _get_eval_enc_str(first), _get_eval_enc_str(last)) else tk_send_without_enc('delete', _get_eval_enc_str(first)) @@ -170,7 +171,7 @@ end def popup(x, y, index=nil) if index - tk_call_without_enc('tk_popup', path, x, y, + tk_call_without_enc('tk_popup', path, x, y, _get_eval_enc_str(index)) else tk_call_without_enc('tk_popup', path, x, y) @@ -214,7 +215,7 @@ def entrycget(index, key) case key.to_s when 'text', 'label', 'show' - _fromUTF8(tk_send_without_enc('entrycget', + _fromUTF8(tk_send_without_enc('entrycget', _get_eval_enc_str(index), "-#{key}")) when 'font', 'kanjifont' #fnt = tk_tcl2ruby(tk_send('entrycget', index, "-#{key}")) @@ -234,20 +235,20 @@ end def entryconfigure(index, key, val=None) if key.kind_of? Hash - if (key['font'] || key[:font] || - key['kanjifont'] || key[:kanjifont] || - key['latinfont'] || key[:latinfont] || + if (key['font'] || key[:font] || + key['kanjifont'] || key[:kanjifont] || + key['latinfont'] || key[:latinfont] || key['asciifont'] || key[:asciifont]) tagfont_configure(index, _symbolkey2str(key)) else - tk_send_without_enc('entryconfigure', _get_eval_enc_str(index), + tk_send_without_enc('entryconfigure', _get_eval_enc_str(index), *hash_kv(key, true)) end else - if (key == 'font' || key == :font || - key == 'kanjifont' || key == :kanjifont || - key == 'latinfont' || key == :latinfont || + if (key == 'font' || key == :font || + key == 'kanjifont' || key == :kanjifont || + key == 'latinfont' || key == :latinfont || key == 'asciifont' || key == :asciifont ) if val == None tagfontobj(index) @@ -284,16 +285,16 @@ else if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf[4] if conf[4].index('{') - conf[4] = tk_split_list(conf[4]) + conf[4] = tk_split_list(conf[4]) else - conf[4] = tk_tcl2ruby(conf[4]) + conf[4] = tk_tcl2ruby(conf[4]) end end end @@ -331,16 +332,16 @@ else if conf[2] if conf[2].index('{') - conf[2] = tk_split_list(conf[2]) + conf[2] = tk_split_list(conf[2]) else - conf[2] = tk_tcl2ruby(conf[2]) + conf[2] = tk_tcl2ruby(conf[2]) end end if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end end @@ -386,7 +387,8 @@ end #TkMenu = Tk::Menu unless Object.const_defined? :TkMenu -Tk.__set_toplevel_aliases__(:Tk, Tk::Menu, :TkMenu) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Menu, :TkMenu) +Tk.__set_loaded_toplevel_aliases__('tk/menu.rb', :Tk, Tk::Menu, :TkMenu) class Tk::MenuClone@variable, + @menu.add('radiobutton', 'variable'=>@variable, 'label'=>value, 'value'=>value) self end @@ -623,7 +635,7 @@ @menu.invoke(index) end def insert(index, value) - @menu.insert(index, 'radiobutton', 'variable'=>@variable, + @menu.insert(index, 'radiobutton', 'variable'=>@variable, 'label'=>value, 'value'=>value) self end @@ -677,5 +689,7 @@ Tk::OptionMenuButton = Tk::OptionMenubutton #TkOptionMenubutton = Tk::OptionMenubutton unless Object.const_defined? :TkOptionMenubutton #TkOptionMenuButton = Tk::OptionMenuButton unless Object.const_defined? :TkOptionMenuButton -Tk.__set_toplevel_aliases__(:Tk, Tk::OptionMenubutton, - :TkOptionMenubutton, :TkOptionMenuButton) +#Tk.__set_toplevel_aliases__(:Tk, Tk::OptionMenubutton, +# :TkOptionMenubutton, :TkOptionMenuButton) +Tk.__set_loaded_toplevel_aliases__('tk/menu.rb', :Tk, Tk::OptionMenubutton, + :TkOptionMenubutton, :TkOptionMenuButton) Index: ext/tk/lib/tk/kinput.rb =================================================================== --- ext/tk/lib/tk/kinput.rb (revision 23917) +++ ext/tk/lib/tk/kinput.rb (working copy) @@ -8,8 +8,8 @@ extend Tk TkCommandNames = [ - 'kinput_start'.freeze, - 'kinput_send_spot'.freeze, + 'kinput_start'.freeze, + 'kinput_send_spot'.freeze, 'kanjiInput'.freeze ].freeze @@ -47,7 +47,7 @@ def TkKinput.attribute_info(win, slot=nil) if slot - conf = tk_split_list(tk_call('kanjiInput', 'attribute', + conf = tk_split_list(tk_call('kanjiInput', 'attribute', win, "-#{slot}")) conf[0] = conf[0][1..-1] conf Index: ext/tk/lib/tk/label.rb =================================================================== --- ext/tk/lib/tk/label.rb (revision 23917) +++ ext/tk/lib/tk/label.rb (working copy) @@ -18,4 +18,5 @@ end #TkLabel = Tk::Label unless Object.const_defined? :TkLabel -Tk.__set_toplevel_aliases__(:Tk, Tk::Label, :TkLabel) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Label, :TkLabel) +Tk.__set_loaded_toplevel_aliases__('tk/label.rb', :Tk, Tk::Label, :TkLabel) Index: ext/tk/lib/tk/menuspec.rb =================================================================== --- ext/tk/lib/tk/menuspec.rb (revision 23917) +++ ext/tk/lib/tk/menuspec.rb (working copy) @@ -3,7 +3,7 @@ # Hidethoshi NAGAI (nagai@ai.kyutech.ac.jp) # # based on tkmenubar.rb : -# Copyright (C) 1998 maeda shugo. All rights reserved. +# Copyright (C) 1998 maeda shugo. All rights reserved. # This file can be distributed under the terms of the Ruby. # # The format of the menu_spec is: @@ -14,24 +14,24 @@ # [text, underline, configs], # menu button/entry (*1) # [label, command, underline, accelerator, configs], # command entry # [label, TkVar_obj, underline, accelerator, configs], # checkbutton entry -# [label, [TkVar_obj, value], +# [label, [TkVar_obj, value], # underline, accelerator, configs], # radiobutton entry -# [label, [[...menu_info...], [...menu_info...], ...], +# [label, [[...menu_info...], [...menu_info...], ...], # underline, accelerator, configs], # cascade entry (*2) # '---', # separator # ... # ] # -# underline, accelerator, and configs are optional pearameters. -# Hashes are OK instead of Arrays. Then the entry type ('command', +# underline, accelerator, and configs are optional pearameters. +# Hashes are OK instead of Arrays. Then the entry type ('command', # 'checkbutton', 'radiobutton' or 'cascade') is given by 'type' key # (e.g. :type=>'cascade'). When type is 'cascade', an array of menu_info # is acceptable for 'menu' key (then, create sub-menu). # # NOTE: (*1) -# If you want to make special menus (*.help for UNIX, *.system for Win, -# and *.apple for Mac), append 'menu_name'=>name (name is 'help' for UNIX, -# 'system' for Win, and 'apple' for Mac) option to the configs hash of +# If you want to make special menus (*.help for UNIX, *.system for Win, +# and *.apple for Mac), append 'menu_name'=>name (name is 'help' for UNIX, +# 'system' for Win, and 'apple' for Mac) option to the configs hash of # menu button/entry information. # # NOTE: (*2) @@ -39,7 +39,7 @@ # to the configs of the cascade entry. module TkMenuSpec - def _create_menu(parent, menu_info, menu_name = nil, + def _create_menu(parent, menu_info, menu_name = nil, tearoff = false, default_opts = nil) if tearoff.kind_of?(Hash) default_opts = tearoff @@ -80,7 +80,7 @@ menu_opts.update(_symbolkey2str(options.delete('menu_config') || {})) if item_type == 'cascade' && options['menu'].kind_of?(Array) # create cascade menu - submenu = _create_menu(menu, options['menu'], menu_name, + submenu = _create_menu(menu, options['menu'], menu_name, tearoff, menu_opts) options['menu'] = submenu end @@ -117,7 +117,7 @@ menu_config = opts.delete('menu_config') || {} menu_opts.update(_symbolkey2str(menu_config)) end - submenu = _create_menu(menu, item_info[1], menu_name, + submenu = _create_menu(menu, item_info[1], menu_name, tearoff, menu_opts) options['menu'] = submenu end @@ -155,7 +155,7 @@ def _use_menubar?(parent) use_menubar = false if parent.kind_of?(Tk::Root) || parent.kind_of?(Tk::Toplevel) - true + true elsif parent.current_configinfo.has_key?('menu') true else @@ -214,7 +214,7 @@ keys = {:label=>btn_info} end - menu = _create_menu(mbar, menu_info[1..-1], menu_name, + menu = _create_menu(mbar, menu_info[1..-1], menu_name, tearoff, default_opts) menu.tearoff(tearoff) @@ -251,9 +251,9 @@ mbtn.pack('side' => 'left') - menu = _create_menu(mbtn, menu_info[1..-1], menu_name, + menu = _create_menu(mbtn, menu_info[1..-1], menu_name, tearoff, default_opts) - + mbtn.menu(menu) [mbtn, menu] Index: ext/tk/lib/tk/spinbox.rb =================================================================== --- ext/tk/lib/tk/spinbox.rb (revision 23917) +++ ext/tk/lib/tk/spinbox.rb (working copy) @@ -13,15 +13,15 @@ class SpinCommand < TkValidateCommand class ValidateArgs < TkUtil::CallbackSubst KEY_TBL = [ - [ ?d, ?s, :direction ], - [ ?s, ?e, :current ], - [ ?W, ?w, :widget ], + [ ?d, ?s, :direction ], + [ ?s, ?e, :current ], + [ ?W, ?w, :widget ], nil ] PROC_TBL = [ - [ ?s, TkComm.method(:string) ], - [ ?w, TkComm.method(:window) ], + [ ?s, TkComm.method(:string) ], + [ ?w, TkComm.method(:window) ], [ ?e, proc{|val| #enc = Tk.encoding @@ -32,7 +32,7 @@ TkComm::string(val) end } - ], + ], nil ] @@ -100,13 +100,36 @@ tk_send_without_enc('identify', x, y) end + def invoke(elem) + tk_send_without_enc('invoke', elem) + self + end + def spinup - tk_send_without_enc('invoke', 'spinup') + begin + tk_send_without_enc('invoke', 'buttonup') + rescue RuntimeError => e + # old version of element? + begin + tk_send_without_enc('invoke', 'spinup') + rescue + fail e + end + end self end def spindown - tk_send_without_enc('invoke', 'spindown') + begin + tk_send_without_enc('invoke', 'buttondown') + rescue RuntimeError => e + # old version of element? + begin + tk_send_without_enc('invoke', 'spinup') + rescue + fail e + end + end self end @@ -116,4 +139,6 @@ end #TkSpinbox = Tk::Spinbox unless Object.const_defined? :TkSpinbox -Tk.__set_toplevel_aliases__(:Tk, Tk::Spinbox, :TkSpinbox) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Spinbox, :TkSpinbox) +Tk.__set_loaded_toplevel_aliases__('tk/spinbox.rb', :Tk, Tk::Spinbox, + :TkSpinbox) Index: ext/tk/lib/tk/place.rb =================================================================== --- ext/tk/lib/tk/place.rb (revision 23917) +++ ext/tk/lib/tk/place.rb (working copy) @@ -35,9 +35,9 @@ # win = win.epath if win.kind_of?(TkObject) win = _epath(win) if slot - #conf = tk_split_list(tk_call_without_enc('place', 'configure', + #conf = tk_split_list(tk_call_without_enc('place', 'configure', # win, "-#{slot}") ) - conf = tk_split_simplelist(tk_call_without_enc('place', 'configure', + conf = tk_split_simplelist(tk_call_without_enc('place', 'configure', win, "-#{slot}") ) conf[0] = conf[0][1..-1] conf[1] = tk_tcl2ruby(conf[1]) @@ -46,7 +46,7 @@ conf[4] = tk_tcl2ruby(conf[1]) conf else - tk_split_simplelist(tk_call_without_enc('place', 'configure', + tk_split_simplelist(tk_call_without_enc('place', 'configure', win)).collect{|conflist| #conf = list(conflist) conf = simplelist(conflist).collect!{|inf| tk_tcl2ruby(inf)} @@ -63,16 +63,16 @@ # win = win.epath if win.kind_of?(TkObject) win = _epath(win) if slot - #conf = tk_split_list(tk_call_without_enc('place', 'configure', + #conf = tk_split_list(tk_call_without_enc('place', 'configure', # win, "-#{slot}") ) - conf = tk_split_simplelist(tk_call_without_enc('place', 'configure', + conf = tk_split_simplelist(tk_call_without_enc('place', 'configure', win, "-#{slot}") ) # { conf[0][1..-1] => conf[1] } { conf[0][1..-1] => tk_tcl2ruby(conf[4]) } else ret = {} #tk_split_list(tk_call_without_enc('place','configure',win)).each{|conf| - tk_split_simplelist(tk_call_without_enc('place', 'configure', + tk_split_simplelist(tk_call_without_enc('place', 'configure', win)).each{|conf_list| #ret[conf[0][1..-1]] = conf[1] conf = simplelist(conf_list) Index: ext/tk/lib/tk/itemconfig.rb =================================================================== --- ext/tk/lib/tk/itemconfig.rb (revision 23917) +++ ext/tk/lib/tk/itemconfig.rb (working copy) @@ -31,10 +31,10 @@ def __item_strval_optkeys(id) # maybe need to override [ - 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile', - 'activebackground', 'activeforeground', 'background', - 'disabledforeground', 'disabledbackground', 'foreground', - 'highlightbackground', 'highlightcolor', 'insertbackground', + 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile', + 'activebackground', 'activeforeground', 'background', + 'disabledforeground', 'disabledbackground', 'foreground', + 'highlightbackground', 'highlightcolor', 'insertbackground', 'selectbackground', 'selectforeground', 'troughcolor' ] end @@ -148,7 +148,7 @@ def __item_configinfo_struct(id) # maybe need to override - {:key=>0, :alias=>1, :db_name=>1, :db_class=>2, + {:key=>0, :alias=>1, :db_name=>1, :db_class=>2, :default_value=>3, :current_value=>4} end private :__item_configinfo_struct @@ -162,6 +162,13 @@ ################################################ + + def itemcget_tkstring(tagOrId, option) + opt = option.to_s + fail ArgumentError, "Invalid option `#{option.inspect}'" if opt.length == 0 + tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{opt}")) + end + def __itemcget_core(tagOrId, option) orig_opt = option option = option.to_s @@ -402,7 +409,7 @@ fontkey = $2 # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{fontkey}")))) conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{fontkey}")), false, true) - conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1] if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \ || conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 ) @@ -414,7 +421,7 @@ elsif ( __item_configinfo_struct(tagid(tagOrId))[:alias] \ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 \ && conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?- ) - conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1] end conf @@ -464,7 +471,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = number(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil @@ -472,7 +479,7 @@ end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = number(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil @@ -485,11 +492,11 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -500,7 +507,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = bool(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil @@ -508,7 +515,7 @@ end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = bool(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil @@ -521,11 +528,11 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -536,12 +543,12 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =~ /^[0-9]/ ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =~ /^[0-9]/ ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -574,13 +581,13 @@ # conf = tk_split_list(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))) conf = tk_split_list(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), 0, false, true) end - conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1] if ( __item_configinfo_struct(tagid(tagOrId))[:alias] \ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 \ && conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?- ) - conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1] end @@ -591,7 +598,7 @@ # conf = tk_split_simplelist(conflist) ret = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false).collect{|conflist| conf = tk_split_simplelist(conflist, false, true) - conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1] optkey = conf[__item_configinfo_struct(tagid(tagOrId))[:key]] @@ -627,7 +634,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = number(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil @@ -635,7 +642,7 @@ end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = number(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil @@ -645,11 +652,11 @@ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -657,7 +664,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = bool(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil @@ -665,7 +672,7 @@ end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = bool(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil @@ -675,11 +682,11 @@ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -687,12 +694,12 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =~ /^[0-9]/ ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =~ /^[0-9]/ ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -719,20 +726,20 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) if conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]].index('{') - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = - tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) else - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = - tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end end if conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] if conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]].index('{') - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = - tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) else - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = - tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end end end @@ -740,7 +747,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:alias] \ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 \ && conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?- ) - conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1] end @@ -774,7 +781,7 @@ fontkey = $2 # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{fontkey}")))) conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{fontkey}")), false, true) - conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1] if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \ @@ -788,7 +795,7 @@ elsif ( __item_configinfo_struct(tagid(tagOrId))[:alias] \ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 ) if conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?- - conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1] end { conf[0] => conf[1] } @@ -841,7 +848,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = number(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil @@ -849,7 +856,7 @@ end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = number(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil @@ -862,11 +869,11 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = num_or_stre(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -877,7 +884,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = bool(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil @@ -885,7 +892,7 @@ end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = bool(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil @@ -898,11 +905,11 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -913,12 +920,12 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =~ /^[0-9]/ ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =~ /^[0-9]/ ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -951,13 +958,13 @@ # conf = tk_split_list(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))) conf = tk_split_list(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), 0, false, true) end - conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1] if ( __item_configinfo_struct(tagid(tagOrId))[:alias] \ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 ) if conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?- - conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1] end { conf[0] => conf[1] } @@ -971,7 +978,7 @@ # conf = tk_split_simplelist(conflist) tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false).each{|conflist| conf = tk_split_simplelist(conflist, false, true) - conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:key]] = conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1] optkey = conf[__item_configinfo_struct(tagid(tagOrId))[:key]] @@ -1007,7 +1014,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = number(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil @@ -1015,7 +1022,7 @@ end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = number(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil @@ -1025,11 +1032,11 @@ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -1037,7 +1044,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = bool(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil @@ -1045,7 +1052,7 @@ end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) begin - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = bool(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) rescue conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil @@ -1055,11 +1062,11 @@ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -1067,12 +1074,12 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =~ /^[0-9]/ ) - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =~ /^[0-9]/ ) - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end @@ -1099,19 +1106,19 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] ) if conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]].index('{') - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = - tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) else - conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]) end end if conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] if conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]].index('{') - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = - tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) else - conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]) end end @@ -1120,7 +1127,7 @@ if ( __item_configinfo_struct(tagid(tagOrId))[:alias] \ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 ) if conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?- - conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = + conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1] end ret[conf[0]] = conf[1] @@ -1187,7 +1194,7 @@ end slot = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] end while(org_slot != slot) - fail RuntimeError, + fail RuntimeError, "there is a configure alias loop about '#{org_slot}'" else ret = {} Index: ext/tk/lib/tk/fontchooser.rb =================================================================== --- ext/tk/lib/tk/fontchooser.rb (revision 0) +++ ext/tk/lib/tk/fontchooser.rb (revision 0) @@ -0,0 +1,166 @@ +# +# tk/fontchooser.rb -- "tk fontchooser" support (Tcl/Tk8.6 or later) +# +require 'tk' +require 'tk/font' + +module TkFont::Chooser + extend TkCore +end + +class << TkFont::Chooser + def method_missing(id, *args) + name = id.id2name + case args.length + when 1 + if name[-1] == ?= + configure name[0..-2], args[0] + args[0] + else + configure name, args[0] + self + end + when 0 + begin + cget(name) + rescue + super(id, *args) + end + else + super(id, *args) + end + end + + def __conviginfo_value(key, val) + case key + when 'parent' + window(val) + when 'title' + val + when 'font' + if (lst = tk_split_simplelist(val)).size == 1 + lst[0] + else + lst.map{|elem| num_or_str(elem)} + end + when 'command' + tk_tcl2ruby(val) + when 'visible' + bool(val) + else # unkown + val + end + end + private :__conviginfo_value + + def configinfo(option=nil) + if !option && TkComm::GET_CONFIGINFOwoRES_AS_ARRAY + lst = tk_split_simplelist(tk_call('tk', 'fontchooser', 'configure')) + ret = [] + lst.each_slice(2){|k, v| + k = k[1..-1] + ret << [k, __conviginfo_value(k, v)] + } + ret + else + current_configinfo(option) + end + end + + def current_configinfo(option=nil) + if option + opt = option.to_s + fail ArgumentError, "Invalid option `#{option.inspect}'" if opt.empty? + __conviginfo_value(option.to_s, tk_call('tk','fontchooser', + 'configure',"-#{opt}")) + else + lst = tk_split_simplelist(tk_call('tk', 'fontchooser', 'configure')) + ret = {} + lst.each_slice(2){|k, v| + k = k[1..-1] + ret[k] = __conviginfo_value(k, v) + } + ret + end + end + + def configure(option, value=None) + if option.kind_of? Hash + tk_call('tk', 'fontchooser', 'configure', + *hash_kv(_symbolkey2str(option))) + else + opt = option.to_s + fail ArgumentError, "Invalid option `#{option.inspect}'" if opt.empty? + tk_call('tk', 'fontchooser', 'configure', "-#{opt}", value) + end + self + end + + def configure_cmd(slot, value) + configure(slot, install_cmd(value)) + end + + def command(cmd=nil, &b) + if cmd + configure_cmd('command', cmd) + elsif b + configure_cmd('command', Proc.new(&b)) + else + cget('command') + end + end + + def cget(slot) + configinfo slot + end + + def [](slot) + cget slot + end + + def []=(slot, val) + configure slot, val + val + end + + def show + tk_call('tk', 'fontchooser', 'show') + self + end + + def hide + tk_call('tk', 'fontchooser', 'hide') + self + end + + def toggle + cget(:visible) ? hide: show + self + end + + def set_for(target, title="Font") + if target.kind_of? TkFont + configs = { + :font=>target.actual_hash, + :command=>proc{|fnt, *args| + target.configure(TkFont.actual_hash(fnt)) + } + } + else + configs = { + :font=>target.cget_tkstring(:font), + :command=>proc{|fnt, *args| + target.font = TkFont.actual_hash_displayof(fnt, target) + } + } + end + + configs[:title] = title if title + configure(configs) + target + end + + def unset + configure(:command, nil) + end +end Index: ext/tk/lib/tk/menubar.rb =================================================================== --- ext/tk/lib/tk/menubar.rb (revision 23917) +++ ext/tk/lib/tk/menubar.rb (working copy) @@ -2,7 +2,7 @@ # tk/menubar.rb # # Original version: -# Copyright (C) 1998 maeda shugo. All rights reserved. +# Copyright (C) 1998 maeda shugo. All rights reserved. # This file can be distributed under the terms of the Ruby. # Usage: @@ -52,18 +52,18 @@ # {:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0}, # '---', # ['Check_A', TkVariable.new(true), 6], -# {:type=>'checkbutton', :label=>'Check_B', +# {:type=>'checkbutton', :label=>'Check_B', # :variable=>TkVariable.new, :underline=>6}, # '---', # ['Radio_X', [radio_var, 'x'], 6], # ['Radio_Y', [radio_var, 'y'], 6], # ['Radio_Z', [radio_var, 'z'], 6], # '---', -# ['cascade', [ -# ['sss', proc{p 'sss'}, 0], -# ['ttt', proc{p 'ttt'}, 0], -# ['uuu', proc{p 'uuu'}, 0], -# ['vvv', proc{p 'vvv'}, 0], +# ['cascade', [ +# ['sss', proc{p 'sss'}, 0], +# ['ttt', proc{p 'ttt'}, 0], +# ['uuu', proc{p 'uuu'}, 0], +# ['vvv', proc{p 'vvv'}, 0], # ], 0], # '---', # ['Quit', proc{exit}, 0]], @@ -92,7 +92,7 @@ class TkMenubar'Helvetica'.freeze, + ltn = {'family'=>'Helvetica'.freeze, 'size'=>-12, 'weight'=>'bold'.freeze} #knj = 'k14' #knj = '-misc-fixed-medium-r-normal--14-*-*-*-c-*-jisx0208.1983-0' @@ -102,7 +102,7 @@ platform = Tk::PLATFORM['platform'] case platform when 'unix' - ltn = {'family'=>'Helvetica'.freeze, + ltn = {'family'=>'Helvetica'.freeze, 'size'=>-12, 'weight'=>'bold'.freeze} when 'windows' ltn = {'family'=>'MS Sans Serif'.freeze, 'size'=>8} @@ -211,7 +211,7 @@ end end def TkFont.actual_hash(fnt, option=nil) - Hash[TkFont.actual_hash(fnt, option)] + Hash[TkFont.actual(fnt, option)] end def TkFont.actual_displayof(fnt, win, option=nil) @@ -224,7 +224,7 @@ end end def TkFont.actual_hash_displayof(fnt, option=nil) - Hash[TkFont.actual_hash_displayof(fnt, option)] + Hash[TkFont.actual_displayof(fnt, option)] end def TkFont.configure(fnt, slot, value=None) @@ -294,7 +294,7 @@ end h = Hash[TkFont.metrics(fnt)] - h.keys.each{|k| + h.keys.each{|k| case TkFont::MetricsType[k.to_s] when ?n h[k] = TkComm::num_or_str(h[k]) @@ -331,7 +331,7 @@ end h = Hash[TkFont.metrics_displayof(fnt, win, option)] - h.keys.each{|k| + h.keys.each{|k| case TkFont::MetricsType[k.to_s] when ?n h[k] = TkComm::num_or_str(h[k]) @@ -459,7 +459,7 @@ else begin compound = tk_split_simplelist( - Hash[*tk_split_simplelist(tk_call('font', 'configure', + Hash[*tk_split_simplelist(tk_call('font', 'configure', fnt))].collect{|k,v| [k[1..-1], v] }.assoc('compound')[1]) @@ -473,7 +473,7 @@ TkFont.new(fnt).call_font_configure([path, key], *args) end else - TkFont.new(compound[0], + TkFont.new(compound[0], compound[1]).call_font_configure([path, key], *args) end end @@ -570,7 +570,7 @@ if JAPANIZED_TK tk_call('font', 'create', @latinfont, '-charset', 'iso8859') tk_call('font', 'create', @kanjifont, '-charset', 'jisx0208.1983') - tk_call('font', 'create', @compoundfont, + tk_call('font', 'create', @compoundfont, '-compound', [@latinfont, @kanjifont]) else tk_call('font', 'create', @latinfont) @@ -614,7 +614,7 @@ # compound font check if Tk::TK_VERSION == '8.0' && JAPANIZED_TK begin - compound = tk_split_simplelist(tk_call('font', 'configure', + compound = tk_split_simplelist(tk_call('font', 'configure', ltn, '-compound')) if knj == nil if compound != [] @@ -624,7 +624,7 @@ if compound != [] ltn = compound[0] end - compound = tk_split_simplelist(tk_call('font', 'configure', + compound = tk_split_simplelist(tk_call('font', 'configure', knj, '-compound')) if compound != [] knj = compound[1] @@ -639,7 +639,7 @@ if Tk::TK_VERSION =~ /^4..*/ knj = DEFAULT_KANJI_FONT_NAME else - knj = ltn + knj = ltn end end else @@ -806,7 +806,7 @@ if font[:charset] || font['charset'] tk_call('font', 'create', @latinfont, *hash_kv(font)) else - tk_call('font', 'create', @latinfont, + tk_call('font', 'create', @latinfont, '-charset', 'iso8859', *hash_kv(font)) end elsif font.kind_of? Array @@ -815,7 +815,7 @@ elsif font.kind_of? TkFont tk_call('font', 'create', @latinfont, '-copy', font.latin_font) elsif font - tk_call('font', 'create', @latinfont, '-copy', font, + tk_call('font', 'create', @latinfont, '-copy', font, '-charset', 'iso8859') else tk_call('font', 'create', @latinfont, '-charset', 'iso8859') @@ -851,7 +851,7 @@ if font[:charset] || font['charset'] tk_call('font', 'create', @kanjifont, *hash_kv(font)) else - tk_call('font', 'create', @kanjifont, + tk_call('font', 'create', @kanjifont, '-charset', 'jisx0208.1983', *hash_kv(font)) end elsif font.kind_of? Array @@ -860,7 +860,7 @@ elsif font.kind_of? TkFont tk_call('font', 'create', @kanjifont, '-copy', font.kanji_font_id) elsif font - tk_call('font', 'create', @kanjifont, '-copy', font, + tk_call('font', 'create', @kanjifont, '-copy', font, '-charset', 'jisx0208.1983') else tk_call('font', 'create', @kanjifont, '-charset', 'jisx0208.1983') @@ -922,7 +922,7 @@ @fontslot = {'font'=>@compoundfont} # @fontslot['font'] = @compoundfont begin - tk_call('font', 'create', @compoundfont, + tk_call('font', 'create', @compoundfont, '-compound', [@latinfont, @kanjifont], *hash_kv(keys)) rescue RuntimeError => e if ltn == knj @@ -930,7 +930,7 @@ tk_call('font', 'delete', @latinfont) create_latinfont(DEFAULT_LATIN_FONT_NAME) opts = [] - Hash[*(tk_split_simplelist(tk_call('font', 'configure', + Hash[*(tk_split_simplelist(tk_call('font', 'configure', @kanjifont)))].each{|k,v| case k when '-size', '-weight', '-slant', '-underline', '-overstrike' @@ -938,14 +938,14 @@ end } tk_call('font', 'configure', @latinfont, *opts) - tk_call('font', 'create', @compoundfont, + tk_call('font', 'create', @compoundfont, '-compound', [@latinfont, @kanjifont], *hash_kv(keys)) elsif e.message =~ /ascii font .* specified/ tk_call('font', 'delete', @kanjifont) create_kanjifont(DEFAULT_KANJI_FONT_NAME) opts = [] - Hash[*(tk_split_simplelist(tk_call('font', 'configure', + Hash[*(tk_split_simplelist(tk_call('font', 'configure', @latinfont)))].each{|k,v| case k when '-size', '-weight', '-slant', '-underline', '-overstrike' @@ -953,7 +953,7 @@ end } tk_call('font', 'configure', @kanjifont, *opts) - tk_call('font', 'create', @compoundfont, + tk_call('font', 'create', @compoundfont, '-compound', [@latinfont, @kanjifont], *hash_kv(keys)) else @@ -1392,7 +1392,7 @@ end h = Hash[metrics(option)] - h.keys.each{|k| + h.keys.each{|k| case TkFont::MetricsType[k.to_s] when ?n h[k] = TkComm::num_or_str(h[k]) @@ -1424,7 +1424,7 @@ end h = Hash[metrics_displayof(win, option)] - h.keys.each{|k| + h.keys.each{|k| case TkFont::MetricsType[k.to_s] when ?n h[k] = TkComm::num_or_str(h[k]) @@ -1459,7 +1459,7 @@ end h = Hash[latin_metrics(option)] - h.keys.each{|k| + h.keys.each{|k| case TkFont::MetricsType[k.to_s] when ?n h[k] = TkComm::num_or_str(h[k]) @@ -1495,7 +1495,7 @@ end h = Hash[latin_metrics_displayof(win, option)] - h.keys.each{|k| + h.keys.each{|k| case TkFont::MetricsType[k.to_s] when ?n h[k] = TkComm::num_or_str(h[k]) @@ -1532,7 +1532,7 @@ end h = Hash[kanji_metrics(option)] - h.keys.each{|k| + h.keys.each{|k| case TkFont::MetricsType[k.to_s] when ?n h[k] = TkComm::num_or_str(h[k]) @@ -1570,7 +1570,7 @@ end h = Hash[kanji_metrics_displayof(win, option)] - h.keys.each{|k| + h.keys.each{|k| case TkFont::MetricsType[k.to_s] when ?n h[k] = TkComm::num_or_str(h[k]) @@ -1586,7 +1586,7 @@ def reset_pointadjust begin if /^8\..*/ === Tk::TK_VERSION && JAPANIZED_TK - configure('pointadjust' => latin_actual.assoc('size')[1].to_f / + configure('pointadjust' => latin_actual.assoc('size')[1].to_f / kanji_actual.assoc('size')[1].to_f ) end rescue @@ -1659,8 +1659,8 @@ '' end else - [['family',''], ['size',0], ['weight',''], ['slant',''], - ['underline',false], ['overstrike',false], ['charset',''], + [['family',''], ['size',0], ['weight',''], ['slant',''], + ['underline',false], ['overstrike',false], ['charset',''], ['pointadjust',0]] end end @@ -1672,7 +1672,7 @@ "" elsif option if win - val = tk_call('font', 'actual', font, + val = tk_call('font', 'actual', font, "-displayof", win, "-#{option}") else val = tk_call('font', 'actual', font, "-#{option}") @@ -1687,7 +1687,7 @@ end else l = tk_split_simplelist(if win - tk_call('font', 'actual', font, + tk_call('font', 'actual', font, "-displayof", win) else tk_call('font', 'actual', font) @@ -1733,8 +1733,8 @@ '' end else - [['family',''], ['size',0], ['weight',''], ['slant',''], - ['underline',false], ['overstrike',false], ['charset',''], + [['family',''], ['size',0], ['weight',''], ['slant',''], + ['underline',false], ['overstrike',false], ['charset',''], ['pointadjust',1.0]] end else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY @@ -1753,8 +1753,8 @@ '' end else - {'family'=>'', 'size'=>0, 'weight'=>'', 'slant'=>'', - 'underline'=>false, 'overstrike'=>false, + {'family'=>'', 'size'=>0, 'weight'=>'', 'slant'=>'', + 'underline'=>false, 'overstrike'=>false, 'charset'=>false, 'pointadjust'=>1.0} end end @@ -1775,20 +1775,20 @@ configure_core_tk8x(font, 'family', slot.delete('family')) end - if ((slot.key?('size') || slot.key?(:size)) && + if ((slot.key?('size') || slot.key?(:size)) && padjust && !slot.key?('pointadjust') && !slot.key?(:pointadjust)) - tk_call('font', 'configure', font, + tk_call('font', 'configure', font, '-pointadjust', padjust, *hash_kv(slot)) else tk_call('font', 'configure', font, *hash_kv(slot)) end elsif (slot == 'size' || slot == :size) && padjust != nil - tk_call('font', 'configure', font, + tk_call('font', 'configure', font, "-#{slot}", value, '-pointadjust', padjust) elsif JAPANIZED_TK && (slot == 'family' || slot == :family) # coumpund font? begin - compound = tk_split_simplelist(tk_call('font', 'configure', + compound = tk_split_simplelist(tk_call('font', 'configure', font, '-compound')) rescue tk_call('font', 'configure', font, '-family', value) @@ -1819,7 +1819,7 @@ ensure tk_call('font', 'delete', kfnt) if kfnt != '' end - + else tk_call('font', 'configure', font, "-#{slot}", value) end @@ -2044,7 +2044,7 @@ keys = self.configinfo tk_call('font', 'delete', @compoundfont) begin - tk_call('font', 'create', @compoundfont, + tk_call('font', 'create', @compoundfont, '-compound', [@latinfont, @kanjifont], *hash_kv(keys)) =begin latinkeys = {} @@ -2061,7 +2061,7 @@ tk_call('font', 'delete', @latinfont) if fnt_bup && fnt_bup != '' tk_call('font', 'create', @latinfont, '-copy', fnt_bup) - tk_call('font', 'create', @compoundfont, + tk_call('font', 'create', @compoundfont, '-compound', [@latinfont, @kanjifont], *hash_kv(keys)) tk_call('font', 'delete', fnt_bup) else @@ -2082,7 +2082,7 @@ # not exist? (deleted?) -> create font tk_call('font', 'create', @compoundfont, *hash_kv(latinkeys)) end - end + end self end @@ -2112,20 +2112,20 @@ keys = self.configinfo tk_call('font', 'delete', @compoundfont) begin - tk_call('font', 'create', @compoundfont, + tk_call('font', 'create', @compoundfont, '-compound', [@latinfont, @kanjifont], *hash_kv(keys)) rescue RuntimeError => e tk_call('font', 'delete', @kanjifont) if fnt_bup && fnt_bup != '' tk_call('font', 'create', @kanjifont, '-copy', fnt_bup) - tk_call('font', 'create', @compoundfont, + tk_call('font', 'create', @compoundfont, '-compound', [@latinfont, @kanjifont], *hash_kv(keys)) tk_call('font', 'delete', fnt_bup) else fail e end end - end + end self end @@ -2137,7 +2137,7 @@ font = '{}' if font == '' if win - number(tk_call('font', 'measure', font, + number(tk_call('font', 'measure', font, '-displayof', win, text)) else number(tk_call('font', 'measure', font, text)) @@ -2158,7 +2158,7 @@ if option if win - number(tk_call('font', 'metrics', font, + number(tk_call('font', 'metrics', font, "-displayof", win, "-#{option}")) else number(tk_call('font', 'metrics', font, "-#{option}")) @@ -2199,7 +2199,7 @@ alias measure_core measure_core_tk4x alias metrics_core metrics_core_tk4x - when /^8\.[0-5]/ + when /^8\.[0-9]/ alias actual_core actual_core_tk8x alias configure_core configure_core_tk8x alias configinfo_core configinfo_core_tk8x @@ -2304,12 +2304,12 @@ ####################################### # define system font names ####################################### -if Tk::TCL_MAJOR_VERSION > 8 || +if Tk::TCL_MAJOR_VERSION > 8 || (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5) # add standard fonts of Tcl/Tk 8.5+ TkFont::SYSTEM_FONT_NAMES.add [ - 'TkDefaultFont', 'TkTextFont', 'TkFixedFont', 'TkMenuFont', - 'TkHeadingFont', 'TkCaptionFont', 'TkSmallCaptionFont', + 'TkDefaultFont', 'TkTextFont', 'TkFixedFont', 'TkMenuFont', + 'TkHeadingFont', 'TkCaptionFont', 'TkSmallCaptionFont', 'TkIconFont', 'TkTooltipFont' ] end @@ -2323,22 +2323,29 @@ # -- macintosh, macosx TkFont::SYSTEM_FONT_NAMES.add ['system', 'application'] -if Tk::TCL_MAJOR_VERSION > 8 || +if Tk::TCL_MAJOR_VERSION > 8 || (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5) TkFont::SYSTEM_FONT_NAMES.add ['menu'] end # -- macosx (Aqua theme) -if Tk::TCL_MAJOR_VERSION > 8 || +if Tk::TCL_MAJOR_VERSION > 8 || (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5) TkFont::SYSTEM_FONT_NAMES.add [ - 'systemSystemFont', 'systemEmphasizedSystemFont', - 'systemSmallSystemFont', 'systemSmallEmphasizedSystemFont', - 'systemApplicationFont', 'systemLabelFont', 'systemViewsFont', - 'systemMenuTitleFont', 'systemMenuItemFont', 'systemMenuItemMarkFont', - 'systemMenuItemCmdKeyFont', 'systemWindowTitleFont', - 'systemPushButtonFont', 'systemUtilityWindowTitleFont', - 'systemAlertHeaderFont', 'systemToolbarFont', 'systemMiniSystemFont', + 'systemSystemFont', 'systemEmphasizedSystemFont', + 'systemSmallSystemFont', 'systemSmallEmphasizedSystemFont', + 'systemApplicationFont', 'systemLabelFont', 'systemViewsFont', + 'systemMenuTitleFont', 'systemMenuItemFont', 'systemMenuItemMarkFont', + 'systemMenuItemCmdKeyFont', 'systemWindowTitleFont', + 'systemPushButtonFont', 'systemUtilityWindowTitleFont', + 'systemAlertHeaderFont', 'systemToolbarFont', 'systemMiniSystemFont', 'systemDetailSystemFont', 'systemDetailEmphasizedSystemFont' ] end + +####################################### +# autoload +####################################### +class TkFont + autoload :Chooser, 'tk/fontchooser' +end Index: ext/tk/lib/tk/canvastag.rb =================================================================== --- ext/tk/lib/tk/canvastag.rb (revision 23917) +++ ext/tk/lib/tk/canvastag.rb (working copy) @@ -116,6 +116,13 @@ self end + def imove(idx, x, y) + # Tcl/Tk 8.6 or later + @c.imove(@id, idx, x, y) + self + end + alias i_move imove + def index(idx) @c.index(@id, idx) end @@ -135,6 +142,13 @@ self end + def moveto(x, y) + # Tcl/Tk 8.6 or later + @c.moveto(@id, x, y) + self + end + alias move_to moveto + def raise(abovethis=None) @c.raise(@id, abovethis) self @@ -145,6 +159,14 @@ self end + def rchars(first, last, str_or_coords) + # Tcl/Tk 8.6 or later + @c.rchars(@id, first, last, str_or_coords) + self + end + alias replace_chars rchars + alias replace_coords rchars + def select_adjust(index) @c.select('adjust', @id, index) self @@ -218,7 +240,7 @@ CTagID_TBL.mutex.synchronize{ if CTagID_TBL[cpath] CTagID_TBL[cpath][id]? CTagID_TBL[cpath][id]: id - else + else id end } @@ -414,7 +436,7 @@ include(*args) if args != [] end #private :create_self - + def include(*tags) for i in tags #i.addtag(@id) Index: ext/tk/lib/tk/checkbutton.rb =================================================================== --- ext/tk/lib/tk/checkbutton.rb (revision 23917) +++ ext/tk/lib/tk/checkbutton.rb (working copy) @@ -26,5 +26,7 @@ Tk::Checkbutton = Tk::CheckButton #TkCheckButton = Tk::CheckButton unless Object.const_defined? :TkCheckButton #TkCheckbutton = Tk::Checkbutton unless Object.const_defined? :TkCheckbutton -Tk.__set_toplevel_aliases__(:Tk, Tk::CheckButton, - :TkCheckButton, :TkCheckbutton) +#Tk.__set_toplevel_aliases__(:Tk, Tk::CheckButton, +# :TkCheckButton, :TkCheckbutton) +Tk.__set_loaded_toplevel_aliases__('tk/checkbutton.rb', :Tk, Tk::CheckButton, + :TkCheckButton, :TkCheckbutton) Index: ext/tk/lib/tk/panedwindow.rb =================================================================== --- ext/tk/lib/tk/panedwindow.rb (revision 23917) +++ ext/tk/lib/tk/panedwindow.rb (working copy) @@ -128,10 +128,10 @@ # win = win.epath if win.kind_of?(TkObject) win = _epath(win) if key - #conf = tk_split_list(tk_send_without_enc('paneconfigure', + #conf = tk_split_list(tk_send_without_enc('paneconfigure', # win, "-#{key}")) - conf = tk_split_list(tk_send_without_enc('paneconfigure', - win, "-#{key}"), + conf = tk_split_list(tk_send_without_enc('paneconfigure', + win, "-#{key}"), false, true) conf[0] = conf[0][1..-1] if conf[0] == 'hide' @@ -140,10 +140,10 @@ end conf else - #tk_split_simplelist(tk_send_without_enc('paneconfigure', + #tk_split_simplelist(tk_send_without_enc('paneconfigure', # win)).collect{|conflist| # conf = tk_split_simplelist(conflist) - tk_split_simplelist(tk_send_without_enc('paneconfigure', win), + tk_split_simplelist(tk_send_without_enc('paneconfigure', win), false, false).collect{|conflist| conf = tk_split_simplelist(conflist, false, true) conf[0] = conf[0][1..-1] @@ -151,18 +151,18 @@ if conf[0] == 'hide' conf[3] = bool(conf[3]) unless conf[3].empty? elsif conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf[4] if conf[0] == 'hide' conf[4] = bool(conf[4]) unless conf[4].empty? elsif conf[4].index('{') - conf[4] = tk_split_list(conf[4]) + conf[4] = tk_split_list(conf[4]) else - conf[4] = tk_tcl2ruby(conf[4]) + conf[4] = tk_tcl2ruby(conf[4]) end end conf[1] = conf[1][1..-1] if conf.size == 2 # alias info @@ -173,10 +173,10 @@ # win = win.epath if win.kind_of?(TkObject) win = _epath(win) if key - #conf = tk_split_list(tk_send_without_enc('paneconfigure', + #conf = tk_split_list(tk_send_without_enc('paneconfigure', # win, "-#{key}")) - conf = tk_split_list(tk_send_without_enc('paneconfigure', - win, "-#{key}"), + conf = tk_split_list(tk_send_without_enc('paneconfigure', + win, "-#{key}"), false, true) key = conf.shift[1..-1] if key == 'hide' @@ -186,10 +186,10 @@ { key => conf } else ret = {} - #tk_split_simplelist(tk_send_without_enc('paneconfigure', + #tk_split_simplelist(tk_send_without_enc('paneconfigure', # win)).each{|conflist| # conf = tk_split_simplelist(conflist) - tk_split_simplelist(tk_send_without_enc('paneconfigure', win), + tk_split_simplelist(tk_send_without_enc('paneconfigure', win), false, false).each{|conflist| conf = tk_split_simplelist(conflist, false, true) key = conf.shift[1..-1] @@ -197,18 +197,18 @@ if key == 'hide' conf[2] = bool(conf[2]) unless conf[2].empty? elsif conf[2].index('{') - conf[2] = tk_split_list(conf[2]) + conf[2] = tk_split_list(conf[2]) else - conf[2] = tk_tcl2ruby(conf[2]) + conf[2] = tk_tcl2ruby(conf[2]) end end if conf[3] if key == 'hide' conf[3] = bool(conf[3]) unless conf[3].empty? elsif conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf.size == 1 @@ -254,5 +254,7 @@ Tk::Panedwindow = Tk::PanedWindow #TkPanedWindow = Tk::PanedWindow unless Object.const_defined? :TkPanedWindow #TkPanedwindow = Tk::Panedwindow unless Object.const_defined? :TkPanedwindow -Tk.__set_toplevel_aliases__(:Tk, Tk::PanedWindow, - :TkPanedWindow, :TkPanedwindow) +#Tk.__set_toplevel_aliases__(:Tk, Tk::PanedWindow, +# :TkPanedWindow, :TkPanedwindow) +Tk.__set_loaded_toplevel_aliases__('tk/panedwindow.rb', :Tk, Tk::PanedWindow, + :TkPanedWindow, :TkPanedwindow) Index: ext/tk/lib/tk/texttag.rb =================================================================== --- ext/tk/lib/tk/texttag.rb (revision 23917) +++ ext/tk/lib/tk/texttag.rb (working copy) @@ -26,7 +26,7 @@ TTagID_TBL.mutex.synchronize{ if TTagID_TBL[tpath] TTagID_TBL[tpath][id]? TTagID_TBL[tpath][id]: id - else + else id end } @@ -84,13 +84,13 @@ end def add(*indices) - tk_call_without_enc(@t.path, 'tag', 'add', @id, + tk_call_without_enc(@t.path, 'tag', 'add', @id, *(indices.collect{|idx| _get_eval_enc_str(idx)})) self end def remove(*indices) - tk_call_without_enc(@t.path, 'tag', 'remove', @id, + tk_call_without_enc(@t.path, 'tag', 'remove', @id, *(indices.collect{|idx| _get_eval_enc_str(idx)})) self end @@ -105,16 +105,16 @@ end def nextrange(first, last=None) - simplelist(tk_call_without_enc(@t.path, 'tag', 'nextrange', @id, - _get_eval_enc_str(first), + simplelist(tk_call_without_enc(@t.path, 'tag', 'nextrange', @id, + _get_eval_enc_str(first), _get_eval_enc_str(last))).collect{|idx| Tk::Text::IndexString.new(idx) } end def prevrange(first, last=None) - simplelist(tk_call_without_enc(@t.path, 'tag', 'prevrange', @id, - _get_eval_enc_str(first), + simplelist(tk_call_without_enc(@t.path, 'tag', 'prevrange', @id, + _get_eval_enc_str(first), _get_eval_enc_str(last))).collect{|idx| Tk::Text::IndexString.new(idx) } @@ -142,7 +142,7 @@ _fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget', @id, "-#{key}")) when 'font', 'kanjifont' #fnt = tk_tcl2ruby(tk_call(@t.path, 'tag', 'cget', @id, "-#{key}")) - fnt = tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget', + fnt = tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget', @id, '-font'))) unless fnt.kind_of?(TkFont) fnt = tagfontobj(@id, fnt) @@ -154,7 +154,7 @@ fnt end else - tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget', + tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget', @id, "-#{key}"))) end end @@ -227,13 +227,13 @@ end def raise(above=None) - tk_call_without_enc(@t.path, 'tag', 'raise', @id, + tk_call_without_enc(@t.path, 'tag', 'raise', @id, _get_eval_enc_str(above)) self end def lower(below=None) - tk_call_without_enc(@t.path, 'tag', 'lower', @id, + tk_call_without_enc(@t.path, 'tag', 'lower', @id, _get_eval_enc_str(below)) self end Index: ext/tk/lib/tk/event.rb =================================================================== --- ext/tk/lib/tk/event.rb (revision 23917) +++ ext/tk/lib/tk/event.rb (working copy) @@ -8,7 +8,7 @@ ######################## require 'tkutil' -require 'tk' +require 'tk' unless Object.const_defined? :TkComm ######################## @@ -53,39 +53,39 @@ #-----+-------------------+------------------+-----------------------# # ID | const | group_flag | context_name # #-----+-------------------+------------------+-----------------------# - [ 2, :KeyPress, Grp::KEY, 'KeyPress', 'Key' ], - [ 3, :KeyRelease, Grp::KEY, 'KeyRelease' ], - [ 4, :ButtonPress, Grp::BUTTON, 'ButtonPress', 'Button' ], - [ 5, :ButtonRelease, Grp::BUTTON, 'ButtonRelease' ], - [ 6, :MotionNotify, Grp::MOTION, 'Motion' ], - [ 7, :EnterNotify, Grp::CROSSING, 'Enter' ], - [ 8, :LeaveNotify, Grp::CROSSING, 'Leave' ], - [ 9, :FocusIn, Grp::FOCUS, 'FocusIn' ], - [ 10, :FocusOut, Grp::FOCUS, 'FocusOut' ], - [ 11, :KeymapNotify, 0, ], - [ 12, :Expose, Grp::EXPOSE, 'Expose' ], - [ 13, :GraphicsExpose, Grp::EXPOSE, ], - [ 14, :NoExpose, 0, ], - [ 15, :VisibilityNotify, Grp::VISIBILITY, 'Visibility' ], - [ 16, :CreateNotify, Grp::CREATE, 'Create' ], - [ 17, :DestroyNotify, Grp::DESTROY, 'Destroy' ], - [ 18, :UnmapNotify, Grp::UNMAP, 'Unmap' ], - [ 19, :MapNotify, Grp::MAP, 'Map' ], - [ 20, :MapRequest, Grp::MAPREQ, 'MapRequest' ], - [ 21, :ReparentNotify, Grp::REPARENT, 'Reparent' ], - [ 22, :ConfigureNotify, Grp::CONFIG, 'Configure' ], - [ 23, :ConfigureRequest, Grp::CONFIGREQ, 'ConfigureRequest' ], - [ 24, :GravityNotify, Grp::GRAVITY, 'Gravity' ], - [ 25, :ResizeRequest, Grp::RESIZEREQ, 'ResizeRequest' ], - [ 26, :CirculateNotify, Grp::CIRC, 'Circulate' ], - [ 27, :CirculateRequest, 0, 'CirculateRequest' ], - [ 28, :PropertyNotify, Grp::PROP, 'Property' ], - [ 29, :SelectionClear, 0, ], - [ 30, :SelectionRequest, 0, ], - [ 31, :SelectionNotify, 0, ], - [ 32, :ColormapNotify, Grp::COLORMAP, 'Colormap' ], - [ 33, :ClientMessage, 0, ], - [ 34, :MappingNotify, 0, ], + [ 2, :KeyPress, Grp::KEY, 'KeyPress', 'Key' ], + [ 3, :KeyRelease, Grp::KEY, 'KeyRelease' ], + [ 4, :ButtonPress, Grp::BUTTON, 'ButtonPress', 'Button' ], + [ 5, :ButtonRelease, Grp::BUTTON, 'ButtonRelease' ], + [ 6, :MotionNotify, Grp::MOTION, 'Motion' ], + [ 7, :EnterNotify, Grp::CROSSING, 'Enter' ], + [ 8, :LeaveNotify, Grp::CROSSING, 'Leave' ], + [ 9, :FocusIn, Grp::FOCUS, 'FocusIn' ], + [ 10, :FocusOut, Grp::FOCUS, 'FocusOut' ], + [ 11, :KeymapNotify, 0, ], + [ 12, :Expose, Grp::EXPOSE, 'Expose' ], + [ 13, :GraphicsExpose, Grp::EXPOSE, ], + [ 14, :NoExpose, 0, ], + [ 15, :VisibilityNotify, Grp::VISIBILITY, 'Visibility' ], + [ 16, :CreateNotify, Grp::CREATE, 'Create' ], + [ 17, :DestroyNotify, Grp::DESTROY, 'Destroy' ], + [ 18, :UnmapNotify, Grp::UNMAP, 'Unmap' ], + [ 19, :MapNotify, Grp::MAP, 'Map' ], + [ 20, :MapRequest, Grp::MAPREQ, 'MapRequest' ], + [ 21, :ReparentNotify, Grp::REPARENT, 'Reparent' ], + [ 22, :ConfigureNotify, Grp::CONFIG, 'Configure' ], + [ 23, :ConfigureRequest, Grp::CONFIGREQ, 'ConfigureRequest' ], + [ 24, :GravityNotify, Grp::GRAVITY, 'Gravity' ], + [ 25, :ResizeRequest, Grp::RESIZEREQ, 'ResizeRequest' ], + [ 26, :CirculateNotify, Grp::CIRC, 'Circulate' ], + [ 27, :CirculateRequest, 0, 'CirculateRequest' ], + [ 28, :PropertyNotify, Grp::PROP, 'Property' ], + [ 29, :SelectionClear, 0, ], + [ 30, :SelectionRequest, 0, ], + [ 31, :SelectionNotify, 0, ], + [ 32, :ColormapNotify, Grp::COLORMAP, 'Colormap' ], + [ 33, :ClientMessage, 0, ], + [ 34, :MappingNotify, 0, ], [ 35, :VirtualEvent, Grp::VIRTUAL, ], [ 36, :ActivateNotify, Grp::ACTIVATE, 'Activate' ], [ 37, :DeactivateNotify, Grp::ACTIVATE, 'Deactivate' ], @@ -153,12 +153,12 @@ FIELD_FLAG = { # key => flag - 'above' => Grp::CONFIG, + 'above' => Grp::CONFIG, 'borderwidth' => (Grp::CREATE|Grp::CONFIG), - 'button' => Grp::BUTTON, - 'count' => Grp::EXPOSE, - 'data' => (Grp::VIRTUAL|Grp::STRING_DATA), - 'delta' => Grp::MWHEEL, + 'button' => Grp::BUTTON, + 'count' => Grp::EXPOSE, + 'data' => (Grp::VIRTUAL|Grp::STRING_DATA), + 'delta' => Grp::MWHEEL, 'detail' => (Grp::FOCUS|Grp::CROSSING), 'focus' => Grp::CROSSING, 'height' => (Grp::EXPOSE|Grp::CONFIG), @@ -191,23 +191,23 @@ } FIELD_OPERATION = { - 'root' => proc{|val| + 'root' => proc{|val| begin Tk.tk_call_without_enc('winfo', 'pathname', val) val rescue nil end - }, + }, - 'subwindow' => proc{|val| + 'subwindow' => proc{|val| begin Tk.tk_call_without_enc('winfo', 'pathname', val) val rescue nil end - }, + }, 'window' => proc{|val| nil} } @@ -280,7 +280,7 @@ Tk.event_generate(win, type_name, opts) else # If type is KEY event, focus should be set to target widget. - # If not set, original widget will get the same event. + # If not set, original widget will get the same event. # That will make infinite loop. w = Tk.tk_call_without_enc('focus') begin @@ -296,58 +296,58 @@ # [ <'%' subst-key char>, , ] KEY_TBL = [ - [ ?#, ?n, :serial ], - [ ?a, ?s, :above ], - [ ?b, ?n, :num ], - [ ?c, ?n, :count ], - [ ?d, ?s, :detail ], + [ ?#, ?n, :serial ], + [ ?a, ?s, :above ], + [ ?b, ?n, :num ], + [ ?c, ?n, :count ], + [ ?d, ?s, :detail ], # ?e - [ ?f, ?b, :focus ], + [ ?f, ?b, :focus ], # ?g - [ ?h, ?n, :height ], - [ ?i, ?s, :win_hex ], + [ ?h, ?n, :height ], + [ ?i, ?s, :win_hex ], # ?j - [ ?k, ?n, :keycode ], + [ ?k, ?n, :keycode ], # ?l - [ ?m, ?s, :mode ], + [ ?m, ?s, :mode ], # ?n - [ ?o, ?b, :override ], - [ ?p, ?s, :place ], + [ ?o, ?b, :override ], + [ ?p, ?s, :place ], # ?q # ?r - [ ?s, ?x, :state ], - [ ?t, ?n, :time ], + [ ?s, ?x, :state ], + [ ?t, ?n, :time ], # ?u - [ ?v, ?n, :value_mask ], - [ ?w, ?n, :width ], - [ ?x, ?n, :x ], - [ ?y, ?n, :y ], + [ ?v, ?n, :value_mask ], + [ ?w, ?n, :width ], + [ ?x, ?n, :x ], + [ ?y, ?n, :y ], # ?z - [ ?A, ?s, :char ], - [ ?B, ?n, :borderwidth ], + [ ?A, ?s, :char ], + [ ?B, ?n, :borderwidth ], # ?C - [ ?D, ?n, :wheel_delta ], - [ ?E, ?b, :send_event ], + [ ?D, ?n, :wheel_delta ], + [ ?E, ?b, :send_event ], # ?F # ?G # ?H # ?I # ?J - [ ?K, ?s, :keysym ], + [ ?K, ?s, :keysym ], # ?L # ?M - [ ?N, ?n, :keysym_num ], + [ ?N, ?n, :keysym_num ], # ?O - [ ?P, ?s, :property ], + [ ?P, ?s, :property ], # ?Q - [ ?R, ?s, :rootwin_id ], - [ ?S, ?s, :subwindow ], - [ ?T, ?n, :type ], + [ ?R, ?s, :rootwin_id ], + [ ?S, ?s, :subwindow ], + [ ?T, ?n, :type ], # ?U # ?V - [ ?W, ?w, :widget ], - [ ?X, ?n, :x_root ], - [ ?Y, ?n, :y_root ], + [ ?W, ?w, :widget ], + [ ?X, ?n, :x_root ], + [ ?Y, ?n, :y_root ], # ?Z nil ] @@ -356,16 +356,16 @@ # the subst-key string will be converted to a bytecode (128+idx). LONGKEY_TBL = [ # for example, for %CTT and %CST subst-key on tkdnd-2.0 - # ['CTT', ?l, :drop_target_type], - # ['CST', ?l, :drop_source_type], + # ['CTT', ?l, :drop_target_type], + # ['CST', ?l, :drop_source_type], ] # [ , ] PROC_TBL = [ - [ ?n, TkComm.method(:num_or_str) ], - [ ?s, TkComm.method(:string) ], - [ ?b, TkComm.method(:bool) ], - [ ?w, TkComm.method(:window) ], + [ ?n, TkComm.method(:num_or_str) ], + [ ?s, TkComm.method(:string) ], + [ ?b, TkComm.method(:bool) ], + [ ?w, TkComm.method(:window) ], [ ?x, proc{|val| begin @@ -374,7 +374,7 @@ val end } - ], + ], nil ] @@ -399,25 +399,25 @@ # setup tables to be used by scan_args, _get_subst_key, _get_all_subst_keys # - # _get_subst_key() and _get_all_subst_keys() generates key-string - # which describe how to convert callback arguments to ruby objects. - # When binding parameters are given, use _get_subst_key(). - # But when no parameters are given, use _get_all_subst_keys() to - # create a Event class object as a callback parameter. + # _get_subst_key() and _get_all_subst_keys() generates key-string + # which describe how to convert callback arguments to ruby objects. + # When binding parameters are given, use _get_subst_key(). + # But when no parameters are given, use _get_all_subst_keys() to + # create a Event class object as a callback parameter. # - # scan_args() is used when doing callback. It convert arguments - # ( which are Tcl strings ) to ruby objects based on the key string - # that is generated by _get_subst_key() or _get_all_subst_keys(). + # scan_args() is used when doing callback. It convert arguments + # ( which are Tcl strings ) to ruby objects based on the key string + # that is generated by _get_subst_key() or _get_all_subst_keys(). # _setup_subst_table(KEY_TBL, PROC_TBL) # _setup_subst_table(KEY_TBL, LONGKEY_TBL, PROC_TBL) # if use longname-keys # - # NOTE: The order of parameters which passed to callback procedure is + # NOTE: The order of parameters which passed to callback procedure is # , , ... , , , ... # - # If you need support extra arguments given by Tcl/Tk, + # If you need support extra arguments given by Tcl/Tk, # please override _get_extra_args_tbl # #def self._get_extra_args_tbl @@ -436,15 +436,15 @@ alias sendevent send_event =end ALIAS_TBL = { - :button => :num, - :data => :detail, - :delta => :wheel_delta, - :root => :rootwin_id, - :rootx => :x_root, - :root_x => :x_root, - :rooty => :y_root, - :root_y => :y_root, - :sendevent => :send_event, + :button => :num, + :data => :detail, + :delta => :wheel_delta, + :root => :rootwin_id, + :rootx => :x_root, + :root_x => :x_root, + :rooty => :y_root, + :root_y => :y_root, + :sendevent => :send_event, :window => :widget } Index: ext/tk/lib/tk/image.rb =================================================================== --- ext/tk/lib/tk/image.rb (revision 23917) +++ ext/tk/lib/tk/image.rb (working copy) @@ -45,7 +45,7 @@ keys.delete('imagename') keys.delete('without_creating') obj.instance_eval{ - tk_call_without_enc('image', 'create', + tk_call_without_enc('image', 'create', @type, @path, *hash_kv(keys, true)) } end @@ -78,7 +78,7 @@ } end unless without_creating - tk_call_without_enc('image', 'create', + tk_call_without_enc('image', 'create', @type, @path, *hash_kv(keys, true)) end end Index: ext/tk/lib/tk/root.rb =================================================================== --- ext/tk/lib/tk/root.rb (revision 23917) +++ ext/tk/lib/tk/root.rb (working copy) @@ -16,7 +16,7 @@ def Root.new(keys=nil, &b) unless TkCore::INTERP.tk_windows['.'] - TkCore::INTERP.tk_windows['.'] = + TkCore::INTERP.tk_windows['.'] = super(:without_creating=>true, :widgetname=>'.'){} end root = TkCore::INTERP.tk_windows['.'] @@ -70,8 +70,8 @@ def add_menu(menu_info, tearoff=false, opts=nil) # See tk/menuspec.rb for menu_info. - # opts is a hash of default configs for all of cascade menus. - # Configs of menu_info can override it. + # opts is a hash of default configs for all of cascade menus. + # Configs of menu_info can override it. if tearoff.kind_of?(Hash) opts = tearoff tearoff = false @@ -82,7 +82,7 @@ def add_menubar(menu_spec, tearoff=false, opts=nil) # See tk/menuspec.rb for menu_spec. # opts is a hash of default configs for all of cascade menus. - # Configs of menu_spec can override it. + # Configs of menu_spec can override it. menu_spec.each{|info| add_menu(info, tearoff, opts)} self.menu end Index: ext/tk/lib/tk/grid.rb =================================================================== --- ext/tk/lib/tk/grid.rb (revision 23917) +++ ext/tk/lib/tk/grid.rb (working copy) @@ -101,7 +101,7 @@ def columnconfigure(master, index, args) # master = master.epath if master.kind_of?(TkObject) master = _epath(master) - tk_call_without_enc("grid", 'columnconfigure', + tk_call_without_enc("grid", 'columnconfigure', master, index, *hash_kv(args)) end alias column columnconfigure @@ -119,15 +119,15 @@ if slot case slot when 'uniform', :uniform - tk_call_without_enc('grid', 'columnconfigure', + tk_call_without_enc('grid', 'columnconfigure', master, index, "-#{slot}") else - num_or_str(tk_call_without_enc('grid', 'columnconfigure', + num_or_str(tk_call_without_enc('grid', 'columnconfigure', master, index, "-#{slot}")) end else #ilist = list(tk_call_without_enc('grid','columnconfigure',master,index)) - ilist = simplelist(tk_call_without_enc('grid', 'columnconfigure', + ilist = simplelist(tk_call_without_enc('grid', 'columnconfigure', master, index)) info = {} while key = ilist.shift @@ -148,15 +148,15 @@ if slot case slot when 'uniform', :uniform - tk_call_without_enc('grid', 'rowconfigure', + tk_call_without_enc('grid', 'rowconfigure', master, index, "-#{slot}") else - num_or_str(tk_call_without_enc('grid', 'rowconfigure', + num_or_str(tk_call_without_enc('grid', 'rowconfigure', master, index, "-#{slot}")) end else #ilist = list(tk_call_without_enc('grid', 'rowconfigure', master, index)) - ilist = simplelist(tk_call_without_enc('grid', 'rowconfigure', + ilist = simplelist(tk_call_without_enc('grid', 'rowconfigure', master, index)) info = {} while key = ilist.shift Index: ext/tk/lib/tk/selection.rb =================================================================== --- ext/tk/lib/tk/selection.rb (revision 23917) +++ ext/tk/lib/tk/selection.rb (working copy) @@ -18,7 +18,7 @@ end def self.clear_on_display(win, sel=nil) if sel - tk_call_without_enc('selection', 'clear', + tk_call_without_enc('selection', 'clear', '-displayof', win, '-selection', sel) else tk_call_without_enc('selection', 'clear', '-displayof', win) @@ -35,7 +35,7 @@ end def self.get_on_display(win, keys=nil) #tk_call('selection', 'get', '-displayof', win, *hash_kv(keys)) - _fromUTF8(tk_call_without_enc('selection', 'get', '-displayof', + _fromUTF8(tk_call_without_enc('selection', 'get', '-displayof', win, *hash_kv(keys))) end def get(keys=nil) @@ -65,7 +65,7 @@ end def self.get_owner_on_display(win, sel=nil) if sel - window(tk_call_without_enc('selection', 'own', + window(tk_call_without_enc('selection', 'own', '-displayof', win, '-selection', sel)) else window(tk_call_without_enc('selection', 'own', '-displayof', win)) Index: ext/tk/lib/tk/variable.rb =================================================================== --- ext/tk/lib/tk/variable.rb (revision 23917) +++ ext/tk/lib/tk/variable.rb (working copy) @@ -26,10 +26,10 @@ TkVar_ID_TBL.mutex.synchronize{ TkVar_ID_TBL.clear } } - major, minor, type, type_name, patchlevel = TclTkLib.get_version + major, minor, type, patchlevel = TclTkLib.get_version USE_OLD_TRACE_OPTION_STYLE = (major < 8) || (major == 8 && minor < 4) - #TkCore::INTERP.add_tk_procs('rb_var', 'args', + #TkCore::INTERP.add_tk_procs('rb_var', 'args', # "ruby [format \"TkVariable.callback %%Q!%s!\" $args]") TkCore::INTERP.add_tk_procs('rb_var', 'args', <<-'EOL') if {[set st [catch {eval {ruby_cmd TkVariable callback} $args} ret]] != 0} { @@ -65,10 +65,10 @@ exit!(1) rescue Exception => e begin - msg = _toUTF8(e.class.inspect) + ': ' + - _toUTF8(e.message) + "\n" + - "\n---< backtrace of Ruby side >-----\n" + - _toUTF8(e.backtrace.join("\n")) + + msg = _toUTF8(e.class.inspect) + ': ' + + _toUTF8(e.message) + "\n" + + "\n---< backtrace of Ruby side >-----\n" + + _toUTF8(e.backtrace.join("\n")) + "\n---< backtrace of Tk side >-------" if TkCore::WITH_ENCODING msg.force_encoding('utf-8') @@ -76,9 +76,9 @@ msg.instance_variable_set(:@encoding, 'utf-8') end rescue Exception - msg = e.class.inspect + ': ' + e.message + "\n" + - "\n---< backtrace of Ruby side >-----\n" + - e.backtrace.join("\n") + + msg = e.class.inspect + ': ' + e.message + "\n" + + "\n---< backtrace of Ruby side >-----\n" + + e.backtrace.join("\n") + "\n---< backtrace of Tk side >-------" end fail(e, msg) @@ -94,7 +94,7 @@ _get_eval_string(TkVar_CB_TBL[name1].trace_callback(name2,op)) rescue trace = $!.backtrace - raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" + + raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" + "\tfrom #{trace[1..pos].join("\n\tfrom ")}" end =end @@ -112,7 +112,7 @@ end # - # default_value is available only when the variable is an assoc array. + # default_value is available only when the variable is an assoc array. # def default_value(val=nil, &b) if b @@ -322,7 +322,7 @@ =begin if val == [] - # INTERP._eval(format('global %s; set %s(0) 0; unset %s(0)', + # INTERP._eval(format('global %s; set %s(0) 0; unset %s(0)', # @id, @id, @id)) elsif val.kind_of?(Array) a = [] @@ -370,7 +370,7 @@ else INTERP._thread_vwait(@id) end - else + else if check_root INTERP._invoke_without_enc('tkwait', 'variable', @id) else @@ -421,7 +421,7 @@ else # array index = elems.collect{|idx| _get_eval_string(idx, true)}.join(',') - TkComm.bool(tk_call('info', 'exist', "#{@id}")) && + TkComm.bool(tk_call('info', 'exist', "#{@id}")) && TkComm.bool(tk_call('info', 'exist', "#{@id}(#{index})")) end end @@ -433,7 +433,7 @@ #tk_split_simplelist(INTERP._eval("global #{@id}; array get #{@id}")) INTERP._invoke_without_enc('global', @id) #tk_split_simplelist(INTERP._fromUTF8(INTERP._invoke_without_enc('array', 'names', @id))) - tk_split_simplelist(INTERP._invoke_without_enc('array', 'names', @id), + tk_split_simplelist(INTERP._invoke_without_enc('array', 'names', @id), false, true) end @@ -484,9 +484,9 @@ if val.kind_of?(Hash) self.clear val.each{|k, v| - #INTERP._set_global_var2(@id, _toUTF8(_get_eval_string(k)), + #INTERP._set_global_var2(@id, _toUTF8(_get_eval_string(k)), # _toUTF8(_get_eval_string(v))) - INTERP._set_global_var2(@id, _get_eval_string(k, true), + INTERP._set_global_var2(@id, _get_eval_string(k, true), _get_eval_string(v, true)) } self.value @@ -494,11 +494,11 @@ =begin INTERP._set_global_var(@id, '') val.each{|v| - #INTERP._set_variable(@id, _toUTF8(_get_eval_string(v)), - INTERP._set_variable(@id, _get_eval_string(v, true), - TclTkLib::VarAccessFlag::GLOBAL_ONLY | + #INTERP._set_variable(@id, _toUTF8(_get_eval_string(v)), + INTERP._set_variable(@id, _get_eval_string(v, true), + TclTkLib::VarAccessFlag::GLOBAL_ONLY | TclTkLib::VarAccessFlag::LEAVE_ERR_MSG | - TclTkLib::VarAccessFlag::APPEND_VALUE | + TclTkLib::VarAccessFlag::APPEND_VALUE | TclTkLib::VarAccessFlag::LIST_ELEMENT) } self.value @@ -535,9 +535,9 @@ val = val._value if !type && type != :variable && val.kind_of?(TkVariable) index = args.collect{|idx| _get_eval_string(idx, true)}.join(',') _fromUTF8(INTERP._set_global_var2(@id, index, _get_eval_string(val, true))) - #_fromUTF8(INTERP._set_global_var2(@id, _toUTF8(_get_eval_string(index)), + #_fromUTF8(INTERP._set_global_var2(@id, _toUTF8(_get_eval_string(index)), # _toUTF8(_get_eval_string(val)))) - #_fromUTF8(INTERP._set_global_var2(@id, _get_eval_string(index, true), + #_fromUTF8(INTERP._set_global_var2(@id, _get_eval_string(index, true), # _get_eval_string(val, true))) end @@ -562,7 +562,7 @@ #INTERP._eval(Kernel.format('set %s', @id)) #INTERP._invoke_without_enc('set', @id) rescue - if INTERP._eval(Kernel.format('global %s; array exists %s', + if INTERP._eval(Kernel.format('global %s; array exists %s', @id, @id)) != "1" #if INTERP._eval(Kernel.format('array exists %s', @id)) != "1" #if INTERP._invoke_without_enc('array', 'exists', @id) != "1" @@ -583,7 +583,7 @@ #INTERP._eval(Kernel.format('set %s %s', @id, s)) #_fromUTF8(INTERP._invoke_without_enc('set', @id, _toUTF8(s))) rescue - if INTERP._eval(Kernel.format('global %s; array exists %s', + if INTERP._eval(Kernel.format('global %s; array exists %s', @id, @id)) != "1" #if INTERP._eval(Kernel.format('array exists %s', @id)) != "1" #if INTERP._invoke_without_enc('array', 'exists', @id) != "1" @@ -591,7 +591,7 @@ else if val == [] INTERP._eval(Kernel.format('global %s; unset %s; set %s(0) 0; unset %s(0)', @id, @id, @id, @id)) - #INTERP._eval(Kernel.format('unset %s; set %s(0) 0; unset %s(0)', + #INTERP._eval(Kernel.format('unset %s; set %s(0) 0; unset %s(0)', # @id, @id, @id)) #INTERP._invoke_without_enc('unset', @id) #INTERP._invoke_without_enc('set', @id+'(0)', 0) @@ -601,9 +601,9 @@ val.each_with_index{|e,i| a.push(i); a.push(array2tk_list(e, true))} #s = '"' + a.join(" ").gsub(/[\[\]$"]/, '\\\\\&') + '"' s = '"' + a.join(" ").gsub(/[\[\]$"\\]/, '\\\\\&') + '"' - INTERP._eval(Kernel.format('global %s; unset %s; array set %s %s', + INTERP._eval(Kernel.format('global %s; unset %s; array set %s %s', @id, @id, @id, s)) - #INTERP._eval(Kernel.format('unset %s; array set %s %s', + #INTERP._eval(Kernel.format('unset %s; array set %s %s', # @id, @id, s)) #INTERP._invoke_without_enc('unset', @id) #_fromUTF8(INTERP._invoke_without_enc('array','set', @id, _toUTF8(s))) @@ -612,9 +612,9 @@ # .gsub(/[\[\]$"]/, '\\\\\&') + '"' s = '"' + val.to_a.collect{|e| array2tk_list(e, true)}.join(" ")\ .gsub(/[\[\]$\\"]/, '\\\\\&') + '"' - INTERP._eval(Kernel.format('global %s; unset %s; array set %s %s', + INTERP._eval(Kernel.format('global %s; unset %s; array set %s %s', @id, @id, @id, s)) - #INTERP._eval(Kernel.format('unset %s; array set %s %s', + #INTERP._eval(Kernel.format('unset %s; array set %s %s', # @id, @id, s)) #INTERP._invoke_without_enc('unset', @id) #_fromUTF8(INTERP._invoke_without_enc('array','set', @id, _toUTF8(s))) @@ -640,7 +640,7 @@ end end #INTERP._eval(Kernel.format('global %s; set %s(%s)', @id, @id, index)) - #INTERP._eval(Kernel.format('global %s; set %s(%s)', + #INTERP._eval(Kernel.format('global %s; set %s(%s)', # @id, @id, _get_eval_string(index))) #INTERP._eval(Kernel.format('set %s(%s)', @id, _get_eval_string(index))) #INTERP._eval('set ' + @id + '(' + _get_eval_string(index) + ')') @@ -651,13 +651,13 @@ type = default_element_value_type(args) val = val._value if !type && type != :variable && val.kind_of?(TkVariable) index = args.collect{|idx| _get_eval_string(idx)}.join(',') - INTERP._eval(Kernel.format('global %s; set %s(%s) %s', @id, @id, + INTERP._eval(Kernel.format('global %s; set %s(%s) %s', @id, @id, index, _get_eval_string(val))) - #INTERP._eval(Kernel.format('global %s; set %s(%s) %s', @id, @id, + #INTERP._eval(Kernel.format('global %s; set %s(%s) %s', @id, @id, # _get_eval_string(index), _get_eval_string(val))) - #INTERP._eval(Kernel.format('set %s(%s) %s', @id, + #INTERP._eval(Kernel.format('set %s(%s) %s', @id, # _get_eval_string(index), _get_eval_string(val))) - #INTERP._eval('set ' + @id + '(' + _get_eval_string(index) + ') ' + + #INTERP._eval('set ' + @id + '(' + _get_eval_string(index) + ') ' + # _get_eval_string(val)) end @@ -669,7 +669,7 @@ else index = elems.collect{|idx| _get_eval_string(idx, true)}.join(',') INTERP._eval(Kernel.format('global %s; unset %s(%s)', @id, @id, index)) - #INTERP._eval(Kernel.format('global %s; unset %s(%s)', + #INTERP._eval(Kernel.format('global %s; unset %s(%s)', # @id, @id, _get_eval_string(elem))) #INTERP._eval(Kernel.format('unset %s(%s)', @id, tk_tcl2ruby(elem))) #INTERP._eval('unset ' + @id + '(' + _get_eval_string(elem) + ')') @@ -1348,10 +1348,10 @@ TkVar_CB_TBL[@id] = self @trace_opts = opts if USE_OLD_TRACE_OPTION_STYLE - Tk.tk_call_without_enc('trace', 'variable', + Tk.tk_call_without_enc('trace', 'variable', @id, @trace_opts, 'rb_var ' << @id) else - Tk.tk_call_without_enc('trace', 'add', 'variable', + Tk.tk_call_without_enc('trace', 'add', 'variable', @id, @trace_opts, 'rb_var ' << @id) end else @@ -1359,19 +1359,19 @@ if USE_OLD_TRACE_OPTION_STYLE opts.each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)} if newopts != @trace_opts - Tk.tk_call_without_enc('trace', 'vdelete', + Tk.tk_call_without_enc('trace', 'vdelete', @id, @trace_opts, 'rb_var ' << @id) @trace_opts.replace(newopts) - Tk.tk_call_without_enc('trace', 'variable', + Tk.tk_call_without_enc('trace', 'variable', @id, @trace_opts, 'rb_var ' << @id) end else newopts |= opts unless (newopts - @trace_opts).empty? - Tk.tk_call_without_enc('trace', 'remove', 'variable', + Tk.tk_call_without_enc('trace', 'remove', 'variable', @id, @trace_opts, 'rb_var ' << @id) @trace_opts.replace(newopts) - Tk.tk_call_without_enc('trace', 'add', 'variable', + Tk.tk_call_without_enc('trace', 'add', 'variable', @id, @trace_opts, 'rb_var ' << @id) end end @@ -1382,7 +1382,7 @@ def trace_element(elem, opts, cmd = Proc.new) if @elem - fail(RuntimeError, + fail(RuntimeError, "invalid for a TkVariable which denotes an element of Tcl's array") end @@ -1394,10 +1394,10 @@ TkVar_CB_TBL[@id] = self @trace_opts = opts if USE_OLD_TRACE_OPTION_STYLE - Tk.tk_call_without_enc('trace', 'add', 'variable', + Tk.tk_call_without_enc('trace', 'add', 'variable', @id, @trace_opts, 'rb_var ' << @id) else - Tk.tk_call_without_enc('trace', 'variable', + Tk.tk_call_without_enc('trace', 'variable', @id, @trace_opts, 'rb_var ' << @id) end else @@ -1405,19 +1405,19 @@ if USE_OLD_TRACE_OPTION_STYLE opts.each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)} if newopts != @trace_opts - Tk.tk_call_without_enc('trace', 'vdelete', + Tk.tk_call_without_enc('trace', 'vdelete', @id, @trace_opts, 'rb_var ' << @id) @trace_opts.replace(newopts) - Tk.tk_call_without_enc('trace', 'variable', + Tk.tk_call_without_enc('trace', 'variable', @id, @trace_opts, 'rb_var ' << @id) end else newopts |= opts unless (newopts - @trace_opts).empty? - Tk.tk_call_without_enc('trace', 'remove', 'variable', + Tk.tk_call_without_enc('trace', 'remove', 'variable', @id, @trace_opts, 'rb_var ' << @id) @trace_opts.replace(newopts) - Tk.tk_call_without_enc('trace', 'add', 'variable', + Tk.tk_call_without_enc('trace', 'add', 'variable', @id, @trace_opts, 'rb_var ' << @id) end end @@ -1434,7 +1434,7 @@ def trace_info_for_element(elem) if @elem - fail(RuntimeError, + fail(RuntimeError, "invalid for a TkVariable which denotes an element of Tcl's array") end return [] unless @trace_elem @@ -1468,7 +1468,7 @@ else newopts = [] @trace_var.each_with_index{|e, i| - if idx < 0 && e[1] == cmd && + if idx < 0 && e[1] == cmd && e[0].size == opts.size && (e[0] - opts).empty? # find idx = i @@ -1479,7 +1479,7 @@ end if idx >= 0 - @trace_var.delete_at(idx) + @trace_var.delete_at(idx) else return self end @@ -1498,21 +1498,21 @@ diff = false @trace_opts.each_byte{|c| break if (diff = ! newopts.index(c))} if diff - Tk.tk_call_without_enc('trace', 'vdelete', + Tk.tk_call_without_enc('trace', 'vdelete', @id, @trace_opts, 'rb_var ' << @id) @trace_opts.replace(newopts) unless @trace_opts.empty? - Tk.tk_call_without_enc('trace', 'variable', + Tk.tk_call_without_enc('trace', 'variable', @id, @trace_opts, 'rb_var ' << @id) end end else unless (@trace_opts - newopts).empty? - Tk.tk_call_without_enc('trace', 'remove', 'variable', + Tk.tk_call_without_enc('trace', 'remove', 'variable', @id, @trace_opts, 'rb_var ' << @id) @trace_opts.replace(newopts) unless @trace_opts.empty? - Tk.tk_call_without_enc('trace', 'add', 'variable', + Tk.tk_call_without_enc('trace', 'add', 'variable', @id, @trace_opts, 'rb_var ' << @id) end end @@ -1525,7 +1525,7 @@ def trace_remove_for_element(elem,opts,cmd) if @elem - fail(RuntimeError, + fail(RuntimeError, "invalid for a TkVariable which denotes an element of Tcl's array") end return self unless @trace_elem.kind_of? Hash @@ -1550,7 +1550,7 @@ } else @trace_elem[elem].each_with_index{|e, i| - if idx < 0 && e[1] == cmd && + if idx < 0 && e[1] == cmd && e[0].size == opts.size && (e[0] - opts).empty? # find idx = i @@ -1567,7 +1567,7 @@ if USE_OLD_TRACE_OPTION_STYLE newopts = '' - @trace_var.each{|e| + @trace_var.each{|e| e[0].each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)} } @trace_elem.each{|elem| @@ -1591,21 +1591,21 @@ diff = false @trace_opts.each_byte{|c| break if (diff = ! newopts.index(c))} if diff - Tk.tk_call_without_enc('trace', 'vdelete', + Tk.tk_call_without_enc('trace', 'vdelete', @id, @trace_opts, 'rb_var ' << @id) @trace_opts.replace(newopts) unless @trace_opts.empty? - Tk.tk_call_without_enc('trace', 'variable', + Tk.tk_call_without_enc('trace', 'variable', @id, @trace_opts, 'rb_var ' << @id) end end else unless (@trace_opts - newopts).empty? - Tk.tk_call_without_enc('trace', 'remove', 'variable', + Tk.tk_call_without_enc('trace', 'remove', 'variable', @id, @trace_opts, 'rb_var ' << @id) @trace_opts.replace(newopts) unless @trace_opts.empty? - Tk.tk_call_without_enc('trace', 'add', 'variable', + Tk.tk_call_without_enc('trace', 'add', 'variable', @id, @trace_opts, 'rb_var ' << @id) end end @@ -1621,7 +1621,7 @@ def self.new(name, *args) if name.kind_of?(TkVariable) name.value = args[0] unless args.empty? - return name + return name end name = name.to_s @@ -1649,7 +1649,7 @@ fail ArgumentError, "already exist as a scalar variable" end name.value = args[0] unless args.empty? - return name + return name end name = name.to_s Index: ext/tk/lib/tk/virtevent.rb =================================================================== --- ext/tk/lib/tk/virtevent.rb (revision 23917) +++ ext/tk/lib/tk/virtevent.rb (working copy) @@ -80,8 +80,8 @@ def _add_sequences(seq_ary) unless seq_ary.empty? - tk_call_without_enc('event', 'add', "<#{@id}>", - *(seq_ary.collect{|seq| + tk_call_without_enc('event', 'add', "<#{@id}>", + *(seq_ary.collect{|seq| "<#{tk_event_sequence(seq)}>" }) ) end @@ -106,8 +106,8 @@ TkVirtualEventTBL.delete(@id) } else - tk_call_without_enc('event', 'delete', "<#{@id}>", - *(sequences.collect{|seq| + tk_call_without_enc('event', 'delete', "<#{@id}>", + *(sequences.collect{|seq| "<#{tk_event_sequence(seq)}>" }) ) if tk_call_without_enc('event','info',"<#{@id}>").empty? Index: ext/tk/lib/tk/textimage.rb =================================================================== --- ext/tk/lib/tk/textimage.rb (revision 23917) +++ ext/tk/lib/tk/textimage.rb (working copy) @@ -16,19 +16,19 @@ @path = TkTextMark.new(@t, tk_call(@t.path, 'index', 'end - 1 chars')) elsif index.kind_of? TkTextMark if tk_call_without_enc(@t.path,'index',index.path) == tk_call_without_enc(@t.path,'index','end') - @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index', + @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index', 'end - 1 chars')) else - @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index', + @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index', index.path)) end else - @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index', + @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index', _get_eval_enc_str(index))) end @path.gravity = 'left' @index = @path.path - @id = tk_call_without_enc(@t.path, 'image', 'create', @index, + @id = tk_call_without_enc(@t.path, 'image', 'create', @index, *hash_kv(keys, true)).freeze @path.gravity = 'right' end @@ -78,7 +78,7 @@ end def image=(value) - tk_call_without_enc(@t.path, 'image', 'configure', @index, '-image', + tk_call_without_enc(@t.path, 'image', 'configure', @index, '-image', _get_eval_enc_str(value)) #self value Index: ext/tk/lib/tk/radiobutton.rb =================================================================== --- ext/tk/lib/tk/radiobutton.rb (revision 23917) +++ ext/tk/lib/tk/radiobutton.rb (working copy) @@ -67,5 +67,7 @@ Tk::Radiobutton = Tk::RadioButton #TkRadioButton = Tk::RadioButton unless Object.const_defined? :TkRadioButton #TkRadiobutton = Tk::Radiobutton unless Object.const_defined? :TkRadiobutton -Tk.__set_toplevel_aliases__(:Tk, Tk::RadioButton, - :TkRadioButton, :TkRadiobutton) +#Tk.__set_toplevel_aliases__(:Tk, Tk::RadioButton, +# :TkRadioButton, :TkRadiobutton) +Tk.__set_loaded_toplevel_aliases__('tk/radiobutton.rb', :Tk, Tk::RadioButton, + :TkRadioButton, :TkRadiobutton) Index: ext/tk/lib/tk/xim.rb =================================================================== --- ext/tk/lib/tk/xim.rb (revision 23917) +++ ext/tk/lib/tk/xim.rb (working copy) @@ -12,14 +12,14 @@ def TkXIM.useinputmethods(value = None, win = nil) if value == None if win - bool(tk_call_without_enc('tk', 'useinputmethods', + bool(tk_call_without_enc('tk', 'useinputmethods', '-displayof', win)) else bool(tk_call_without_enc('tk', 'useinputmethods')) end else if win - bool(tk_call_without_enc('tk', 'useinputmethods', + bool(tk_call_without_enc('tk', 'useinputmethods', '-displayof', win, value)) else bool(tk_call_without_enc('tk', 'useinputmethods', value)) Index: ext/tk/lib/tk/dialog.rb =================================================================== --- ext/tk/lib/tk/dialog.rb (revision 23917) +++ ext/tk/lib/tk/dialog.rb (working copy) @@ -18,11 +18,11 @@ def _set_button_config(configs) set_config = proc{|c,i| if $VERBOSE && (c.has_key?('command') || c.has_key?(:command)) - STDERR.print("Warning: cannot give a command option " + + STDERR.print("Warning: cannot give a command option " + "to the dialog button#{i}. It was removed.\n") end c.delete('command'); c.delete(:command) - # @config << Kernel.format("%s.button%s configure %s; ", + # @config << Kernel.format("%s.button%s configure %s; ", # @path, i, hash_kv(c).join(' ')) # @config << @path+'.button'+i.to_s+' configure '+hash_kv(c).join(' ')+'; ' @config << @path+'.button'+i.to_s+' configure '+ @@ -103,7 +103,7 @@ #end if @buttons.kind_of?(Array) - _set_button_config(@buttons.collect{|cfg| + _set_button_config(@buttons.collect{|cfg| (cfg.kind_of? Array)? cfg[1]: nil}) @buttons = @buttons.collect{|cfg| (cfg.kind_of? Array)? cfg[0]: cfg} end @@ -127,7 +127,7 @@ =end if @message_config.kind_of?(Hash) - # @config << Kernel.format("%s.msg configure %s;", + # @config << Kernel.format("%s.msg configure %s;", # @path, hash_kv(@message_config).join(' ')) # @config << @path+'.msg configure '+hash_kv(@message_config).join(' ')+';' @config << @path+'.msg configure '+ @@ -135,7 +135,7 @@ end if @msgframe_config.kind_of?(Hash) - # @config << Kernel.format("%s.top configure %s;", + # @config << Kernel.format("%s.top configure %s;", # @path, hash_kv(@msgframe_config).join(' ')) # @config << @path+'.top configure '+hash_kv(@msgframe_config).join(' ')+';' @config << @path+'.top configure '+ @@ -143,7 +143,7 @@ end if @btnframe_config.kind_of?(Hash) - # @config << Kernel.format("%s.bot configure %s;", + # @config << Kernel.format("%s.bot configure %s;", # @path, hash_kv(@btnframe_config).join(' ')) # @config << @path+'.bot configure '+hash_kv(@btnframe_config).join(' ')+';' @config << @path+'.bot configure '+ @@ -151,7 +151,7 @@ end if @bitmap_config.kind_of?(Hash) - # @config << Kernel.format("%s.bitmap configure %s;", + # @config << Kernel.format("%s.bitmap configure %s;", # @path, hash_kv(@bitmap_config).join(' ')) # @config << @path+'.bitmap configure '+hash_kv(@bitmap_config).join(' ')+';' @config << @path+'.bitmap configure '+ @@ -176,19 +176,19 @@ # default_button = '{}' if default_button == nil default_button = '' if default_button == nil #Tk.ip_eval('eval {global '+@var.id+';'+@config+ - # 'set '+@var.id+' [tk_dialog '+ + # 'set '+@var.id+' [tk_dialog '+ # @path+" "+@title+" {#{@message}} "+@bitmap+" "+ # String(default_button)+" "+@buttons.join(' ')+']}') Tk.ip_eval(@config) - # @val = Tk.ip_eval('tk_dialog ' + @path + ' ' + @title + - # ' {' + @message + '} ' + @bitmap + ' ' + + # @val = Tk.ip_eval('tk_dialog ' + @path + ' ' + @title + + # ' {' + @message + '} ' + @bitmap + ' ' + # String(default_button) + ' ' + @buttons.join(' ')).to_i - # @val = Tk.ip_eval(self.class::TkCommandNames[0] + ' ' + @path + ' ' + - # @title + ' {' + @message + '} ' + @bitmap + ' ' + + # @val = Tk.ip_eval(self.class::TkCommandNames[0] + ' ' + @path + ' ' + + # @title + ' {' + @message + '} ' + @bitmap + ' ' + # String(default_button) + ' ' + @buttons.join(' ')).to_i @val = Tk.ip_eval(array2tk_list([ - self.class::TkCommandNames[0], - @path, @title, @message, @bitmap, + self.class::TkCommandNames[0], + @path, @title, @message, @bitmap, String(default_button) ].concat(@buttons))).to_i end @@ -226,7 +226,7 @@ return nil end def bitmap - # returns a bitmap name or a bitmap file path + # returns a bitmap name or a bitmap file path # (@ + path ; e.g. '@/usr/share/bitmap/sample.xbm') return "info" end Index: ext/tk/lib/tk/macpkg.rb =================================================================== --- ext/tk/lib/tk/macpkg.rb (revision 23917) +++ ext/tk/lib/tk/macpkg.rb (working copy) @@ -23,7 +23,9 @@ module Tk::MacResource end #TkMacResource = Tk::MacResource -Tk.__set_toplevel_aliases__(:Tk, Tk::MacResource, :TkMacResource) +#Tk.__set_toplevel_aliases__(:Tk, Tk::MacResource, :TkMacResource) +Tk.__set_loaded_toplevel_aliases__('tk/macpkg.rb', :Tk, Tk::MacResource, + :TkMacResource) module Tk::MacResource extend Tk Index: ext/tk/lib/tk/composite.rb =================================================================== --- ext/tk/lib/tk/composite.rb (revision 23917) +++ ext/tk/lib/tk/composite.rb (working copy) @@ -1,5 +1,5 @@ # -# tk/composite.rb : +# tk/composite.rb : # require 'tk' @@ -358,7 +358,7 @@ opt, wins = tbl[0] next unless wins && wins[-1] if slot == opt - info_list.delete_if{|i| i[0] == slot} << + info_list.delete_if{|i| i[0] == slot} << wins[-1].configinfo(slot) else info = wins[-1].configinfo(opt) @@ -367,7 +367,7 @@ end else opt, wins = tbl[-1] - info_list.delete_if{|i| i[0] == slot} << + info_list.delete_if{|i| i[0] == slot} << [slot, '', '', '', wins[-1].cget(opt)] end } Index: ext/tk/lib/tk/optionobj.rb =================================================================== --- ext/tk/lib/tk/optionobj.rb (revision 23917) +++ ext/tk/lib/tk/optionobj.rb (working copy) @@ -1,10 +1,10 @@ # # tk/optionobj.rb : control options for a group of widgets # -# NOTE: If you want to use key-only option (no value), -# use Tk::None for the value of the key-only option. +# NOTE: If you want to use key-only option (no value), +# use Tk::None for the value of the key-only option. # -# e.g. hash_kv({'aaa'=>1, 'bbb'=>Tk::None, 'ccc'=>3}) +# e.g. hash_kv({'aaa'=>1, 'bbb'=>Tk::None, 'ccc'=>3}) # => ["-aaa", 1, "-bbb", "-ccc", 3] # require 'tk' @@ -36,7 +36,7 @@ def _remove_win(win) if win.kind_of?(Array) widget, method = win - @observ.delete_if{|x| + @observ.delete_if{|x| if x.kind_of?(Array) x[0] == widget else @@ -56,15 +56,15 @@ private :_remove_win def assign(*wins) - # win := + # win := # widget #==> call widget.configure(hash) # [widget] #==> call widget.configure(hash) # [widget, nil, {src=>target, ... }] - # #==> call widget.configure(hash) + # #==> call widget.configure(hash) # with converting hash-key # [widget, method] #==> call widget.method(hash) # [widget, method, {src=>target, ... }] - # #==> call widget.method(hash) + # #==> call widget.method(hash) # with converting hash-key # [widget [receiver, method, arg, ... ]] # #==> call receiver.method(arg, ... , hash) @@ -74,7 +74,7 @@ # # src := option_name_on_optobj # - # target := + # target := # nil #==> not use the src # option_name_on_target_widget # [ option_name_on_target_widget, ... ] @@ -123,7 +123,7 @@ next unless key if key.kind_of?(Array) key.each{|k| hash[k] = val} - else + else hash[key] = val end } Index: ext/tk/lib/tk/autoload.rb =================================================================== --- ext/tk/lib/tk/autoload.rb (revision 23917) +++ ext/tk/lib/tk/autoload.rb (working copy) @@ -27,6 +27,8 @@ ############################################ # classes on Tk module module Tk + autoload :Busy, 'tk/busy' + autoload :Button, 'tk/button' autoload :Canvas, 'tk/canvas' @@ -250,78 +252,85 @@ module Tk @TOPLEVEL_ALIAS_TABLE = {} @TOPLEVEL_ALIAS_TABLE[:Tk] = { - :TkButton => 'tk/button', + :TkButton => 'tk/button', - :TkCanvas => 'tk/canvas', + :TkCanvas => 'tk/canvas', - :TkCheckButton => 'tk/checkbutton', - :TkCheckbutton => 'tk/checkbutton', + :TkCheckButton => 'tk/checkbutton', + :TkCheckbutton => 'tk/checkbutton', - # :TkDialog => 'tk/dialog', - # :TkDialog2 => 'tk/dialog', - # :TkDialogObj => 'tk/dialog', - # :TkWarning => 'tk/dialog', - # :TkWarning2 => 'tk/dialog', - # :TkWarningObj => 'tk/dialog', + # :TkDialog => 'tk/dialog', + # :TkDialog2 => 'tk/dialog', + # :TkDialogObj => 'tk/dialog', + # :TkWarning => 'tk/dialog', + # :TkWarning2 => 'tk/dialog', + # :TkWarningObj => 'tk/dialog', - :TkEntry => 'tk/entry', + :TkEntry => 'tk/entry', - :TkFrame => 'tk/frame', + :TkFrame => 'tk/frame', - :TkLabel => 'tk/label', + :TkLabel => 'tk/label', - :TkLabelFrame => 'tk/labelframe', - :TkLabelframe => 'tk/labelframe', + :TkLabelFrame => 'tk/labelframe', + :TkLabelframe => 'tk/labelframe', - :TkListbox => 'tk/listbox', + :TkListbox => 'tk/listbox', - :TkMacResource => 'tk/macpkg', + :TkMacResource => 'tk/macpkg', - :TkMenu => 'tk/menu', - :TkMenuClone => 'tk/menu', - :TkCloneMenu => 'tk/menu', - # :TkSystemMenu => 'tk/menu', - :TkSysMenu_Help => 'tk/menu', - :TkSysMenu_System => 'tk/menu', - :TkSysMenu_Apple => 'tk/menu', - :TkMenubutton => 'tk/menu', - :TkMenuButton => 'tk/menu', - :TkOptionMenubutton => 'tk/menu', - :TkOptionMenuButton => 'tk/menu', + :TkMenu => 'tk/menu', + :TkMenuClone => 'tk/menu', + :TkCloneMenu => 'tk/menu', + # :TkSystemMenu => 'tk/menu', + :TkSysMenu_Help => 'tk/menu', + :TkSysMenu_System => 'tk/menu', + :TkSysMenu_Apple => 'tk/menu', + :TkMenubutton => 'tk/menu', + :TkMenuButton => 'tk/menu', + :TkOptionMenubutton => 'tk/menu', + :TkOptionMenuButton => 'tk/menu', - :TkMessage => 'tk/message', + :TkMessage => 'tk/message', - :TkPanedWindow => 'tk/panedwindow', - :TkPanedwindow => 'tk/panedwindow', + :TkPanedWindow => 'tk/panedwindow', + :TkPanedwindow => 'tk/panedwindow', - :TkRadioButton => 'tk/radiobutton', - :TkRadiobutton => 'tk/radiobutton', + :TkRadioButton => 'tk/radiobutton', + :TkRadiobutton => 'tk/radiobutton', - # :TkRoot => 'tk/root', + # :TkRoot => 'tk/root', - :TkScale => 'tk/scale', + :TkScale => 'tk/scale', - :TkScrollbar => 'tk/scrollbar', - :TkXScrollbar => 'tk/scrollbar', - :TkYScrollbar => 'tk/scrollbar', + :TkScrollbar => 'tk/scrollbar', + :TkXScrollbar => 'tk/scrollbar', + :TkYScrollbar => 'tk/scrollbar', - :TkSpinbox => 'tk/spinbox', + :TkSpinbox => 'tk/spinbox', - :TkText => 'tk/text', + :TkText => 'tk/text', - :TkToplevel => 'tk/toplevel', + :TkToplevel => 'tk/toplevel', - :TkWinDDE => 'tk/winpkg', - :TkWinRegistry => 'tk/winpkg', + :TkWinDDE => 'tk/winpkg', + :TkWinRegistry => 'tk/winpkg', } @TOPLEVEL_ALIAS_OWNER = {} @TOPLEVEL_ALIAS_SETUP_PROC = {} + @AUTOLOAD_FILE_SYM_TABLE = Hash.new{|h,k| h[k]={}} # TABLE[file][sym] -> obj + @current_default_widget_set = nil + + module TOPLEVEL_ALIASES; end end +class Object + include Tk::TOPLEVEL_ALIASES +end ############################################ # methods to control default widget set @@ -343,50 +352,387 @@ _replace_toplevel_aliases(target) end - def __set_toplevel_aliases__(target, obj, *symbols) + def widget_set_symbols + @TOPLEVEL_ALIAS_TABLE.keys + end + + def toplevel_aliases_on_widget_set(widget_set) + if (tbl = @TOPLEVEL_ALIAS_TABLE[widget_set.to_sym]) + tbl.collect{|k, v| (v.nil?)? nil: k}.compact + else + fail ArgumentError, "unknown widget_set #{widget_set.to_sym.inspect}" + end + end + + def __toplevel_alias_setup_proc__(*target_list, &cmd) + target_list.each{|target| @TOPLEVEL_ALIAS_SETUP_PROC[target.to_sym] = cmd} + end + + def topobj_defined?(sym) #=> alias_filename or object or false + Object.autoload?(sym) || + (Object.const_defined?(sym) && Object.const_get(sym)) + end + def topalias_defined?(sym) #=> alias_filename or object or false + Tk::TOPLEVEL_ALIASES.autoload?(sym) || + (Tk::TOPLEVEL_ALIASES.const_defined?(sym) && + Tk::TOPLEVEL_ALIASES.const_get(sym)) + end + def define_topobj(sym, obj) + if obj.kind_of? String + # obj is an autoload path + Object.autoload(sym, obj) + unless Object.autoload?(sym) + # file is autoloaded? + if @AUTOLOAD_FILE_SYM_TABLE.has_key?(obj) && + (loaded_obj = @AUTOLOAD_FILE_SYM_TABLE[obj][sym]) + Object.const_set(sym, loaded_obj) + else + fail ArgumentError, "cannot define autoload file (already loaded?)" + end + end + else + # object + Object.const_set(sym, obj) + end + end + def define_topalias(sym, obj) + if obj.kind_of? String + # obj is an autoload path + Tk::TOPLEVEL_ALIASES.autoload(sym, obj) + unless Tk::TOPLEVEL_ALIASES.autoload?(sym) + # file is autoloaded? + if @AUTOLOAD_FILE_SYM_TABLE.has_key?(obj) && + (loaded_obj = @AUTOLOAD_FILE_SYM_TABLE[obj][sym]) + Tk::TOPLEVEL_ALIASES.const_set(sym, loaded_obj) + else + fail ArgumentError, "cannot define autoload file (already loaded?)" + end + end + else + # object + Tk::TOPLEVEL_ALIASES.const_set(sym, obj) + end + end + def replace_topobj(sym, obj) #=> old_obj (alias_filename or object) or nil + if old_obj = topobj_defined?(sym) + Object.class_eval{remove_const sym} rescue nil # ignore err + end + define_topobj(sym, obj) + old_obj + end + def replace_topalias(sym, obj) #=> old_obj (alias_filename or object) or nil + if old_obj = topalias_defined?(sym) + Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} rescue nil #ignore err + end + define_topalias(sym, obj) + old_obj + end + private :topobj_defined?, :topalias_defined? + private :define_topobj, :define_topalias + private :replace_topobj, :replace_topalias + + def __regist_toplevel_aliases__(target, obj, *symbols) + # initial regist @TOPLEVEL_ALIAS_TABLE[target = target.to_sym] ||= {} symbols.each{|sym| @TOPLEVEL_ALIAS_TABLE[target][sym = sym.to_sym] = obj - # if @current_default_widget_set == target - if @TOPLEVEL_ALIAS_OWNER[sym] == target - Object.class_eval{remove_const sym} if Object.const_defined?(sym) - Object.const_set(sym, obj) + if !topalias_defined?(sym) || target == @current_default_widget_set + @TOPLEVEL_ALIAS_OWNER[sym] = target + replace_topalias(sym, obj) + replace_topobj(sym, obj) unless obj.kind_of?(String) # NOT autoload end } end - ################################### - private - def _replace_toplevel_aliases(target) - # check already autoloaded - if (table = @TOPLEVEL_ALIAS_TABLE[current = @current_default_widget_set]) - table.each{|sym, file| - if !Object.autoload?(sym) && Object.const_defined?(sym) && - @TOPLEVEL_ALIAS_TABLE[current][sym].kind_of?(String) - # autoload -> class - @TOPLEVEL_ALIAS_TABLE[current][sym] = Object.const_get(sym) + def regist_sym_for_loaded_file(auto, obj, sym) + @AUTOLOAD_FILE_SYM_TABLE[auto][sym] = obj + + reg = /^#{Regexp.quote(auto)}(\.rb|\.so|)$/ + @TOPLEVEL_ALIAS_TABLE.each_key{|set| + if @TOPLEVEL_ALIAS_TABLE[set][sym] =~ reg + @TOPLEVEL_ALIAS_TABLE[set][sym] = obj + if @TOPLEVEL_ALIAS_OWNER[sym].nil? || @TOPLEVEL_ALIAS_OWNER[sym] == set + replace_topalias(sym, obj) + replace_topobj(sym, obj) if set == @current_default_widget_set end - } + end + } + if (f = Object.autoload?(sym)) && f =~ reg + replace_topobj(sym, obj) end + if (f = Tk::TOPLEVEL_ALIASES.autoload?(sym)) && f =~ reg + replace_topalias(sym, obj) + end + end + private :regist_sym_for_loaded_file - # setup autoloads - @TOPLEVEL_ALIAS_TABLE[target].each{|sym, file| - Object.class_eval{remove_const sym} if Object.const_defined?(sym) - if file.kind_of?(String) - # file => autoload target file - Object.autoload(sym, file) + def set_topalias(target, obj, sym) + # obj is a kind of String : define autoload path + # Class : use the class object + if target == @current_default_widget_set + case @TOPLEVEL_ALIAS_OWNER[sym] + when false + # Object::sym is out of control. --> not change + # Make ALIAS::sym under control, because target widget set is current. + # Keep OWNER[sym] + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + replace_topalias(sym, obj) + + when target + if current_obj = topobj_defined?(sym) + if current_obj == obj + # Make current_obj under control. + # Keep Object::sym. + # Keep OWNER[sym]. + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + replace_topalias(sym, obj) + + else # current_obj != obj + if current_obj == topalias_defined?(sym) + # Change controlled object + # Keep OWNER[sym]. + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + replace_topalias(sym, obj) + replace_topobj(sym, obj) + + else # current_obj != topalias_defined?(sym) + # Maybe current_obj is defined by user. --> OWNER[sym] = faise + # Keep Object::sym. + @TOPLEVEL_ALIAS_OWNER[sym] = false + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + replace_topalias(sym, obj) + end + end + + else # NOT topobj_defined?(sym) + # New definition for sym at target. + # Keep OWNER[sym]. + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + replace_topalias(sym, obj) + define_topobj(sym, obj) + end + + when nil + # New definition for sym at target. + @TOPLEVEL_ALIAS_OWNER[sym] = target + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + replace_topalias(sym, obj) + + else # others + # Maybe planning to make sym under control. + @TOPLEVEL_ALIAS_OWNER[sym] = target + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + replace_topalias(sym, obj) + replace_topobj(sym, obj) + end + + else # target != @current_default_widget_set + case @TOPLEVEL_ALIAS_OWNER[sym] + when false + # Object::sym is out of control. --> not change + if topalias_defined?(sym) + # ALIAS[sym] may be defined by other widget set. + # Keep Object::sym (even if it is not defined) + # Keep ALIAS[sym]. + # Keep OWNER[sym]. + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + + else # NOT topalias_defined?(sym) + # Nobody controls ALIAS[sym]. + # At leaset, current widget set doesn't control ALIAS[sym]. + # Keep Object::sym (even if it is not defined) + # Keep OWNER[sym]. + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + define_topalias(sym, obj) + end + + when target + # Maybe change controlled object, because Object::sym is under control. + # Keep OWNER[sym]. + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + replace_topalias(sym, obj) + replace_topobj(sym, obj) + + when nil + # New definition for sym + @TOPLEVEL_ALIAS_OWNER[sym] = target + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + replace_topalias(sym, obj) + replace_topobj(sym, obj) + + else # others + # An other widget set controls sym. + # Keep Object::sym (even if it is not defined) + # Keep ALIAS[sym]. + # Keep OWNER[sym]. + @TOPLEVEL_ALIAS_TABLE[target][sym] = obj + + end + end + + sym + end + private :set_topalias + + def __set_toplevel_aliases__(target, obj, *symbols) + # obj is a kind of String : define autoload path + # Class : use the class object + target = target.to_sym + symbols.each{|sym| set_topalias(target, obj, sym.to_sym)} + end + + def __set_loaded_toplevel_aliases__(autopath, target, obj, *symbols) + # autopath is an autoload file + # Currently, this method doesn't support that autoload loads + # different toplevels between .rb and .so extension. + shortpath = (autopath =~ /^(.*)(.rb|.so)$/)? $1: autopath + target = target.to_sym + symbols.map!{|sym| sym.to_sym} + + symbols.each{|sym| regist_sym_for_loaded_file(shortpath, obj, sym) } + symbols.each{|sym| set_topalias(target, obj, sym)} + end + + def backup_current_topdef(sym) + return if (current = @current_default_widget_set).nil? + + case @TOPLEVEL_ALIAS_OWNER[sym] + when false + # Object::sym is out of control. + if (cur_alias = topalias_defined?(sym)) && ! cur_alias.kind_of?(String) + @TOPLEVEL_ALIAS_TABLE[current][sym] = cur_alias + end + + when current + if cur_obj = topobj_defined?(sym) + if ! cur_obj.kind_of?(String) && (cur_alias = topalias_defined?(sym)) + if cur_alias.kind_of?(String) + # Mayby, user replaced Object::sym. + # Make Object::sym out of control. + @TOPLEVEL_ALIAS_OWNER[sym] = false + elsif cur_obj == cur_alias + # Possibley, defined normally. Backup it + @TOPLEVEL_ALIAS_TABLE[current][sym] = cur_alias + else + # Mayby, user replaced Object::sym. + # Make Object::sym out of control. + @TOPLEVEL_ALIAS_OWNER[sym] = false + end + end else - # file => loaded class object - Object.const_set(sym, file) + # Mayby, user replaced Object::sym. + # Make Object::sym out of control. + @TOPLEVEL_ALIAS_OWNER[sym] = false end - @TOPLEVEL_ALIAS_OWNER[sym] = target + + when nil + # Object::sym is out of control. + if (cur_alias = topalias_defined?(sym)) && ! cur_alias.kind_of?(String) + # Possibley, defined normally. Backup it. + @TOPLEVEL_ALIAS_TABLE[current][sym] = cur_alias + end + else + # No authority to control Object::sym and ALIASES::sym. + # Do nothing. + end + end + private :backup_current_topdef + + def _replace_toplevel_aliases(target) + # backup + @TOPLEVEL_ALIAS_TABLE[target].each_key{|sym| + backup_current_topdef(sym) } - # update current alias + # replace + @TOPLEVEL_ALIAS_TABLE[target].each_key{|sym| + next if (obj = @TOPLEVEL_ALIAS_TABLE[target][sym]).nil? + if @TOPLEVEL_ALIAS_OWNER[sym] == false + # Object::sym is out of control. --> not change + # Keep OWNER[sym]. + replace_topalias(sym, obj) + else + # New definition + @TOPLEVEL_ALIAS_OWNER[sym] = target + replace_topalias(sym, obj) + replace_topobj(sym, obj) + end + } + + # change default_widget_set @current_default_widget_set = target end + private :_replace_toplevel_aliases + + def __import_toplevel_aliases__(target, *symbols) + current = @current_default_widget_set + symbols.each{|sym| + sym = sym.to_sym + if (obj = @TOPLEVEL_ALIAS_TABLE[target][sym]).nil? + # remove + @TOPLEVEL_ALIAS_TABLE[current].delete(sym) + @TOPLEVEL_ALIAS_OWNER.delete(sym) + Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} if topalias_defined?(sym) + Object.class_eval{remove_const sym} if topobj_defined?(sym) + + elsif obj == false + # remove, but OWNER[sym] <- false and not treat Object::sym + @TOPLEVEL_ALIAS_TABLE[current].delete(sym) + @TOPLEVEL_ALIAS_OWNER[sym] = false + Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} if topalias_defined?(sym) + + elsif @TOPLEVEL_ALIAS_OWNER[sym] == false + # Object::sym is out of control. --> not change + # Keep OWNER[sym]. + @TOPLEVEL_ALIAS_TABLE[current][sym] = obj + replace_topalias(sym, obj) + + else + # new definition under control + @TOPLEVEL_ALIAS_OWNER[sym] = current + @TOPLEVEL_ALIAS_TABLE[current][sym] = obj + replace_topalias(sym, obj) + replace_topobj(sym, obj) + end + } + end + + def __remove_toplevel_aliases__(*symbols) + # remove toplevel aliases of current widget set + current = @current_default_widget_set + symbols.each{|sym| + sym = sym.to_sym + @TOPLEVEL_ALIAS_TABLE[current].delete(sym) + @TOPLEVEL_ALIAS_OWNER.delete(sym) + Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} if topalias_defined?(sym) + Object.class_eval{remove_const sym} if topobj_defined?(sym) + } + end + + def __reset_toplevel_owner__(*symbols) + symbols.each{|sym| @TOPLEVEL_ALIAS_OWNER.delete(sym.to_sym)} + end + + def __disable_toplevel_control__(*symbols) + symbols.each{|sym| @TOPLEVEL_ALIAS_OWNER[sym.to_sym] = false} + end + + def __create_widget_set__(new_set, src_set={}) + new_set = new_set.to_sym + if @TOPLEVEL_ALIAS_TABLE[new_set] + fail RuntimeError, "A widget-set #{new_set.inspect} is already exist." + end + if src_set.kind_of?(Symbol) + # new_set is an alias name of existed widget set. + @TOPLEVEL_ALIAS_TABLE[new_set] = @TOPLEVEL_ALIAS_TABLE[src_set] + else + @TOPLEVEL_ALIAS_TABLE[new_set] = {} + src_set.each{|sym, obj| set_topalias(new_set, obj, sym.to_sym) } + end + end end + ############################################ # setup default widget set => :Tk Tk.default_widget_set = :Tk @@ -394,14 +740,14 @@ ############################################ # depend on the version of Tcl/Tk -# major, minor, type, type_name, patchlevel = TclTkLib.get_version +# major, minor, type, patchlevel = TclTkLib.get_version ############################################ # Ttk (Tile) support =begin -if major > 8 || - (major == 8 && minor > 5) || - (major == 8 && minor == 5 && type >= TclTkLib::RELEASE_TYPE::BETA) +if major > 8 || + (major == 8 && minor > 5) || + (major == 8 && minor == 5 && type >= TclTkLib::RELEASE_TYPE::BETA) # Tcl/Tk 8.5 beta or later Object.autoload :Ttk, 'tkextlib/tile' Tk.autoload :Tile, 'tkextlib/tile' Index: ext/tk/lib/tk/canvas.rb =================================================================== --- ext/tk/lib/tk/canvas.rb (revision 23917) +++ ext/tk/lib/tk/canvas.rb (working copy) @@ -13,7 +13,7 @@ def __item_strval_optkeys(id) # maybe need to override super(id) + [ - 'fill', 'activefill', 'disabledfill', + 'fill', 'activefill', 'disabledfill', 'outline', 'activeoutline', 'disabledoutline' ] end @@ -117,7 +117,7 @@ end def bbox(tagOrId, *tags) - list(tk_send_without_enc('bbox', tagid(tagOrId), + list(tk_send_without_enc('bbox', tagid(tagOrId), *tags.collect{|t| tagid(t)})) end @@ -181,7 +181,7 @@ end def dchars(tag, first, last=None) - tk_send_without_enc('dchars', tagid(tag), + tk_send_without_enc('dchars', tagid(tag), _get_eval_enc_str(first), _get_eval_enc_str(last)) self end @@ -214,7 +214,7 @@ alias deltag dtag def find(mode, *args) - list(tk_send_without_enc('find', mode, *args)).collect!{|id| + list(tk_send_without_enc('find', mode, *args)).collect!{|id| TkcItem.id2obj(self, id) } end @@ -265,12 +265,18 @@ self end + def imove(tagOrId, idx, x, y) + tk_send_without_enc('imove', tagid(tagOrId), idx, x, y) + self + end + alias i_move imove + def index(tagOrId, idx) number(tk_send_without_enc('index', tagid(tagOrId), idx)) end def insert(tagOrId, index, string) - tk_send_without_enc('insert', tagid(tagOrId), index, + tk_send_without_enc('insert', tagid(tagOrId), index, _get_eval_enc_str(string)) self end @@ -300,7 +306,7 @@ fnt end else - tk_tcl2ruby(_fromUTF8(tk_send_without_enc('itemcget', tagid(tagOrId), + tk_tcl2ruby(_fromUTF8(tk_send_without_enc('itemcget', tagid(tagOrId), "-#{option}"))) end end @@ -315,16 +321,16 @@ || key['latinfont'] || key['asciifont'] ) tagfont_configure(tagid(tagOrId), key.dup) else - _fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId), + _fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId), *hash_kv(key, true))) end else if ( key == 'coords' || key == :coords ) self.coords(tagOrId, value) - elsif ( key == 'font' || key == :font || - key == 'kanjifont' || key == :kanjifont || - key == 'latinfont' || key == :latinfont || + elsif ( key == 'font' || key == :font || + key == 'kanjifont' || key == :kanjifont || + key == 'latinfont' || key == :latinfont || key == 'asciifont' || key == :asciifont ) if value == None tagfontobj(tagid(tagOrId)) @@ -332,7 +338,7 @@ tagfont_configure(tagid(tagOrId), {key=>value}) end else - _fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId), + _fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId), "-#{key}", _get_eval_enc_str(value))) end end @@ -389,16 +395,16 @@ else if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end if conf[4] if conf[4].index('{') - conf[4] = tk_split_list(conf[4]) + conf[4] = tk_split_list(conf[4]) else - conf[4] = tk_tcl2ruby(conf[4]) + conf[4] = tk_tcl2ruby(conf[4]) end end end @@ -421,8 +427,8 @@ when 'coords' {'coords' => ['', '', '', self.coords(tagOrId)]} when 'dash', 'activedash', 'disableddash' - conf = tk_split_simplelist(tk_send_without_enc('itemconfigure', - tagid(tagOrId), + conf = tk_split_simplelist(tk_send_without_enc('itemconfigure', + tagid(tagOrId), "-#{key}")) if conf[3] && conf[3] =~ /^[0-9]/ conf[3] = list(conf[3]) @@ -457,16 +463,16 @@ else if conf[2] if conf[2].index('{') - conf[2] = tk_split_list(conf[2]) + conf[2] = tk_split_list(conf[2]) else - conf[2] = tk_tcl2ruby(conf[2]) + conf[2] = tk_tcl2ruby(conf[2]) end end if conf[3] if conf[3].index('{') - conf[3] = tk_split_list(conf[3]) + conf[3] = tk_split_list(conf[3]) else - conf[3] = tk_tcl2ruby(conf[3]) + conf[3] = tk_tcl2ruby(conf[3]) end end end @@ -523,11 +529,18 @@ self end - def move(tag, x, y) - tk_send_without_enc('move', tagid(tag), x, y) + def move(tag, dx, dy) + tk_send_without_enc('move', tagid(tag), dx, dy) self end + def moveto(tag, x, y) + # Tcl/Tk 8.6 or later + tk_send_without_enc('moveto', tagid(tag), x, y) + self + end + alias move_to moveto + def postscript(keys) tk_send("postscript", *hash_kv(keys)) end @@ -541,6 +554,15 @@ self end + def rchars(tag, first, last, str_or_coords) + # Tcl/Tk 8.6 or later + str_or_coords = str_or_coords.flatten if str_or_coords.kinad_of? Array + tk_send_without_enc('rchars', tagid(tag), first, last, str_or_coords) + self + end + alias replace_chars rchars + alias replace_coords rchars + def scale(tag, x, y, xs, ys) tk_send_without_enc('scale', tagid(tag), x, y, xs, ys) self @@ -581,7 +603,8 @@ end #TkCanvas = Tk::Canvas unless Object.const_defined? :TkCanvas -Tk.__set_toplevel_aliases__(:Tk, Tk::Canvas, :TkCanvas) +#Tk.__set_toplevel_aliases__(:Tk, Tk::Canvas, :TkCanvas) +Tk.__set_loaded_toplevel_aliases__('tk/canvas.rb', :Tk, Tk::Canvas, :TkCanvas) class TkcItem 0 - tk_call_without_enc(@t.path, 'window', 'configure', @index, + tk_call_without_enc(@t.path, 'window', 'configure', @index, *hash_kv(slot, true)) end else if slot == 'window' || slot == :window - @id = value + @id = value # value = @id.epath if @id.kind_of?(TkWindow) value = _epath(@id) if @id end if slot == 'create' || slot == :create self.create=value else - tk_call_without_enc(@t.path, 'window', 'configure', @index, + tk_call_without_enc(@t.path, 'window', 'configure', @index, "-#{slot}", _get_eval_enc_str(value)) end end @@ -123,7 +123,7 @@ @id = value # value = @id.epath if @id.kind_of?(TkWindow) value = _epath(@id) if @id - tk_call_without_enc(@t.path, 'window', 'configure', @index, + tk_call_without_enc(@t.path, 'window', 'configure', @index, '-window', _get_eval_enc_str(value)) value end @@ -145,7 +145,7 @@ end }) end - tk_call_without_enc(@t.path, 'window', 'configure', @index, + tk_call_without_enc(@t.path, 'window', 'configure', @index, '-create', _get_eval_enc_str(value)) value end Index: ext/tk/extconf.rb =================================================================== --- ext/tk/extconf.rb (revision 23917) +++ ext/tk/extconf.rb (working copy) @@ -1,81 +1,106 @@ # extconf.rb for tcltklib - require 'mkmf' -is_win32 = (/mswin|mingw|cygwin|bccwin|wince/ =~ RUBY_PLATFORM) -#is_macosx = (/darwin/ =~ RUBY_PLATFORM) +TkLib_Config = {} +TkLib_Config['search_versions'] = + %w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 4.2] -have_func("ruby_native_thread_p", "ruby.h") -have_func("rb_errinfo", "ruby.h") -have_func("rb_safe_level", "ruby.h") -have_struct_member("struct RArray", "ptr", "ruby.h") -have_struct_member("struct RArray", "len", "ruby.h") -def find_framework(tcl_hdr, tk_hdr) - if framework_dir = with_config("tcltk-framework") - paths = [framework_dir] - else - unless tcl_hdr || tk_hdr || - enable_config("tcltk-framework", false) || - enable_config("mac-tcltk-framework", false) - return false - end - paths = ["/Library/Frameworks", "/System/Library/Frameworks"] +############################################################## +# use old extconf.rb ? +############################################################## +if with_config('tk-old-extconf') + require File.join(File.dirname(__FILE__), 'old-extconf.rb') + exit +end + + +############################################################## +# check configs +############################################################## +$cleanfiles << 'config_list' +config_list_file = File.join(File.dirname(__FILE__),'config_list') +config_list_file_source = config_list_file + '.in' +if !File.exist?(config_list_file) || + File.ctime(config_list_file_source) > File.ctime(config_list_file) + old_config_list_file = config_list_file_source +else + old_config_list_file = config_list_file +end +current_configs = {'with'=>{}, 'enable'=>{}} +IO.foreach(old_config_list_file){|line| + line.chomp! + line.lstrip! + next if line.empty? || line =~ /^\#/ # + mode, key, value = line.split(/\s+/, 3) + current_configs[mode][key] = value rescue nil # ignore unknown 'mode' error +} + +update_flag = false +current_configs['with'].each_key{|key| + if (value = with_config(key).to_s) != current_configs['with'][key] + update_flag = true + current_configs['with'][key] = value end +} +current_configs['enable'].each_key{|key| + if (value = enable_config(key).to_s) != current_configs['enable'][key] + update_flag = true + current_configs['enable'][key] = value + end +} - checking_for('Tcl/Tk Framework') { - paths.find{|dir| - dir.strip! - dir.chomp!('/') - (tcl_hdr || FileTest.directory?(dir + "/Tcl.framework/") ) && - (tk_hdr || FileTest.directory?(dir + "/Tk.framework/") ) +# update current_configs +if update_flag || !File.exist?(config_list_file) + open(config_list_file, 'w'){|fobj| + ['with', 'enable'].each{|mode| + current_configs[mode].each_key{|key| + fobj.print("#{mode} #{key} #{current_configs[mode][key]}\n") + } } } end -tcl_framework_header = with_config("tcl-framework-header") -tk_framework_header = with_config("tk-framework-header") +if update_flag + puts "Configure options for Ruby/Tk may be updated." + puts "So, delete files which depend on old configs." + File.delete(*(Dir.glob(File.join(File.dirname(__FILE__), + "*.#{CONFIG['DLEXT']}")))) + File.delete(*(Dir.glob(File.join(File.dirname(__FILE__), "*.#{$OBJEXT}")))) + File.delete(File.join(File.dirname(__FILE__), 'Makefile')) rescue nil -tcltk_framework = find_framework(tcl_framework_header, tk_framework_header) +else + makefile = File.join(File.dirname(__FILE__),'Makefile') + if File.exist?(makefile) && + File.ctime(config_list_file) > File.ctime(makefile) + # no need to update Makefile + exit + end +end -unless is_win32 - have_library("nsl", "t_open") - have_library("socket", "socket") - have_library("dl", "dlopen") - have_library("m", "log") +############################################################## +# fuctions +############################################################## +def is_win32? + /mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM end -tk_idir, tk_ldir = dir_config("tk") -tcl_idir, tcl_ldir = dir_config("tcl") -x11_idir, x11_ldir = dir_config("X11") +def is_macosx? + /darwin/ =~ RUBY_PLATFORM +end -tk_ldir2 = with_config("tk-lib") -tcl_ldir2 = with_config("tcl-lib") -x11_ldir2 = with_config("X11-lib") - -tk_ldir_list = [tk_ldir2, tk_ldir] -tcl_ldir_list = [tcl_ldir2, tcl_ldir] - -tklib = with_config("tklib") -tcllib = with_config("tcllib") -stubs = enable_config("tcltk_stubs") || with_config("tcltk_stubs") - -tcltk_version = with_config("tcltkversion") - -use_X = with_config("X11", (! is_win32)) - def check_tcltk_version(version) - return [nil, nil] unless version + return [nil, nil] unless version.kind_of? String version = version.strip tclver = version.dup tkver = version.dup - major = dot = minor = dot = plvl = ext = nil + dot = major = minor_dot = minor = plvl_dot = plvl = ext = nil if version =~ /^(\d)(\.?)(\d)(\.?)(\d*)(.*)$/ - major = $1; minor_dot = $2; minor = $3; plvl_dot = $4; plvl = $5; ext = $6 + major = $1; minor_dot = $2; minor = $3; plvl_dot = $4; plvl = $5; ext = $6 dot = ! minor_dot.empty? if plvl_dot.empty? && ! plvl.empty? minor << plvl @@ -99,12 +124,536 @@ [tclver, tkver] end +def get_shlib_versions(major = 8, minor_max = 9, minor_min = 0, ext = "") + if tclcfg = TkLib_Config["tclConfig_info"] + major = tclcfg['TCL_MAJOR_VERSION'].to_i + minor_min = tclcfg['TCL_MINOR_VERSION'].to_i + + elsif TkLib_Config["tcltkversion"] + tclver, tkver = TkLib_Config["tcltkversion"] + if tclver =~ /8\.?(\d)(.*)/ + minor_min = $1.to_i + ext = $2 + else + # unsupported version + return [""] + end + end + + # if disable-stubs, version is fixed. + minor_max = minor_min unless TkLib_Config["tcltk-stubs"] + + vers = [] + minor_max.downto(minor_min){|minor| + vers << "#{major}.#{minor}#{ext}" unless ext.empty? + vers << "#{major}.#{minor}" + } + + vers << "" +end + +def get_shlib_path_head + path_head = [] + path_dirs = [] + + if TkLib_Config["ActiveTcl"].kind_of?(String) # glob path + path_dirs.concat Dir.glob(TkLib_Config["ActiveTcl"]).sort.reverse + end + + if is_win32? + if TkLib_Config["ActiveTcl"] + path_head.concat ["c:/ActiveTcl", "c:/Program Files/ActiveTcl"] + end + path_head.concat [ + "c:/Tcl", "c:/Program Files/Tcl", + "/Tcl", "/Program Files/Tcl" + ] + path_head.each{|dir| path_dirs << "#{dir}"} + + else + [ + '/opt', '/pkg', '/share', + '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local', + '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr' + ].each{|dir| + next unless File.directory?(dir) + + path_dirs << "#{dir}/lib" + path_dirs << "#{dir}" unless Dir.glob("#{dir}/lib*.*").empty? + + dirnames = [] + if TkLib_Config["ActiveTcl"] + dirnames.concat ["ActiveTcl","activeTcl","Activetcl","activetcl"] + end + dirnames.concat ["TclTk","Tcl_Tk","Tcl-Tk","tcltk","tcl_tk","tcl-tk"] + + dirnames.each{|name| + path_dirs << "#{dir}/#{name}" if File.directory?("#{dir}/#{name}") + path_head << "#{dir}/#{name}" unless Dir.glob("#{dir}/#{name}[-89_]*").empty? + } + } + end + + [path_head, path_dirs] +end + +def find_macosx_framework + use_framework = is_macosx? && TkLib_Config["ActiveTcl"] + + use_framework ||= (tcl_hdr = with_config("tcl-framework-header")) + use_framework ||= (tk_hdr = with_config("tk-framework-header")) + tcl_hdr = nil unless tcl_hdr.kind_of? String + tk_hdr = nil unless tk_hdr.kind_of? String + TkLib_Config["tcl-framework-header"] = tcl_hdr + TkLib_Config["tk-framework-header"] = tk_hdr + + use_framework ||= (tcl_dir = with_config("tcl-framework-dir")) + tcl_dir = nil unless tcl_dir.kind_of? String + if !tcl_dir && tcl_hdr + # e.g. /Library/Frameworks/Tcl.framework/Headers + # ==> /Library/Frameworks/Tcl.framework + tcl_dir = File.dirname(tcl_hdr.strip.chomp('/')) + end + TkLib_Config["tcl-framework-dir"] = tcl_dir + + use_framework ||= (tk_dir = with_config("tk-framework-dir")) + tk_dir = nil unless tk_dir.kind_of? String + if !tk_dir && tk_hdr + # e.g. /Library/Frameworks/Tk.framework/Headers + # ==> /Library/Frameworks/Tk.framework + tk_dir = File.dirname(tk_hdr.strip.chomp('/')) + end + TkLib_Config["tk-framework-dir"] = tk_dir + + if tcl_dir && !tk_dir + tk_dir = File.join(File.dirname(tcl_dir), 'Tk.framework') + TkLib_Config["tk-framework-dir"] = tk_dir + elsif !tcl_dir && tk_dir + tcl_dir = File.join(File.dirname(tk_dir), 'Tcl.framework') + TkLib_Config["tcl-framework-dir"] = tcl_dir + end + if tcl_dir && tk_dir + TkLib_Config["tcltk-framework"] = File.dirname(tcl_dir) unless TkLib_Config["tcltk-framework"] + return [tcl_dir, tk_dir] + end + + # framework is disabled? + if with_config("tcltk-framework") == false || + enable_config("tcltk-framework") == false + return false + end + + use_framework ||= (framework_dir = with_config("tcltk-framework")) + if framework_dir.kind_of? String + TkLib_Config["tcltk-framework"] = framework_dir.strip.chomp('/') + return [File.join(TkLib_Config["tcltk-framework"], 'Tcl.framework'), + File.join(TkLib_Config["tcltk-framework"], 'Tk.framework')] + end + + unless enable_config("tcltk-framework", use_framework) || + enable_config("mac-tcltk-framework", use_framework) + TkLib_Config["tcltk-framework"] = false + return false + end + + paths = [ + #"~/Library/Frameworks", + "/Library/Frameworks", + "/Network/Library/Frameworks", "/System/Library/Frameworks" + ] + + paths.map{|dir| dir.strip.chomp('/')}.each{|dir| + next unless File.directory?(tcldir = File.join(dir, "Tcl.framework")) + next unless File.directory?(tkdir = File.join(dir, "Tk.framework")) + TkLib_Config["tcltk-framework"] = dir + return [tcldir, tkdir] + } + + nil +end + +def collect_tcltk_defs(tcl_defs_str, tk_defs_str) + conflicts = [ + 'PACKAGE_NAME', 'PACKAGE_TARNAME', 'PACKAGE_VERSION', + 'PACKAGE_STRING', 'PACKAGE_BUGREPORT' + ] + + begin + # Ruby 1.9.x or later + arch_config_h = RbConfig.expand($arch_hdrdir + "/ruby/config.h") + if File.exist?(arch_config_h) + keys = [] + IO.foreach(arch_config_h){|line| + if line =~ /^#define +([^ ]+)/ + keys << $1 + end + } + conflicts = keys + end + rescue + # ignore, use default + end + + if tcl_defs_str + tcl_defs = tcl_defs_str.split(/ ?-D/).map{|s| + s =~ /^([^=]+)(.*)$/ + [$1, $2] + } + else + tcl_defs = [] + end + + if tk_defs_str + tk_defs = tk_defs_str.split(/ ?-D/).map{|s| + s =~ /^([^=]+)(.*)$/ + [$1, $2] + } + else + tk_defs = [] + end + + defs = tcl_defs | tk_defs + + defs.delete_if{|name,value| + conflicts.include?(name) || + ( (vtcl = tcl_defs.assoc(name)) && (vtk = tk_defs.assoc(name)) && + vtcl != vtk ) + } + + defs.map{|ary| s = ary.join(''); (s.strip.empty?)? "": "-D" << s}.join(' ') +end + +def parse_tclConfig(file) + # check tclConfig.sh/tkConfig.sh + tbl = Hash.new{|h,k| h[k] = ""} + return tbl unless file + IO.foreach(file){|line| + line.strip! + next if line !~ /^([^\#=][^=]*)=(['"]|)(.*)\2$/ + key, val = $1, $3 + tbl[key] = val.gsub(/\$\{([^}]+)\}/){|s| + subst = $1 + (tbl[subst])? tbl[subst]: s + } rescue nil + } + tbl +end + +def get_libpath(lib_flag, lib_spec) + # get libpath fro {TCL,Tk}_LIB_FLAG and {TCL,Tk}_LIB_SPEC + libpath = lib_spec.gsub(/(#{lib_flag}|-L)/, "").strip +end + +def search_tclConfig(*paths) # list of lib-dir or [tcl-libdir, tk-libdir] + TkLib_Config["tclConfig_paths"] = [] + config_dir = [] + + paths.compact! + + fixed_tclConfig = ! paths.empty? + + paths.each{|path| + if path.kind_of?(Array) + config_dir << path + else + dirs = Dir.glob(path) + config_dir.concat(dirs.zip(dirs)) + end + } + + if is_win32? + if TkLib_Config["ActiveTcl"] + dirs = [] + if TkLib_Config["ActiveTcl"].kind_of?(String) + dirs << TkLib_Config["ActiveTcl"] + end + dirs.concat [ + "c:/ActiveTcl*/lib", "c:/Activetcl*/lib", + "c:/activeTcl*/lib", "c:/activetcl*/lib", + "c:/Tcl*/lib", "c:/tcl*/lib", + "c:/Program Files/ActiveTcl*/lib", "c:/Program Files/Activetcl*/lib", + "c:/Program Files/activeTcl*/lib", "c:/Program Files/activetcl*/lib", + "c:/Program Files/Tcl*/lib", "c:/Program Files/tcl*/lib", + "/ActiveTcl*/lib", "/Activetcl*/lib", + "/activeTcl*/lib", "/activetcl*/lib", + "/Tcl*/lib", "/tcl*/lib", + "/Program Files/ActiveTcl*/lib", "/Program Files/Activetcl*/lib", + "/Program Files/activeTcl*/lib", "/Program Files/activetcl*/lib", + "/Program Files/Tcl*/lib", "/Program Files/tcl*/lib" + ] + else + dirs = [ + "c:/Tcl*/lib", "c:/tcl*/lib", + "c:/Program Files/Tcl*/lib", "c:/Program Files/tcl*/lib", + "/Tcl*/lib", "/tcl*/lib", + "/Program Files/Tcl*/lib", "/Program Files/tcl*/lib" + ] + end + dirs.collect{|d| Dir.glob(d)}.flatten! + dirs |= dirs + + ENV['PATH'].split(';').each{|dir| + dirs << File.expand_path(File.join(dir, '..', 'lib')) + dirs << dir + dirs << File.expand_path(File.join(dir, '..')) + } + + config_dir.concat(dirs.zip(dirs)) + + elsif framework = find_macosx_framework() + config_dir.unshift(framework) + + else + if activeTcl = TkLib_Config['ActiveTcl'] + # check latest version at first + config_dir.concat(Dir.glob(activeTcl).sort.reverse) + end + + config_dir.concat [ + RbConfig::CONFIG['libdir'], + File.join(RbConfig::CONFIG['exec_prefix'], 'lib'), + File.join(RbConfig::CONFIG['prefix'], 'lib'), + "/usr/local/opt/lib", "/usr/local/pkg/lib", "/usr/local/share/lib", + "/usr/local/lib", "/usr/opt/lib", "/usr/pkg/lib", + "/usr/share/lib", "/usr/contrib/lib", "/usr/lib" + ] + + config_dir.concat [ + '/opt', '/pkg', '/share', + '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local', + '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr' + ].map{|dir| + Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}[87]*/lib') + Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}[87]*') + Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}/lib') + Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}') + }.flatten! + + ENV['PATH'].split(':').each{|dir| + config_dir << File.expand_path(File.join(dir, '..', 'lib')) + } + + # for MacOS X + #config_dir << "~/Library/Tcl" + #config_dir.concat(Dir.glob("~/Library/Tcl/*").sort.reverse) + config_dir << "/Library/Tcl" + config_dir.concat(Dir.glob("/Library/Tcl/*").sort.reverse) + config_dir << "/Network/Library/Tcl" + config_dir.concat(Dir.glob("/Network/Library/Tcl/*").sort.reverse) + config_dir << "/System/Library/Tcl" + config_dir.concat(Dir.glob("/System/Library/Tcl/*").sort.reverse) + [ + #"~/Library/Frameworks", + "/Library/Frameworks", + "/Network/Library/Frameworks", "/System/Library/Frameworks" + ].each{|framework| + config_dir << [File.expand_path(File.join(framework, 'Tcl.framework')), + File.expand_path(File.join(framework, 'Tk.framework'))] + } + end + + tclver, tkver = TkLib_Config['tcltkversion'] + conf = nil + + config_dir.map{|dir| + if dir.kind_of? Array + [dir[0].strip.chomp('/'), dir[1].strip.chomp('/')] + else + dir.strip.chomp('/') + end + }.each{|dir| + # print("check #{dir} ==>"); + if dir.kind_of? Array + tcldir, tkdir = dir + else + tcldir = tkdir = dir + end + + ['Config-shared.sh','config-shared.sh','Config.sh','config.sh'].each{|f| + tclpath = File.join(tcldir, 'tcl' << f) + tkpath = File.join(tkdir, 'tk' << f) + next if !File.exist?(tclpath) || !File.exist?(tkpath) + + # parse tclConfig.sh/tkConfig.sh + tclconf = parse_tclConfig(tclpath) + next if tclver && tclver !~ /^#{tclconf['TCL_MAJOR_VERSION']}(\.?)#{tclconf['TCL_MINOR_VERSION']}/ + tkconf = parse_tclConfig(tkpath) + next if tkver && tkver !~ /^#{tkconf['TK_MAJOR_VERSION']}(\.?)#{tkconf['TK_MINOR_VERSION']}/ + + # find tclConfig.sh & tkConfig.sh + conf = [tclconf, tkconf] unless conf + + # nativethread check + unless TkLib_Config["ruby_with_thread"] + tclconf['TCL_THREADS'] == '1' + puts "WARNIG: find #{tclpath.inspect}, but it WITH nativethread-support under ruby WITHOUT nativethread-support. So, ignore it." + TkLib_Config["tcltk-NG-path"] << File.dirname(tclpath) + next + end + + #return [tclpath, tkpath] + # print(" #{[tclpath, tkpath]}"); + TkLib_Config["tclConfig_paths"] << [tclpath, tkpath] + } + + # print("\n"); + } + + if TkLib_Config["tclConfig_paths"].empty? + [nil, nil] + else + # find tclConfig.sh and tkConfig.sh + TkLib_Config["tclConfig_info"], TkLib_Config["tkConfig_info"] = conf + TkLib_Config["tclConfig_paths"][0] + end +end + +def get_tclConfig(tclConfig_file, tclConfig_dir, tkConfig_dir) + use_tclConfig = (tclConfig_file != false) && + (tclConfig_dir != false) && (tkConfig_dir != false) + + tclConfig_file = nil unless tclConfig_file.kind_of? String + tclConfig_dir = nil unless tclConfig_dir.kind_of? String + tkConfig_dir = nil unless tkConfig_dir.kind_of? String + + unless tclConfig_dir + if tclConfig_file + tclConfig_dir = File.dirname(tclConfig_file) + elsif tkConfig_dir + tclConfig_dir = tkConfig_dir + end + end + tkConfig_dir ||= tclConfig_dir + + TkLib_Config["tclConfig-file"] = tclConfig_file + TkLib_Config["tclConfig-dir"] = tclConfig_dir + TkLib_Config["tkConfig-dir"] = tkConfig_dir + + unless use_tclConfig + puts("Don't use [tclConfig.sh, tkConfig.sh]") + else + puts("Search tclConfig.sh and tkConfig.sh.") + if tclConfig_dir + tclConfig, tkConfig = search_tclConfig([tclConfig_dir, tkConfig_dir]) + else + tclConfig, tkConfig = search_tclConfig() + end + # TclConfig_Info = TkLib_Config["tclConfig_info"] + # TkConfig_Info = TkLib_Config["tkConfig_info"] + + if tclConfig && tkConfig + puts("Use [tclConfig.sh,tkConfig.sh] == ['#{tclConfig}','#{tkConfig}']") + $LIBPATH |= [File.dirname(tclConfig)] + $LIBPATH |= [File.dirname(tkConfig)] + #TkLib_Config["tclConfig_paths"].each{|tclcfg, tkcfg| + # $LIBPATH |= [File.dirname(tclcfg)] | [File.dirname(tkcfg)] + #} + else + puts("Fail to find [tclConfig.sh, tkConfig.sh]") + end + end + + [tclConfig, tkConfig] +end + +def check_NG_path(path_list) + path_list.find_all{|path| not TkLib_Config["tcltk-NG-path"].include?(path) } +end + +def check_shlib_search_path(paths) + if !paths || paths.empty? + path_list = [] + + #if TkLib_Config["ActiveTcl"] + # path_list.concat Dir.glob(TkLib_Config["ActiveTcl"]).sort.reverse + #end + if TkLib_Config["ActiveTcl"].kind_of?(String) # glob path + path_list.concat Dir.glob(TkLib_Config["ActiveTcl"]).sort.reverse + end + + vers = get_shlib_versions + path_head, path_dirs = get_shlib_path_head + + path_list.concat vers.map{|ver| + path_head.map{|head| + if ver.empty? + head + "/lib" + else + dirs = [] + + if !Dir.glob(head + "-*").empty? + dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[89].*").empty? + dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[89][0-9]*").empty? + end + + if !Dir.glob(head + "[_-]*").empty? + dirs << head + "_#{ver}/lib" if !Dir.glob(head + "_[89].*").empty? + dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[89].*").empty? + dirs << head + "_#{ver.delete('.')}/lib" if !Dir.glob(head + "_[89][0-9]*").empty? + dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[89][0-9]*").empty? + end + + dirs + end + } + }.flatten! + + path_list.concat path_dirs + + else + # paths is a string with PATH environment style + path_list = paths.split((is_win32?)? ';': ':') + end + + path_list = check_NG_path(path_list) + + path_list.each{|path| $LIBPATH |= [path.strip] } +end + def find_tcl(tcllib, stubs, version, *opt_paths) - default_paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"] - default_paths << "/Tcl/lib" # default for ActiveTcl + puts "Search Tcl library" + default_paths = [] + default_paths.concat [ + RbConfig::CONFIG['libdir'], + File.join(RbConfig::CONFIG['exec_prefix'], 'lib'), + File.join(RbConfig::CONFIG['prefix'], 'lib'), + "/usr/local/lib", "/usr/pkg/lib", "/usr/contrib/lib", "/usr/lib" + ].find_all{|dir| File.directory?(dir)} + + default_paths.concat [ + "c:/Tcl/lib", "c:/Program Files/Tcl/lib", + "/Tcl/lib", "/Program Files/Tcl/lib" + ].find_all{|dir| File.directory?(dir)} + if (paths = opt_paths.compact).empty? - paths = default_paths + if TclConfig_Info['config_file_path'] + # use definisions on tclConfig.sh + TclConfig_Info['TCL_LIB_SPEC'].sub(TclConfig_Info['TCL_LIB_FLAG'],"").strip.sub("-L","") =~ /("|'|)([^"']+)\1/ + $LIBPATH |= [$2] unless $2.empty? + + unless stubs + #*** Probably, TCL_LIBS is a subset of TK_LIBS. *** + # $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS'] + # $DLDFLAGS << ' ' << TclConfig_Info['TCL_LIBS'] + $LDFLAGS << ' ' << TclConfig_Info['TCL_LIB_SPEC'] + return true + end + + if TclConfig_Info['TCL_SUPPORTS_STUBS'] == '0' || + TclConfig_Info['TCL_STUB_LIB_SPEC'].strip.empty? + puts "#{TclConfig_Info['config_file_path']} tells us that your Tcl/Tk library doesn't support stub." + return false + else + #*** Probably, TCL_LIBS is a subset of TK_LIBS. *** + # $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS'] + # $DLDFLAGS << ' ' << TclConfig_Info['TCL_LIBS'] + $LDFLAGS << ' ' << TclConfig_Info['TCL_STUB_LIB_SPEC'] + return true + end + end + + paths = check_NG_path(default_paths) end if stubs @@ -118,7 +667,7 @@ if version && ! version.empty? versions = [version] else - versions = %w[8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6] + versions = TkLib_Config['search_versions'] end if tcllib @@ -142,12 +691,62 @@ st end +def parse_TK_LIBS(tklibs) + sfx = "lib|shlib|dll|so" + re = /(("|')[^"']+\.(#{sfx})\2|[^"' ]+\.(#{sfx})|-l("|')[^"']+\5|-l[^" ]+)/#' + + tklibs.scan(re).map{|lib,| + if lib =~ /^("|')([^"]+)\.(#{sfx})\1/ + "\"-l#{$2}\"" + elsif lib =~ /([^" ]+)\.(#{sfx})/ + "-l#{$1}" + else + lib + end + }.join(' ') +end + def find_tk(tklib, stubs, version, *opt_paths) - default_paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"] - default_paths << "/Tcl/lib" # default for ActiveTcl + puts "Search Tk library" + default_paths = [] + default_paths.concat [ + RbConfig::CONFIG['libdir'], + File.join(RbConfig::CONFIG['exec_prefix'], 'lib'), + File.join(RbConfig::CONFIG['prefix'], 'lib'), + "/usr/local/lib", "/usr/pkg/lib", "/usr/contrib/lib", "/usr/lib" + ].find_all{|dir| File.directory?(dir)} + + default_paths.concat [ + "c:/Tcl/lib", "c:/Program Files/Tcl/lib", + "/Tcl/lib", "/Program Files/Tcl/lib" + ].find_all{|dir| File.directory?(dir)} + if (paths = opt_paths.compact).empty? - paths = default_paths + if TkConfig_Info['config_file_path'] + # use definisions on tkConfig.sh + TkConfig_Info['TK_LIB_SPEC'].sub(TkConfig_Info['TK_LIB_FLAG'],"").strip.sub("-L","") =~ /("|'|)([^"']+)\1/ + $LIBPATH |= [$2] unless $2.empty? + + unless stubs + $LDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS']) + # $DLDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS']) + $LDFLAGS << ' ' << TkConfig_Info['TK_LIB_SPEC'] + return true + end + + if TkConfig_Info['TK_STUB_LIB_SPEC'].strip.empty? + puts "#{TkConfig_Info['config_file_path']} tells us that your Tcl/Tk library doesn't support stub." + return false + else + $LDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS']) + # $DLDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS']) + $LDFLAGS << ' ' << TkConfig_Info['TK_STUB_LIB_SPEC'] + return true + end + end + + paths = check_NG_path(default_paths) end if stubs @@ -161,7 +760,7 @@ if version && ! version.empty? versions = [version] else - versions = %w[8.6 8.5 8.4 8.3 8.2 8.1 8.0 4.2] + versions = TkLib_Config['search_versions'] end if tklib @@ -173,7 +772,7 @@ find_library("#{lib}#{ver}g", func, *paths) or find_library("#{lib}#{ver.delete('.')}g", func, *paths) or find_library("tk#{ver}", func, *paths) or - find_library("tk#{ver.delete('.')}", func, *paths) or + find_library("tk#{ver.delete('.')}", func, *paths) or find_library("tk#{ver}g", func, *paths) or find_library("tk#{ver.delete('.')}g", func, *paths) } || (!version && find_library(lib, func, *paths)) @@ -185,17 +784,126 @@ st end +def find_tcltk_header(tclver, tkver) + base_dir = [] + + base_dir.concat [ + File.join(RbConfig::CONFIG['prefix'], 'include'), + "/usr/local/include", "/usr/pkg/include", "/usr/contrib/include", + "/usr/include" + ].find_all{|dir| File.directory?(dir)} + + base_dir.concat [ + "c:/Tcl/include", "c:/Program Files/Tcl/include", + "/Tcl/include", "/Program Files/Tcl/include" + ].find_all{|dir| File.directory?(dir)} + + if TclConfig_Info['TCL_INCLUDE_SPEC'] && + have_tcl_h = try_cpp('tcl.h', TclConfig_Info['TCL_INCLUDE_SPEC']) + $INCFLAGS << " " << TclConfig_Info['TCL_INCLUDE_SPEC'] + elsif have_tcl_h = have_header('tcl.h') + # find + else + if tclver && ! tclver.empty? + versions = [tclver] + else + versions = TkLib_Config['search_versions'] + end + paths = base_dir.dup + versions.each{|ver| + paths.concat(base_dir.map{|dir| + [dir + '/tcl' + ver, dir + '/tcl' + ver.delete('.')] + }.flatten) + } + have_tcl_h = find_header('tcl.h', *paths) + end + + if TkConfig_Info['TK_INCLUDE_SPEC'] && + have_tk_h = try_cpp('tk.h', TclConfig_Info['TK_INCLUDE_SPEC']) + $INCFLAGS << " " << TkConfig_Info['TK_INCLUDE_SPEC'] + elsif have_tk_h = have_header('tk.h') + # find + else + if tkver && ! tkver.empty? + versions = [tkver] + else + versions = TkLib_Config['search_versions'] + end + paths = base_dir.dup + versions.each{|ver| + paths.concat(base_dir.map{|dir| + [dir + '/tk' + ver, dir + '/tk' + ver.delete('.')] + }.flatten) + } + have_tk_h = find_header('tk.h', *paths) + end + + have_tcl_h && have_tk_h +end + +def setup_for_macosx_framework + # search directory of header files + if File.exist?(dir = File.join(TkLib_Config["tcltk-framework"], + 'Tcl.framework', 'Headers')) + TclConfig_Info['TCL_INCLUDE_SPEC'] = "-I#{dir} " + TclConfig_Info['TK_INCLUDE_SPEC'] = "-I#{File.join(TkLib_Config['tcltk-framework'], 'Tk.framework', 'Headers')} " + else + dir = Dir.glob(File.join(TkLib_Config["tcltk-framework"], + 'Tcl.framework', '*', 'Headers')) + TclConfig_Info['TCL_INCLUDE_SPEC'] = "-I#{dir[0]} " unless dir.empty? + TclConfig_Info['TK_INCLUDE_SPEC'] = "-I#{Dir.glob(File.join(TkLib_Config['tcltk-framework'], 'Tk.framework', '*', 'Headers'))[0]} " + end + + $LDFLAGS << ' -framework Tk -framework Tcl' + + if TkLib_Config["tcl-framework-header"] + TclConfig_Info['TCL_INCLUDE_SPEC'] = + "-I#{TkLib_Config["tcl-framework-header"]} " + end + if TkLib_Config["tk-framework-header"] + TkConfig_Info['TK_INCLUDE_SPEC'] = + "-I#{TkLib_Config["tk-framework-header"]} " + end +end + def find_X11(*opt_paths) - default_paths = - [ "/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", "/usr/openwin/lib" ] - paths = opt_paths.compact.concat(default_paths) + defaults = + [ "/usr/X11*/lib", "/usr/lib/X11*", "/usr/local/X11*", "/usr/openwin/lib" ] + paths = [] + opt_paths.compact.each{|path| paths.concat(Dir.glob(path.strip.chomp('/')))} + defaults.compact.each{|path| paths.concat(Dir.glob(path.strip.chomp('/')))} st = find_library("X11", "XOpenDisplay", *paths) unless st puts("Warning:: cannot find X11 library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options. If your Tcl/Tk don't require X11, please try --without-X11.") end st -end +end +def search_X_libraries + if TkConfig_Info['config_file_path'] + # use definitions on tkConfig.sh + if TkConfig_Info['TK_XINCLUDES'] && TkConfig_Info['TK_XLIBSW'] && + !TkConfig_Info['TK_XINCLUDES'].strip.empty? && + !TkConfig_Info['TK_XLIBSW'].strip.empty? + use_X = true && with_config("X11", (! is_win32?)) + else + use_X = false || with_config("X11", false) + end + else + # depend on configure options + use_X = with_config("X11", (! is_win32?)) + end + + if use_X + puts("Use X11 libraries.") + x11_idir, x11_ldir = dir_config("X11") + x11_ldir2 = with_config("X11-lib") + exit unless find_X11(x11_ldir2, x11_ldir) + end + + use_X +end + def pthread_check() tcl_major_ver = nil tcl_minor_ver = nil @@ -210,60 +918,36 @@ tcl_enable_thread = nil end - if (tclConfig = with_config("tclConfig-file")) + if TclConfig_Info['config_file_path'] if tcl_enable_thread == true - puts("Warning: --with-tclConfig-file option is ignored, because --enable-tcl-thread option is given.") + puts("Warning: definiton of tclConfig.sh is ignored, because --enable-tcl-thread option is given.") elsif tcl_enable_thread == false - puts("Warning: --with-tclConfig-file option is ignored, because --disable-tcl-thread option is given.") + puts("Warning: definition of tclConfig.sh is ignored, because --disable-tcl-thread option is given.") else # tcl-thread is unknown and tclConfig.sh is given - begin - open(tclConfig, "r") do |cfg| - while line = cfg.gets() - if line =~ /^\s*TCL_THREADS=(0|1)/ - tcl_enable_thread = ($1 == "1") - break - end - - if line =~ /^\s*TCL_MAJOR_VERSION=("|')(\d+)\1/ - tcl_major_ver = $2 - if tcl_major_ver =~ /^[1-7]$/ - tcl_enable_thread = false - break - end - if tcl_major_ver == "8" && tcl_minor_ver == "0" - tcl_enable_thread = false - break - end - end - - if line =~ /^\s*TCL_MINOR_VERSION=("|')(\d+)\1/ - tcl_minor_ver = $2 - if tcl_major_ver == "8" && tcl_minor_ver == "0" - tcl_enable_thread = false - break - end - end - end + if TclConfig_Info['TCL_THREADS'] + tcl_enable_thread = (TclConfig_Info['TCL_THREADS'] == "1") + else + tcl_major_ver = TclConfig_Info['TCL_MAJOR_VERSION'].to_i + tcl_minor_ver = TclConfig_Info['TCL_MINOR_VERSION'].to_i + if tcl_major_ver < 8 || (tcl_major_ver == 8 && tcl_minor_ver == 0) + tcl_enable_thread = false end + end - if tcl_enable_thread == nil - # not find definition - if tcl_major_ver - puts("Warning: '#{tclConfig}' doesn't include TCL_THREADS definition.") - else - puts("Warning: '#{tclConfig}' may not be a tclConfig file.") - end - tclConfig = false + if tcl_enable_thread == nil + # cannot find definition + if tcl_major_ver + puts("Warning: '#{TclConfig_Info['config_file_path']}' doesn't include TCL_THREADS definition.") + else + puts("Warning: '#{TclConfig_Info['config_file_path']}' may not be a tclConfig file.") end - rescue Exception - puts("Warning: fail to read '#{tclConfig}'!! --> ignore the file") tclConfig = false end end end - if tcl_enable_thread == nil && !tclConfig + if tcl_enable_thread == nil && !TclConfig_Info['config_file_path'] # tcl-thread is unknown and tclConfig is unavailable begin try_run_available = try_run("int main() { exit(0); }") @@ -272,12 +956,12 @@ puts(%Q'\ ***************************************************************************** ** -** PTHREAD SUPPORT CHECK WARNING: +** NATIVETHREAD SUPPORT CHECK WARNING: ** -** We cannot check the consistency of pthread support between Ruby -** and the Tcl/Tk library in your environment (are you perhaps -** cross-compiling?). If pthread support for these 2 packages is -** inconsistent you may find you get errors when running Ruby/Tk +** We cannot check the consistency of nativethread support between +** Ruby and the Tcl/Tk library in your environment (are you perhaps +** cross-compiling?). If nativethread support for these 2 packages +** is inconsistent you may find you get errors when running Ruby/Tk ** (e.g. hangs or segmentation faults). We strongly recommend ** you to check the consistency manually. ** @@ -291,7 +975,7 @@ # tcl-thread is unknown if try_run(< -int main() { +int main() { Tcl_Interp *ip; ip = Tcl_CreateInterp(); exit((Tcl_Eval(ip, "set tcl_platform(threaded)") == TCL_OK)? 0: 1); @@ -310,26 +994,27 @@ end # check pthread mode - if (macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"')) + if (TkLib_Config["ruby_with_thread"]) # ruby -> enable unless tcl_enable_thread # ruby -> enable && tcl -> disable puts(%Q'\ ***************************************************************************** ** -** PTHREAD SUPPORT MODE WARNING: +** NATIVETHREAD SUPPORT MODE WARNING: ** -** Ruby is compiled with --enable-pthread, but your Tcl/Tk library -** seems to be compiled without pthread support. Although you can -** create the tcltklib library, this combination may cause errors -** (e.g. hangs or segmentation faults). If you have no reason to -** keep the current pthread support status, we recommend you reconfigure -** and recompile the libraries so that both or neither support pthreads. +** Ruby is compiled with --enable-pthread, but your Tcl/Tk library +** seems to be compiled without nativethread support. Although you can +** create the tcltklib library, this combination may cause errors (e.g. +** hangs or segmentation faults). If you have no reason to keep the +** current nativethread support status, we recommend you reconfigure and +** recompile the libraries so that both or neither support nativethreads. ** -** If you want change the status of pthread support, please recompile -** Ruby without "--enable-pthread" configure option or recompile Tcl/Tk -** with "--enable-threads" configure option (if your Tcl/Tk is later -** than or equal to Tcl/Tk 8.1). +** If you want change the status of nativethread support, please recompile +** Ruby without "--enable-pthread" configure option (If you use Ruby 1.9.x +** or later, you cannot remove this option, because it requires native- +** thread support.) or recompile Tcl/Tk with "--enable-threads" configure +** option (if your Tcl/Tk is later than or equal to Tcl/Tk 8.1). ** ***************************************************************************** ') @@ -351,13 +1036,13 @@ puts(%Q'\ ***************************************************************************** ** -** PTHREAD SUPPORT MODE ERROR: +** NATIVETHREAD SUPPORT MODE ERROR: ** -** Ruby is not compiled with --enable-pthread, but your Tcl/Tk -** library seems to be compiled with pthread support. This +** Ruby is not compiled with --enable-pthread, but your Tcl/Tk +** library seems to be compiled with nativethread support. This ** combination may cause frequent hang or segmentation fault ** errors when Ruby/Tk is working. We recommend that you NEVER -** create the library with such a combination of pthread support. +** create the library with such a combination of nativethread support. ** ** Please recompile Ruby with the "--enable-pthread" configure option ** or recompile Tcl/Tk with the "--disable-threads" configure option. @@ -374,44 +1059,132 @@ end end -tclver, tkver = check_tcltk_version(tcltk_version) +############################################################## +# main +############################################################## +# check header files +have_func("ruby_native_thread_p", "ruby.h") +have_func("rb_errinfo", "ruby.h") +have_func("rb_safe_level", "ruby.h") +have_func("rb_hash_lookup", "ruby.h") +have_func("rb_proc_new", "ruby.h") -if ( tcltk_framework || - ( have_header("tcl.h") && have_header("tk.h") && - ( !use_X || find_X11(x11_ldir2, x11_ldir) ) && - find_tcl(tcllib, stubs, tclver, *tcl_ldir_list) && - find_tk(tklib, stubs, tkver, *tk_ldir_list) ) ) - $CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs - $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM +have_struct_member("struct RArray", "ptr", "ruby.h") +have_struct_member("struct RArray", "len", "ruby.h") - if tcltk_framework - if tcl_framework_header - $CPPFLAGS += " -I#{tcl_framework_header}" - else - $CPPFLAGS += " -I#{tcltk_framework}/Tcl.framework/Headers" - end +# check libraries +unless is_win32? + have_library("nsl", "t_open") + have_library("socket", "socket") + have_library("dl", "dlopen") + have_library("m", "log") +end +$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM - if tk_framework_header - $CPPFLAGS += " -I#{tk_framework_header}" - else - $CPPFLAGS += " -I#{tcltk_framework}/Tk.framework/Headers" - end +# Does ruby have nativethread ? +TkLib_Config["ruby_with_thread"] = + macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"') - $LDFLAGS += ' -framework Tk -framework Tcl' +#--------------------------------------------------- +# check requirement of Tcl/tk version +tcltk_version = with_config("tcltkversion") +tclver, tkver = + TkLib_Config["tcltkversion"] = check_tcltk_version(tcltk_version) +puts("Specified Tcl/Tk version is #{[tclver, tkver]}") if tclver && tkver + +# use ActiveTcl ? +#if activeTcl = with_config("ActiveTcl") +if activeTcl = with_config("ActiveTcl", true) + puts("Use ActiveTcl libraries (if available).") + activeTcl = '/opt/ActiveTcl*/lib' unless activeTcl.kind_of? String +end +TkLib_Config["ActiveTcl"] = activeTcl + +# enable Tcl/Tk stubs? +=begin +if TclConfig_Info['TCL_STUB_LIB_SPEC'] && TkConfig_Info['TK_STUB_LIB_SPEC'] && + !TclConfig_Info['TCL_STUB_LIB_SPEC'].strip.empty? && + !TkConfig_Info['TK_STUB_LIB_SPEC'].strip.empty? + stubs = true + unless (st = enable_config("tcltk-stubs")).nil? + stubs &&= st end + unless (st = with_config("tcltk-stubs")).nil? + stubs &&= st + end +else + stubs = enable_config("tcltk-stubs") || with_config("tcltk-stubs") +end +=end +stubs = enable_config("tcltk-stubs") || with_config("tcltk-stubs") +if (TkLib_Config["tcltk-stubs"] = stubs) + puts("Compile with Tcl/Tk stubs.") + $CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' +end - if stubs or pthread_check - # create Makefile +# get tclConfig.sh/tkConfig.sh +TkLib_Config["tcltk-NG-path"] = [] +tclcfg, tkcfg = get_tclConfig(with_config("tclConfig-file", true), + with_config("tclConfig-dir", true), + with_config("tkConfig-dir", true)) +TclConfig_Info = TkLib_Config["tclConfig_info"] || {} +TkConfig_Info = TkLib_Config["tkConfig_info"] || {} +TclConfig_Info['config_file_path'] = tclcfg +TkConfig_Info['config_file_path'] = tkcfg - # for SUPPORT_STATUS - $INSTALLFILES ||= [] - $INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"] +# check tk_shlib_search_path +check_shlib_search_path(with_config('tk-shlib-search-path')) - have_func("rb_hash_lookup", "ruby.h") +# search X libraries +use_X = search_X_libraries - # create - $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"] - $defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"] - create_makefile("tcltklib") - end +# set TCL_DEFS and TK_DEFS +# $CPPFLAGS += " #{TclConfig_Info['TCL_DEFS']}" +# $CPPFLAGS += " #{TkConfig_Info['TK_DEFS']}" +$CPPFLAGS += collect_tcltk_defs(TclConfig_Info['TCL_DEFS'], TkConfig_Info['TK_DEFS']) + +# MacOS X Frameworks? +if TkLib_Config["tcltk-framework"] + puts("Use MacOS X Frameworks.") + setup_for_macosx_framework end + +# search Tcl/Tk libraries +tk_idir, tk_ldir = dir_config("tk") if with_config('tk') +tcl_idir, tcl_ldir = dir_config("tcl") if with_config('tcl') + +tk_ldir2 = with_config("tk-lib") +tcl_ldir2 = with_config("tcl-lib") + +tk_ldir_list = [tk_ldir2, tk_ldir] +tcl_ldir_list = [tcl_ldir2, tcl_ldir] + +tklib = with_config("tklib") +tcllib = with_config("tcllib") + +TclConfig_Info['TCL_INCLUDE_SPEC'] = "-I#{tcl_idir.quote}" if tcl_idir +TkConfig_Info['TK_INCLUDE_SPEC'] = "-I#{tk_idir.quote}" if tk_idir + +#--------------------------------------------------- + +if (TkLib_Config["tcltk-framework"] || + ( find_tcltk_header(tclver, tkver) && + find_tcl(tcllib, stubs, tclver, *tcl_ldir_list) && + find_tk(tklib, stubs, tkver, *tk_ldir_list) ) ) && + (stubs || pthread_check()) + # create Makefile + + # for SUPPORT_STATUS + $INSTALLFILES ||= [] + $INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"] + + # create + $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"] + $defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"] + + create_makefile("tcltklib") + + puts "Find Tcl/Tk libraries. Make tcltklib.so which needs for Ruby/Tk." +else + puts "Can't find proper Tcl/Tk libraries. So, can't make tcltklib.so which needs for Ruby/Tk." +end Index: ext/tk/README.ActiveTcl =================================================================== --- ext/tk/README.ActiveTcl (revision 23917) +++ ext/tk/README.ActiveTcl (working copy) @@ -3,9 +3,22 @@ # see # +First of all, please try to configure without any options. +"extconf.rb" searches ActiveTcl as default action. +If you have ActiveTcl and standard (or your own) Tcl/Tk on your +environment and don't want to use ActiveTcl on your Ruby/Tk, please +use --without-ActiveTcl option. + +When "extconf.rb" fails to find your ActiveTcl libraries, please try +the followings. + If you want to use ActiveTcl binary package as the Tcl/Tk libraries, please use the following configure options. + --with-ActiveTcl= + ( When without argument; no ; only '--with-ActiveTcl', + it same to '--with-ActiveTcl=/opt/ActiveTcl*/lib' ) + --with-tcl-dir= --with-tk-dir= Index: ext/tk/tkutil/tkutil.c =================================================================== --- ext/tk/tkutil/tkutil.c (revision 23917) +++ ext/tk/tkutil/tkutil.c (working copy) @@ -7,13 +7,14 @@ ************************************************/ -#define TKUTIL_RELEASE_DATE "2008-05-23" +#define TKUTIL_RELEASE_DATE "2009-07-01" #include "ruby.h" -#ifdef HAVE_RUBY_SIGNAL_H -#include "ruby/signal.h" +#ifdef RUBY_VM +static VALUE rb_thread_critical; /* dummy */ #else +/* On Ruby 1.8.x, use rb_thread_critical (defined at rubysig.h) */ #include "rubysig.h" #endif #ifdef HAVE_RUBY_ST_H @@ -59,6 +60,9 @@ /*************************************/ +#if defined(HAVE_RB_OBJ_INSTANCE_EXEC) && !defined(RUBY_VM) +extern VALUE rb_obj_instance_exec _((int, VALUE*, VALUE)); +#endif static VALUE tk_s_new(argc, argv, klass) int argc; @@ -1074,7 +1078,19 @@ rb_eArgError, 0); } +static VALUE +tcl2rb_num_or_nil(self, value) + VALUE self; + VALUE value; +{ + rb_check_type(value, T_STRING); + if (RSTRING_LEN(value) == 0) return Qnil; + + return tkstr_to_number(value); +} + + /*************************************/ #define CBSUBST_TBL_MAX (256) @@ -1781,6 +1797,7 @@ rb_define_singleton_method(mTK, "number", tcl2rb_number, 1); rb_define_singleton_method(mTK, "string", tcl2rb_string, 1); rb_define_singleton_method(mTK, "num_or_str", tcl2rb_num_or_str, 1); + rb_define_singleton_method(mTK, "num_or_nil", tcl2rb_num_or_nil, 1); rb_define_method(mTK, "_toUTF8", tk_toUTF8, -1); rb_define_method(mTK, "_fromUTF8", tk_fromUTF8, -1); @@ -1794,6 +1811,7 @@ rb_define_method(mTK, "number", tcl2rb_number, 1); rb_define_method(mTK, "string", tcl2rb_string, 1); rb_define_method(mTK, "num_or_str", tcl2rb_num_or_str, 1); + rb_define_method(mTK, "num_or_nil", tcl2rb_num_or_nil, 1); /* --------------------- */ rb_global_variable(&ENCODING_NAME_UTF8); Index: ext/tk/MANUAL_tcltklib.eng =================================================================== --- ext/tk/MANUAL_tcltklib.eng (revision 23917) +++ ext/tk/MANUAL_tcltklib.eng (working copy) @@ -140,8 +140,7 @@ [module methods] get_version() : return an array of major, minor, release-type number, - : number, release-type name, and patchlevel of current - : Tcl/Tk library. + : and patchlevel of current Tcl/Tk library. mainloop(check_root = true) : Starts the eventloop. If 'check_root' is true, this method @@ -354,6 +353,11 @@ : to _eval and regist the command once, after that, the : command can be called by _invoke. + _cancel_eval(str) + _cancel_eval_unwind(str) + : (Tcl/Tk8.6 or later) + : Call Tcl_CancelEval() function, and cancel evaluation. + _toUTF8(str, encoding=nil) _fromUTF8(str, encoding=nil) : Call the function (which is internal function of Tcl/Tk) to