summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-17 23:06:33 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-17 23:06:33 +0000
commit40e77949935b5bd43cc4bfac8e055d75519e7da7 (patch)
tree7dd14ae21c311c6d0399b8ad75cf08231a22f496
parentfefd85d9ef96b8d03f7b038d18312027631063e5 (diff)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/scrollbar.rb, ext/tk/lib/tk/scale.rb:
improve unknonw-option check when create a widget. * ext/tk/lib/tkextlib/blt/unix_dnd.rb, ext/tk/lib/tkextlib/blt/ted.rb, ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: bug fix on 'cget'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--ext/tk/lib/tk.rb13
-rw-r--r--ext/tk/lib/tk/scale.rb13
-rw-r--r--ext/tk/lib/tk/scrollbar.rb13
-rw-r--r--ext/tk/lib/tkextlib/blt/ted.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/unix_dnd.rb6
-rw-r--r--ext/tk/lib/tkextlib/treectrl/tktreectrl.rb8
-rw-r--r--ext/tk/lib/tkextlib/version.rb2
8 files changed, 49 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a4a7dcd9c..8ab5b7d456 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Apr 18 07:56:18 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tk.rb, ext/tk/lib/tk/scrollbar.rb, ext/tk/lib/tk/scale.rb:
+ improve unknonw-option check when create a widget.
+
+ * ext/tk/lib/tkextlib/blt/unix_dnd.rb, ext/tk/lib/tkextlib/blt/ted.rb,
+ ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: bug fix on 'cget'.
+
Thu Apr 17 22:03:52 2008 akira yamada <akira@arika.org>
* lib/uri/ftp.rb, lib/uri/generic.rb, test/uri/test_common.rb,
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