menu.h File Reference

Interface to the ROX menu system. More...


Typedefs

typedef gboolean(*) ROXMenuPreFilter (GtkWidget *menu, GtkWidget *window, gpointer udata)

Functions

GtkWidget * rox_menu_build (GtkWidget *window, GtkItemFactoryEntry *menu_items, int n_menu, const gchar *menu_name, const gchar *accel_name)
void rox_menu_attach (GtkWidget *menu, GtkWidget *window, gboolean on_button_press, ROXMenuPreFilter filter, gpointer udata)
void rox_menu_attach_to_applet (GtkWidget *menu, GtkWidget *applet, ROXMenuPreFilter filter, gpointer udata)
GtkWidget * rox_menu_get_widget (GtkWidget *menu, const char *path)


Detailed Description

Interface to the ROX menu system.


Typedef Documentation

typedef gboolean(*) ROXMenuPreFilter(GtkWidget *menu, GtkWidget *window, gpointer udata)

Type of function called before a menu is shown. This allows a program to update the menu, record state information, or even veto the display of the menu.

Parameters:
[in,out] menu the menu to show
[in] window the widget which triggered the menu show event
[in,out] udata additional data passed to the function which attached the menu to the window (either rox_menu_attach() or rox_menu_attach_to_applet()).
Returns:
TRUE to show the applet or FALSE to ignore the event


Function Documentation

void rox_menu_attach ( GtkWidget *  menu,
GtkWidget *  window,
gboolean  on_button_press,
ROXMenuPreFilter  filter,
gpointer  udata 
)

Attach a menu to a window (or other widget). The menu will be displayed when the "popup-menu" signal is triggered on window and optionally when the "button_press_event" signal is triggered.

Parameters:
[in] menu menu to attach
[in,out] window widget to attach menu to
[in] on_button_press if not FALSE then pop-up the menu on the "button_press_event" signal, otherwise just on the "popup-menu" signal.
[in] filter function to call prior to showing the menu, or NULL
[in] udata additional data to pass to filter when calling.

void rox_menu_attach_to_applet ( GtkWidget *  menu,
GtkWidget *  applet,
ROXMenuPreFilter  filter,
gpointer  udata 
)

Attach a menu to an applet's window. The menu will be displayed when the "popup-menu" signal or button_press_event" signal is triggered on applet.

Parameters:
[in] menu menu to attach
[in,out] applet widget to attach menu to
[in] filter function to call prior to showing the menu, or NULL
[in] udata additional data to pass to filter when calling.

GtkWidget* rox_menu_build ( GtkWidget *  window,
GtkItemFactoryEntry *  menu_items,
int  n_menu,
const gchar *  menu_name,
const gchar *  accel_name 
)

Create a menu. The menu is built from a static definition and connected to a window for the purposes of reacting to key accelerators. It is not attached to a window, use either rox_menu_attach() or rox_menu_attach_to_applet().

Parameters:
[in,out] window window listening for key events that will be used for key accelerators (or NULL)
[in] menu_items array of menu definitions.
[in] n_menu number of items in menu_items
[in] menu_name name of menu to create, or NULL to use "<system>"
[in] accel_name file name to use when loading or saving key accelerators, or NULL to disable loading and saving.

GtkWidget* rox_menu_get_widget ( GtkWidget *  menu,
const char *  path 
)

Look up a menu widget by its path in a menu created by rox_menu_build().

Parameters:
[in] menu menu created by rox_menu_build().
[in] path path of a menu widget, one of the menu_items passed to rox_menu_build().
Returns:
menu widget or NULL if not found.


Generated on Sat Oct 13 17:22:45 2007 for ROX-CLib by  doxygen 1.5.0