Hi, The need to use TGPopupMenu::Associate() makes it very difficult to construct any hierarchical menus since you have to know the top level widget (usually a TGMenuBar) in the context of each submenu creation. It also makes it impossible to create a (working) menu hierarchy with out knowing where it will be used (ie, what TGMenuBar will eventually hold it). I think the simplest solution is to have TGPopupMenu::Associate() recursively descend and call Associate() on all of its menu entries which are also TGPopupMenus. This way a menu hierarchy could be built up, independent of where it will be used (data encapsulation!), and then the object which creates the top level menu can call Associate() with the parent object, and have this trickle down the hierarchy. Alternatively, but probably a lot more work, is to pass the parent menu to a submenu's Associate() and then have TGPopupMenus know how to forward events up to the top level widget. Comments? -Brett.
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:41 MET