EZ
Up Prev Next Contents


3.6 Menu Buttons

Menu buttons are very similar to normal buttons except that they serve as hooks to pull-down menus. Menu buttons are usually grouped together in a menu-bar. When user press mouse button 1 over a menu button it posts its associated menu under the menu button. Then the user can slide the mouse down over the menu with button still pressed and release over a desired item. When the button is released over a menu item, the menu is unposted and if the menu item has any callbacks, they are invoked first. In the mean time, the selected menu entry and its return identifier are recorded in both the most recently posted menu (parent of the selected item) and responsible menu button. If the menu has callbacks, they are invoked next. If the menu button has callbacks, they are invoked the last. This feature makes it convenient to manage menu callbacks. For the complex cases, one can associate a callback to each menu item. For simple cases, one may just register one callback to a menu button.

To created a menu button, use EZ_CreateWidget with type EZ_WIDGET_MENU_BUTTON or use the next function.

EZ_Widget *EZ_CreateMenuButton(EZ_Widget *parent, char *label,

int underline)


HTML Documentation Maintainance:Arturo Espinosa <arturo@nuclecu.unam.mx>