diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-26 09:07:25 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-26 09:07:25 +0000 |
commit | e1cc84a43b721fb3413cae87398f5b3fee521f49 (patch) | |
tree | be31dc73639d42c1ef4814bf730f1e4675f3cb57 /ext/tk | |
parent | 2b06b72c2450d56ab51ff717e996a7f171c5f9bb (diff) | |
download | ruby-e1cc84a43b721fb3413cae87398f5b3fee521f49.tar.gz ruby-e1cc84a43b721fb3413cae87398f5b3fee521f49.tar.xz ruby-e1cc84a43b721fb3413cae87398f5b3fee521f49.zip |
* ext/tk/lib/tk.rb: Tk.destroy uses TkWindow#epath
* ext/tk/lib/tk/image.rb: bug fix
* ext/tk/lib/tk/wm.rb: add 'iconphoto' method(Windows only)
* ext/tk/lib/tkextlib/*: some methods uses TkWindow#epath
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r-- | ext/tk/ChangeLog.tkextlib | 20 | ||||
-rw-r--r-- | ext/tk/lib/tk.rb | 9 | ||||
-rw-r--r-- | ext/tk/lib/tk/image.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tk/menu.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tk/wm.rb | 12 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/notebook.rb | 3 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/widget.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tcllib/cursor.rb | 12 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tktable/tktable.rb | 8 |
9 files changed, 57 insertions, 15 deletions
diff --git a/ext/tk/ChangeLog.tkextlib b/ext/tk/ChangeLog.tkextlib index deda55052..42c6771c8 100644 --- a/ext/tk/ChangeLog.tkextlib +++ b/ext/tk/ChangeLog.tkextlib @@ -1,15 +1,25 @@ +2004-11-26 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> + + * bwidget/notebook.rb: uses epath + + * bwidget/widget.rb: ditto + + * tktable/tktable.rb: ditto + + * tcllib/cursor.rb: ditto, and bug fix + 2004-11-10 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> - * lib/tile/style.rb: bug fix + * tile/style.rb: bug fix 2004-11-07 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> - * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb: - bind-event methods accept multi substitution arguments. + * iwidgets/scrolledcanvas.rb: bind-event methods accept multi + substitution arguments. - * ext/tk/lib/tkextlib/tktable/tktable.rb: ditto. + * tktable/tktable.rb: ditto. - * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: ditto + * treectrl/tktreectrl.rb: ditto 2004-11-03 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 6fb139f01..0abab4b3e 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -1677,7 +1677,14 @@ module Tk end def Tk.destroy(*wins) - tk_call_without_enc('destroy', *wins) + #tk_call_without_enc('destroy', *wins) + tk_call_without_enc('destroy', *(wins.collect{|win| + if win.kind_of?(TkWindow) + win.epath + else + win + end + })) end def Tk.exit diff --git a/ext/tk/lib/tk/image.rb b/ext/tk/lib/tk/image.rb index 7fd61eff5..6eb7b98d6 100644 --- a/ext/tk/lib/tk/image.rb +++ b/ext/tk/lib/tk/image.rb @@ -70,7 +70,9 @@ class TkPhotoImage<TkImage keys.delete(opt) end } - hash_kv(keys).flatten + keys.collect{|k,v| + ['-' << k, v] + }.flatten end private :_photo_hash_kv diff --git a/ext/tk/lib/tk/menu.rb b/ext/tk/lib/tk/menu.rb index 2ac6a0efe..1972193e5 100644 --- a/ext/tk/lib/tk/menu.rb +++ b/ext/tk/lib/tk/menu.rb @@ -439,7 +439,7 @@ class TkOptionMenubutton<TkMenubutton install_win(if parent then parent.path end) @menu = OptionMenu.new(tk_call('tk_optionMenu', - @path, @variable.id, *args)) + @path, @variable.id, *args)) configure(keys) if keys end diff --git a/ext/tk/lib/tk/wm.rb b/ext/tk/lib/tk/wm.rb index a1002f7b9..a2be51248 100644 --- a/ext/tk/lib/tk/wm.rb +++ b/ext/tk/lib/tk/wm.rb @@ -120,6 +120,18 @@ module Tk end end + def iconphoto(*imgs) + # Windows only + tk_call_without_enc('wm', 'iconphoto', path, *imgs) + self + end + + def iconphoto_default(*imgs) + # Windows only + tk_call_without_enc('wm', 'iconphoto', path, '-default', *imgs) + self + end + def iconify(ex = true) tk_call_without_enc('wm', 'iconify', path) if ex self diff --git a/ext/tk/lib/tkextlib/bwidget/notebook.rb b/ext/tk/lib/tkextlib/bwidget/notebook.rb index e0cc04d30..aba222ff8 100644 --- a/ext/tk/lib/tkextlib/bwidget/notebook.rb +++ b/ext/tk/lib/tkextlib/bwidget/notebook.rb @@ -31,7 +31,8 @@ class Tk::BWidget::NoteBook def tagid(id) if id.kind_of?(TkWindow) - id.path + #id.path + id.epath elsif id.kind_of?(TkObject) id.to_eval else diff --git a/ext/tk/lib/tkextlib/bwidget/widget.rb b/ext/tk/lib/tkextlib/bwidget/widget.rb index eadf59c11..568e503a8 100644 --- a/ext/tk/lib/tkextlib/bwidget/widget.rb +++ b/ext/tk/lib/tkextlib/bwidget/widget.rb @@ -56,7 +56,7 @@ module Tk::BWidget::Widget end def self.destroy(win) - tk_call('Widget::destroy', win) + tk_call('Widget::destroy', _epath(win)) end def self.focus_next(win) diff --git a/ext/tk/lib/tkextlib/tcllib/cursor.rb b/ext/tk/lib/tkextlib/tcllib/cursor.rb index 92fd7a62b..86a68497b 100644 --- a/ext/tk/lib/tkextlib/tcllib/cursor.rb +++ b/ext/tk/lib/tkextlib/tcllib/cursor.rb @@ -51,7 +51,7 @@ class TkWindow def cursor_propagate(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(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 @@ -59,7 +59,7 @@ class TkWindow # 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(cursor) + Tk::Tcllib::Cursor.cursor_restore(self, cursor) end end @@ -75,15 +75,17 @@ module Tk module Cursor extend TkCore def self.cursor_display(win=None) - tk_call_without_enc('::cursor::display', win) + tk_call_without_enc('::cursor::display', _epath(win)) end def self.cursor_propagate(win, cursor) - tk_call_without_enc('::cursor::propagate', win.path, cursor) + #tk_call_without_enc('::cursor::propagate', win.path, cursor) + tk_call_without_enc('::cursor::propagate', _epath(win), cursor) end def self.cursor_restore(win, cursor = None) - tk_call_without_enc('::cursor::restore', win.path, cursor) + #tk_call_without_enc('::cursor::restore', win.path, cursor) + tk_call_without_enc('::cursor::restore', _epath(win), cursor) end end end diff --git a/ext/tk/lib/tkextlib/tktable/tktable.rb b/ext/tk/lib/tkextlib/tktable/tktable.rb index 7182983c0..da78ca3fb 100644 --- a/ext/tk/lib/tkextlib/tktable/tktable.rb +++ b/ext/tk/lib/tkextlib/tktable/tktable.rb @@ -71,6 +71,14 @@ module Tk::TkTable::ConfigMethod itemcget(['window', tagid(tagOrId)], option) end def window_configure(tagOrId, slot, value=None) + if slot == :window || slot == 'window' + value = _epath(value) + elsif slot.kind_of?(Hash) + if slot.key?(:window) || slot.key?('window') + slot = _symbolkey2str(slot) + slot['window'] = _epath(slot['window']) + end + end itemconfigure(['window', tagid(tagOrId)], slot, value) end def window_configinfo(tagOrId, slot=nil) |