diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-25 06:51:21 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-25 06:51:21 +0000 |
commit | 74efef0be85061c3c9e24ee0cfdf5f83c2af9a22 (patch) | |
tree | 2db7641808ab4f14daf322ee4eae9786b372dc35 /ext/tk | |
parent | 23de09d6bb2005efe55b08e90875ff6a6c6f8976 (diff) |
Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r-- | ext/tk/lib/tk.rb | 13 | ||||
-rw-r--r-- | ext/tk/lib/tk/scale.rb | 13 | ||||
-rw-r--r-- | ext/tk/lib/tk/scrollbar.rb | 13 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/ted.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/unix_dnd.rb | 6 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/version.rb | 2 | ||||
-rw-r--r-- | ext/tk/sample/ttk_wrapper.rb | 4 |
8 files changed, 43 insertions, 18 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index a5cb8cb67d..2aafcfecc3 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -4799,8 +4799,15 @@ class TkWindow<TkObject tk_call_without_enc(cmd, @path) keys = __check_available_configure_options(keys) unless keys.empty? - tk_call_without_enc('destroy', @path) - tk_call_without_enc(cmd, @path, *hash_kv(keys, true)) + begin + tk_call_without_enc('destroy', @path) + rescue + # cannot destroy + configure(keys) + else + # re-create widget + tk_call_without_enc(cmd, @path, *hash_kv(keys, true)) + end end end end @@ -5341,7 +5348,7 @@ TkWidget = TkWindow #Tk.freeze module Tk - RELEASE_DATE = '2008-04-15'.freeze + RELEASE_DATE = '2008-04-18'.freeze autoload :AUTO_PATH, 'tk/variable' autoload :TCL_PACKAGE_PATH, 'tk/variable' diff --git a/ext/tk/lib/tk/scale.rb b/ext/tk/lib/tk/scale.rb index bf2791ec55..7e758d92f4 100644 --- a/ext/tk/lib/tk/scale.rb +++ b/ext/tk/lib/tk/scale.rb @@ -26,9 +26,16 @@ class Tk::Scale<TkWindow tk_call_without_enc(self.class::TkCommandNames[0], @path) keys = __check_available_configure_options(keys) unless keys.empty? - tk_call_without_enc('destroy', @path) - tk_call_without_enc(self.class::TkCommandNames[0], @path, - *hash_kv(keys, true)) + begin + tk_call_without_enc('destroy', @path) + rescue + # cannot destroy + configure(keys) + else + # re-create widget + tk_call_without_enc(self.class::TkCommandNames[0], @path, + *hash_kv(keys, true)) + end end end end diff --git a/ext/tk/lib/tk/scrollbar.rb b/ext/tk/lib/tk/scrollbar.rb index 521fc7e400..87db46a9f9 100644 --- a/ext/tk/lib/tk/scrollbar.rb +++ b/ext/tk/lib/tk/scrollbar.rb @@ -31,9 +31,16 @@ class Tk::Scrollbar<TkWindow tk_call_without_enc(self.class::TkCommandNames[0], @path) keys = __check_available_configure_options(keys) unless keys.empty? - tk_call_without_enc('destroy', @path) - tk_call_without_enc(self.class::TkCommandNames[0], @path, - *hash_kv(keys, true)) + begin + tk_call_without_enc('destroy', @path) + rescue + # cannot destroy + configure(keys) + else + # re-create widget + tk_call_without_enc(self.class::TkCommandNames[0], @path, + *hash_kv(keys, true)) + end end end end diff --git a/ext/tk/lib/tkextlib/blt/ted.rb b/ext/tk/lib/tkextlib/blt/ted.rb index 39495842b4..8b727c1eec 100644 --- a/ext/tk/lib/tkextlib/blt/ted.rb +++ b/ext/tk/lib/tkextlib/blt/ted.rb @@ -34,7 +34,7 @@ module Tk::BLT private :itemconfiginfo, :current_itemconfiginfo def cget(master, option) - itemconfigure(master, slot, value) + itemcget(master, option) end def configure(master, slot, value=None) itemconfigure(master, slot, value) diff --git a/ext/tk/lib/tkextlib/blt/unix_dnd.rb b/ext/tk/lib/tkextlib/blt/unix_dnd.rb index 3130c1e56f..7a994233a2 100644 --- a/ext/tk/lib/tkextlib/blt/unix_dnd.rb +++ b/ext/tk/lib/tkextlib/blt/unix_dnd.rb @@ -34,7 +34,7 @@ module Tk::BLT private :itemconfiginfo, :current_itemconfiginfo def cget(win, option) - itemconfigure(['cget', win], slot, value) + itemcget(['cget', win], option) end def configure(win, slot, value=None) itemconfigure(['configure', win], slot, value) @@ -46,8 +46,8 @@ module Tk::BLT current_itemconfiginfo(['configure', win], slot) end - def tokwn_cget(win, option) - itemconfigure(['token', 'cget', win], slot, value) + def token_cget(win, option) + itemcget(['token', 'cget', win], option) end def token_configure(win, slot, value=None) itemconfigure(['token', 'configure', win], slot, value) diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb index b72b157dcd..d025bc4086 100644 --- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb +++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb @@ -518,7 +518,8 @@ module Tk::TreeCtrl::ConfigMethod def notify_cget(win, pattern, option) pattern = "<#{pattern}>" - itemconfigure(['notify', [win, pattern]], option) + # "notify" doesn't have cget subcommand. + current_itemconfiginfo(['notify', [win, pattern]])[option.to_s] end def notify_configure(win, pattern, slot, value=None) pattern = "<#{pattern}>" @@ -528,7 +529,10 @@ module Tk::TreeCtrl::ConfigMethod pattern = "<#{pattern}>" itemconfiginfo(['notify', [win, pattern]], slot) end - alias current_notify_configinfo notify_configinfo + def current_notify_configinfo(tagOrId, slot=nil) + pattern = "<#{pattern}>" + current_itemconfiginfo(['notify', [win, pattern]], slot) + end def style_cget(tagOrId, option) itemcget(['style', tagOrId], option) diff --git a/ext/tk/lib/tkextlib/version.rb b/ext/tk/lib/tkextlib/version.rb index 0fc1136e53..08cccf56c2 100644 --- a/ext/tk/lib/tkextlib/version.rb +++ b/ext/tk/lib/tkextlib/version.rb @@ -2,5 +2,5 @@ # release date of tkextlib # module Tk - Tkextlib_RELEASE_DATE = '2008-04-14'.freeze + Tkextlib_RELEASE_DATE = '2008-04-18'.freeze end diff --git a/ext/tk/sample/ttk_wrapper.rb b/ext/tk/sample/ttk_wrapper.rb index 4a4491b5bd..8bd818f5c4 100644 --- a/ext/tk/sample/ttk_wrapper.rb +++ b/ext/tk/sample/ttk_wrapper.rb @@ -4,7 +4,7 @@ # # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # -version = '0.1' +version = '0.1.1' # ########################################################################## # parse commandline arguments @@ -144,7 +144,7 @@ setTheme(OPTS[:theme]) if OPTS[:theme] ########################################################################## # load script ########################################################################## -if (script = File.expand_path(ARGV.shift)) +if (path = ARGV.shift) && (script = File.expand_path(path)) print "load script \"#{script}\"\n" if OPTS[:verbose] load(script) else |