diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-08 18:14:15 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-08 18:14:15 +0000 |
commit | ac3b12233b23713a29c83eee3f92dd41f3ac3a77 (patch) | |
tree | 221dc68a440e6eb741b5f4c87ed9b6a32ebd298a /ext/tk/lib/tkextlib/itk/incr_tk.rb | |
parent | 2f6f96739b23c9d9a7573c4acf27430b4cb04cf0 (diff) |
* ext/tcltklib/tcltklib.c (ip_init): set root-win title to "ruby" when
the running script is '-e one-liner' or '-' (stdin).
* ext/tcltklib/extconf.rb: add find_library("#{lib}#{ver}",..) for stub libs
* ext/tk/lib/tk/textmark.rb: TkTextMarkCurrent and TkTextMarkAnchor
have a wrong parent class.
* ext/tk/lib/tk/dialog.rb: rename TkDialog2 --> TkDialogObj and
TkWarning2 --> TkWarningObj (old names are changed to alias names)
* ext/tk/lib/tk/dialog.rb: bug fix of treatment of 'prev_command'
option and hashes for configuration
* ext/tk/lib/tk/dialog.rb: add TkDialogObj#name to return the button name
* ext/tk/lib/tk/radiobutton.rb: rename enbugged method value() ==> get_value()
and value=(val) ==> set_value(val).
* ext/tk/lib/tk/menu.rb: add TkMenu.new_menuspec
* ext/tk/lib/tk/menu.rb: add alias (TkMenuButton = TkMenubutton,
TkOptionMenuButton = TkOptionMenubutton)
* ext/tk/lib/tk/event.rb: new method aliases (same as option keys of
event_generate) for Event object
* ext/tk/lib/tk/font.rb: configinfo returns proper types of values
* ext/tk/lib/tk.rb: bind methods accept subst_args + block
* ext/tk/lib/tk/canvas.rb: ditto
* ext/tk/lib/tk/canvastag.rb: ditto
* ext/tk/lib/tk/frame.rb: ditto
* ext/tk/lib/tk/text.rb: ditto
* ext/tk/lib/tk/texttag.rb: ditto
* ext/tk/lib/tk/toplevel.rb: ditto
* ext/tk/lib/tkextlib/*: ditto and bug fix
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkextlib/itk/incr_tk.rb')
-rw-r--r-- | ext/tk/lib/tkextlib/itk/incr_tk.rb | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/ext/tk/lib/tkextlib/itk/incr_tk.rb b/ext/tk/lib/tkextlib/itk/incr_tk.rb index f11d9d7913..106ffa3519 100644 --- a/ext/tk/lib/tkextlib/itk/incr_tk.rb +++ b/ext/tk/lib/tkextlib/itk/incr_tk.rb @@ -330,7 +330,18 @@ module Tk end end - def bind(*args) + #def bind(*args) + # unless @widget + # begin + # @widget = window(tk_call(@master, 'component', @component)) + # @path = @widget.path + # rescue + # fail RuntimeError, 'component is not assigned to a widget' + # end + # end + # @widget.bind(*args) + #end + def bind(context, *args) unless @widget begin @widget = window(tk_call(@master, 'component', @component)) @@ -339,10 +350,26 @@ module Tk fail RuntimeError, 'component is not assigned to a widget' end end - @widget.bind(*args) - end - - def bind_append(*args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end + @widget.bind(context, cmd, *args) + end + + #def bind_append(*args) + # unless @widget + # begin + # @widget = window(tk_call(@master, 'component', @component)) + # @path = @widget.path + # rescue + # fail RuntimeError, 'component is not assigned to a widget' + # end + # end + # @widget.bind_append(*args) + #end + def bind_append(context, *args) unless @widget begin @widget = window(tk_call(@master, 'component', @component)) @@ -351,7 +378,12 @@ module Tk fail RuntimeError, 'component is not assigned to a widget' end end - @widget.bind_append(*args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end + @widget.bind_append(context, cmd, *args) end def bind_remove(*args) |