diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-04 01:44:12 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-04 01:44:12 +0000 |
commit | 458d524adb02f2adfd835f9ce748248fd71cdd78 (patch) | |
tree | a0ce5e93d1f863c7dc6cc8b1fa6818f5d2a6dc54 /ext | |
parent | 64cc52ed57b894d80a76d754af6d49b53e439a07 (diff) |
* ext/tk/lib/tk/dialog.rb: fixed typo.
* ext/tk/lib/tkextlib/tktable/tktable.rb: added Tk::TkTable#selection_present.
* ext/tk/sample/tkextlib/vu/dial_demo.rb: renamed as well as vu_demo.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/tk/ChangeLog.tkextlib | 14 | ||||
-rw-r--r-- | ext/tk/lib/tk/dialog.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tktable/tktable.rb | 3 | ||||
-rw-r--r-- | ext/tk/sample/tkextlib/vu/dial.rb | 113 |
4 files changed, 15 insertions, 117 deletions
diff --git a/ext/tk/ChangeLog.tkextlib b/ext/tk/ChangeLog.tkextlib index dc9799660c..8638975e8d 100644 --- a/ext/tk/ChangeLog.tkextlib +++ b/ext/tk/ChangeLog.tkextlib @@ -1,3 +1,7 @@ +2005-04-04 ocean <ocean@ruby-lang.org> + + * lib/tkextlib/tktable/tktable.rb: added Tk::TkTable#selection_present. + 2005-04-02 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> * lib/tkextlib/treectrl/tktreectrl.rb: support TreeCtrl's cvs head. @@ -26,12 +30,12 @@ 2005-03-31 ocean <ocean@ruby-lang.org> - * ext/tk/sample/tkextlib/treectrl/demo.rb: should use Hash#index. + * sample/tkextlib/treectrl/demo.rb: should use Hash#index. - * ext/tk/sample/tkextlib/treectrl/demo.rb: TkImage was not + * sample/tkextlib/treectrl/demo.rb: TkImage was not cached properly. - * ext/tk/sample/tkextlib/treectrl/random.rb: fixed typo. + * sample/tkextlib/treectrl/random.rb: fixed typo. 2005-03-31 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> @@ -87,6 +91,10 @@ * sample/tkextlib/blt/pareto.rb: ditto. +2005-03-28 ocean <ocean@ruby-lang.org> + + * lib/tkextlib/iwidgets/notebook.rb: fixed typo. + 2005-03-26 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> * lib/tkextlib/blt.rb: add commands for zooming. diff --git a/ext/tk/lib/tk/dialog.rb b/ext/tk/lib/tk/dialog.rb index 212226b4d4..d468c6e8b1 100644 --- a/ext/tk/lib/tk/dialog.rb +++ b/ext/tk/lib/tk/dialog.rb @@ -51,7 +51,7 @@ class TkDialogObj < TkWindow } end # @config = 'after idle {' + @config + '};' if @config != "" - @config = array2tk_list['after', 'idle', @config] << ';' if @config != "" + @config = array2tk_list(['after', 'idle', @config]) << ';' if @config != "" end private :_set_button_config diff --git a/ext/tk/lib/tkextlib/tktable/tktable.rb b/ext/tk/lib/tkextlib/tktable/tktable.rb index da78ca3fbb..dff44bf10d 100644 --- a/ext/tk/lib/tkextlib/tktable/tktable.rb +++ b/ext/tk/lib/tkextlib/tktable/tktable.rb @@ -547,6 +547,9 @@ class Tk::TkTable def selection_include?(idx) bool(tk_send('selection', 'includes', tagid(idx))) end + def selection_present + bool(tk_send('selection', 'present')) + end def selection_set(first, last=None) tk_send('selection', 'set', tagid(first), tagid(last)) self diff --git a/ext/tk/sample/tkextlib/vu/dial.rb b/ext/tk/sample/tkextlib/vu/dial.rb deleted file mode 100644 index 09bd3e9186..0000000000 --- a/ext/tk/sample/tkextlib/vu/dial.rb +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env ruby - -require 'tk' -require 'tkextlib/vu/dial' - -####################################### - -v_volume = TkVariable.new -v_speed = TkVariable.new -v_dir = TkVariable.new -v_rot = TkVariable.new -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, - :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, - :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, - :variable=>v_dir) - -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, - :resolution=>0.05, :tickinterval=>2, - :minortickinterval=>0.5, :radius=>20, - :dialcolor=>'red2', :activebackground=>'red', - :variable=>v_rot) - -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', - :variable=>v_rot) - -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, - :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', - :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', - :needletype=>:arc, :relief=>:ridge) - -f_btns = TkFrame.new -f_sep = TkFrame.new(:height=>2, :relief=>:sunken, :bd=>1) - - -v_volume.value = -0.1 -v_speed.value = 500 - -update = TkTimer.new(proc{v_speed.numeric}, -1, proc{ - if v_volume == volume[:to] - v_volume.numeric = volume[:from] - else - v_volume.numeric += volume[:resolution] - end - }) - -b_start = TkButton.new(:text=>"Start", :command=>proc{update.start}) -b_stop = TkButton.new(:text=>"Stop", :command=>proc{update.stop}) -b_exit = TkButton.new(:text=>"Exit", :command=>proc{exit}) - -Tk.grid(b_start, :in=>f_btns, :sticky=>:ew, :padx=>4, :pady=>4) -Tk.grid(b_stop, :in=>f_btns, :sticky=>:ew, :padx=>4, :pady=>4) -f_btns.grid_columnconfigure(0, :weight=>1) - -Tk.grid(f_btns, speed, volume, :sticky=>:news) -Tk.grid(f_sep, '-', '-', :sticky=>:news) -Tk.grid(fwd, rev, d1, :sticky=>:news) -Tk.grid(small, large, d2, :sticky=>:news) -Tk.grid(turn, scale, d3, :sticky=>:news) - -Tk.grid(b_exit, '-', '-', :sticky=>:ew, :padx=>4, :pady=>4) - -Tk.root.grid_columnconfigure(0, :weight=>1) -Tk.root.grid_columnconfigure(1, :weight=>1) -Tk.root.grid_columnconfigure(2, :weight=>1) - -Tk.root.grid_rowconfigure(0, :weight=>1) -Tk.root.grid_rowconfigure(2, :weight=>1) -Tk.root.grid_rowconfigure(3, :weight=>1) -Tk.root.grid_rowconfigure(4, :weight=>1) - - -Tk.mainloop |