diff options
Diffstat (limited to 'ext/tk/lib/tk')
-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 |
3 files changed, 16 insertions, 2 deletions
diff --git a/ext/tk/lib/tk/image.rb b/ext/tk/lib/tk/image.rb index 7fd61eff5d..6eb7b98d6c 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 2ac6a0efe7..1972193e51 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 a1002f7b96..a2be51248d 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 |