ruby-****@sourc*****
ruby-****@sourc*****
2012年 10月 31日 (水) 05:45:15 JST
------------------------- REMOTE_ADDR = 74.14.158.59 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-mnui ------------------------- @@ -234,9 +234,9 @@ This seems like a reasonable plan, however, for a deeply nested menu hierarchies and many menu items, it will also require some planning, and more importantly, we will need to come up with a sensible naming convention for both menu items, and their respective callback procedures. Since this process in our GUI development will most likely be repeated over and over again, it may be a very good idea to, when developing our coding strategy, to perhaps start aiming to develop a 'Ruby Gtk Menu Building Design Pattern'. But let's not get ahead of ourselves here, and see how we can best implement what we've come up with so far. -=== Menu Program Design Based On a Hash Of Items and Callbacks +:Menu Program Design Based On a Hash Of Items and Callbacks -:(hash) + #:(hash) -1-{{br}} We start by creating the top context menu. This process is no different than what we have been doing so far, namely we code everything on this top level by hand. At this point we can also connect all final or leaf menu items with the((*'activate'*))signal: # (1. menu building step)