From 35905680eb86a05e912a9dcc5646f3c9ee8ddd3d Mon Sep 17 00:00:00 2001 From: nagai Date: Mon, 13 Jun 2005 17:07:08 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/lib/tk/event.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ext/tk/lib') diff --git a/ext/tk/lib/tk/event.rb b/ext/tk/lib/tk/event.rb index dd01ba630..35d2beecd 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 -- cgit