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 | 341f60d389acdb125fc7741e56cf66d84639e607 (patch) | |
| tree | e4586165010be9bac4462f8c53f267c126cdd041 /ext/tk/lib/tkextlib/tkDND | |
| parent | 686e28fcadf1e1674232579c01664165d8ecb062 (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: http://svn.ruby-lang.org/repos/ruby/trunk@7512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkextlib/tkDND')
| -rw-r--r-- | ext/tk/lib/tkextlib/tkDND/tkdnd.rb | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb index 78381f8df..d40d60217 100644 --- a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb +++ b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb @@ -75,7 +75,28 @@ module Tk end end - def dnd_bindtarget(type, event, cmd=Proc.new, prior=50, *args) + #def dnd_bindtarget(type, event, cmd=Proc.new, prior=50, *args) + # event = tk_event_sequence(event) + # if prior.kind_of?(Numeric) + # tk_call('dnd', 'bindtarget', @path, type, event, + # install_bind_for_event_class(DND_Subst, cmd, *args), + # prior) + # else + # tk_call('dnd', 'bindtarget', @path, type, event, + # install_bind_for_event_class(DND_Subst, cmd, prior, *args)) + # end + # self + #end + def dnd_bindtarget(type, event, *args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end + + prior = 50 + prior = args.shift unless args.empty? + event = tk_event_sequence(event) if prior.kind_of?(Numeric) tk_call('dnd', 'bindtarget', @path, type, event, @@ -101,8 +122,20 @@ module Tk end end - def dnd_bindsource(type, cmd=Proc.new, prior=None) - tk_call('dnd', 'bindsource', @path, type, cmd, prior) + #def dnd_bindsource(type, cmd=Proc.new, prior=None) + # tk_call('dnd', 'bindsource', @path, type, cmd, prior) + # self + #end + def dnd_bindsource(type, *args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end + + args = [None] if args.empty + + tk_call('dnd', 'bindsource', @path, type, cmd, *args) self end |
