diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-02 08:02:39 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-02 08:02:39 +0000 |
commit | 21df665098bb29493a7b5196eb8fd1c48995314c (patch) | |
tree | 118d9454ef902cedfe7f638e6ea4220d618e2a72 /ext/tk/lib/tkextlib | |
parent | 373282f6656d3d3d989d261e7a95f8e81b5c9712 (diff) | |
download | ruby-21df665098bb29493a7b5196eb8fd1c48995314c.tar.gz |
* ext/tk/lib/tk.rb: forgot to update RELEASE_DATE
* ext/tk/lib/tk/variable.rb: fix namespace trouble when autoloading
* ext/tk/lib/tk/palette.rb: define Tcl variable 'tkPalette' as global
* ext/tk/lib/tk/dialog.rb: use array2tk_list method when calling
Tk.ip_eval.
* ext/tk/lib/tk/autoload.rb: add autoload entry 'TkDialogObj' and
'TkWarningObj'
* ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: support TreeCtrl's cvs
head.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkextlib')
-rw-r--r-- | ext/tk/lib/tkextlib/SUPPORT_STATUS | 3 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 84 |
2 files changed, 78 insertions, 9 deletions
diff --git a/ext/tk/lib/tkextlib/SUPPORT_STATUS b/ext/tk/lib/tkextlib/SUPPORT_STATUS index 085de3bdf6..bf4572b15f 100644 --- a/ext/tk/lib/tkextlib/SUPPORT_STATUS +++ b/ext/tk/lib/tkextlib/SUPPORT_STATUS @@ -78,7 +78,8 @@ BLT 2.4z http://sourceforge.net/projects/blt (http://raa.ruby-lang.org/) ==> blt -TkTreeCtrl 1.1 http://tktreectrl.sourceforge.net/ ==> treectrl +TkTreeCtrl CVS/Hd(2005-03-25) + http://tktreectrl.sourceforge.net/ ==> treectrl diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb index 655ad87185..d183dc6df8 100644 --- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb +++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb @@ -78,10 +78,12 @@ class Tk::TreeCtrl::NotifyEvent [ ?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 ] @@ -106,6 +108,27 @@ class Tk::TreeCtrl::NotifyEvent [ ?o, proc{|val| TkComm.tk_tcl2ruby(val)} ], + [ ?x, proc{|val| + begin + inf = {} + Hash[*(TkComm.list(val))].each{|k, v| + if keyinfo = KEY_TBL.assoc(k[0]) + if cmd = PROC_TBL.assoc(keyinfo[1]) + begin + new_v = cmd.call(v) + v = new_v + rescue + end + end + end + inf[k] = v + } + inf + rescue + val + end + } ], + nil ] @@ -434,12 +457,15 @@ module Tk::TreeCtrl::ConfigMethod end def notify_cget(win, pattern, option) + pattern = "<#{pattern}>" itemconfigure(['notify', [win, pattern]], option) end def notify_configure(win, pattern, slot, value=None) + pattern = "<#{pattern}>" itemconfigure(['notify', [win, pattern]], slot, value) end def notify_configinfo(win, pattern, slot=nil) + pattern = "<#{pattern}>" itemconfiginfo(['notify', [win, pattern]], slot) end alias current_notify_configinfo notify_configinfo @@ -485,7 +511,7 @@ class Tk::TreeCtrl def __boolval_optkeys [ 'showbuttons', 'showheader', 'showlines', 'showroot', - 'showrootbutton', + 'showrootbutton', 'showrootlines', ] end private :__boolval_optkeys @@ -1089,7 +1115,7 @@ class Tk::TreeCtrl end #def notify_bind_append(obj, event, cmd=Proc.new, *args) - # _bind([@path, 'notify', 'bind', obj], event, cmd, *args) + # _bind_append([@path, 'notify', 'bind', obj], event, cmd, *args) # self #end def notify_bind_append(obj, event, *args) @@ -1099,7 +1125,7 @@ class Tk::TreeCtrl else cmd = Proc.new end - _bind([@path, 'notify', 'bind', obj], event, cmd, *args) + _bind_append([@path, 'notify', 'bind', obj], event, cmd, *args) self end @@ -1120,11 +1146,22 @@ class Tk::TreeCtrl list(tk_send('notify', 'eventnames')) end - def notify_generate(pattern, char_map=None) - tk_send('notify', 'generate', pattern, char_map) + def notify_generate(pattern, char_map=None, percents_cmd=None) + pattern = "<#{pattern}>" + tk_send('notify', 'generate', pattern, char_map, percents_cmd) self end + def notify_install(pattern, percents_cmd=nil, &b) + pattern = "<#{pattern}>" + percents_cmd = Proc.new(&b) if !percents_cmd && b + if percents_cmd + procedure(tk_send('notify', 'install', pattern, percents_cmd)) + else + procedure(tk_send('notify', 'install', pattern)) + end + end + def notify_install_detail(event, detail, percents_cmd=nil, &b) percents_cmd = Proc.new(&b) if !percents_cmd && b if percents_cmd @@ -1143,8 +1180,36 @@ class Tk::TreeCtrl end end - def notify_linkage(event, detail=None) - tk_send('notify', 'linkage', event, detail) + def notify_linkage(pattern, detail=None) + if detail != None + tk_send('notify', 'linkage', pattern, detail) + else + begin + if pattern.to_s.index(?-) + # TreeCtrl 1.1 format? + begin + tk_send('notify', 'linkage', "<#{pattern}>") + rescue + # TreeCtrl 1.0? + tk_send('notify', 'linkage', pattern) + end + else + # TreeCtrl 1.0 format? + begin + tk_send('notify', 'linkage', pattern) + rescue + # TreeCtrl 1.1? + tk_send('notify', 'linkage', "<#{pattern}>") + end + end + end + end + end + + def notify_uninstall(pattern) + pattern = "<#{pattern}>" + tk_send('notify', 'uninstall', pattern) + self end def notify_uninstall_detail(event, detail) @@ -1884,6 +1949,9 @@ module Tk::TreeCtrl::BindCallback end class << Tk::TreeCtrl::BindCallback + def percentsCmd(*args) + tk_call('::TreeCtrl::PercentsCmd', *args) + end def cursorCheck(w, x, y) tk_call('::TreeCtrl::CursorCheck', w, x, y) end @@ -1999,7 +2067,7 @@ class << Tk::TreeCtrl::BindCallback end def entryOpen(w, item, col, elem) - tk_call('::::TreeCtrl::EntryOpen', w, item, col, elem) + tk_call('::TreeCtrl::EntryOpen', w, item, col, elem) end def entryExpanderOpen(w, item, col, elem) tk_call('::TreeCtrl::EntryExpanderOpen', w, item, col, elem) |