summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/event.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-13 17:07:08 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-13 17:07:08 +0000
commit699cb8117c44b09c3c011c4b1a822de9e44474f4 (patch)
treee24010ab8804141e3079f6c404639feb0a62edf0 /ext/tk/lib/tk/event.rb
parentbab2d449bbe941e0f8932c3f6d2df944b90cc8c2 (diff)
* ext/tk/tkutil.c: add TkUtil::CallbackSubst.subst_arg(m, ...) &
_define_attribute_aliases(hash) to get substitution-argument from attributes (e.g. subst_arg(:x,:y,:num,:button) --> "%x %y %b %b "). * ext/tk/lib/tk/event.rb: use _define_attribute_aliases(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk/event.rb')
-rw-r--r--ext/tk/lib/tk/event.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/tk/lib/tk/event.rb b/ext/tk/lib/tk/event.rb
index dd01ba6309..35d2beecdd 100644
--- a/ext/tk/lib/tk/event.rb
+++ b/ext/tk/lib/tk/event.rb
@@ -130,6 +130,7 @@ module TkEvent
# []
#end
+=begin
alias button num
alias delta wheel_delta
alias root rootwin_id
@@ -138,6 +139,19 @@ module TkEvent
alias rooty y_root
alias root_y y_root
alias sendevent send_event
+=end
+ ALIAS_TBL = {
+ :button => :num,
+ :delta => :wheel_delta,
+ :root => :rootwin_id,
+ :rootx => :x_root,
+ :root_x => :x_root,
+ :rooty => :y_root,
+ :root_y => :y_root,
+ :sendevent => :send_event
+ }
+
+ _define_attribute_aliases(ALIAS_TBL)
end