| Mex Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
enum MexMenuActionType; struct MexMenu; struct MexMenuClass; ClutterActor * mex_menu_new (void); void mex_menu_add_action (MexMenu *menu,MxAction *action,MexMenuActionType type); void mex_menu_action_set_detail (MexMenu *menu,const gchar *action_name,const gchar *detail); const gchar * mex_menu_action_get_detail (MexMenu *menu,const gchar *action_name); void mex_menu_action_set_toggled (MexMenu *menu,const gchar *action_name,gboolean toggled); gboolean mex_menu_action_get_toggled (MexMenu *menu,const gchar *action_name); void mex_menu_remove_action (MexMenu *menu,const gchar *action); GList * mex_menu_get_actions (MexMenu *menu,gint depth); gint mex_menu_push (MexMenu *menu); gint mex_menu_pop (MexMenu *menu); void mex_menu_clear_all (MexMenu *menu); void mex_menu_set_min_width (MexMenu *menu,gfloat min_width); gfloat mex_menu_get_min_width (MexMenu *menu); MxBoxLayout * mex_menu_get_layout (MexMenu *menu); MexMenuPrivate;
MexMenu is a widget that can be used to represent a hierarchical menu structure. Menu items are created from MxAction objects, and the current menu depth can be incremented or decremented to represent different levels of a tree hierarchy.
MexMenu presents menu items vertically, and the menu can expand either to the right (where depth increases positively), or to the left (where depth increases negatively).
typedef enum
{
MEX_MENU_NONE,
MEX_MENU_LEFT,
MEX_MENU_RIGHT,
MEX_MENU_TOGGLE
} MexMenuActionType;
struct MexMenu {
MexResizingHBox parent;
MexMenuPrivate *priv;
};
The content of this structure is private and should only be accessed using the provided API.
ClutterActor * mex_menu_new (void);
Creates a new MexMenu.
Returns : |
a newly allocated MexMenu |
void mex_menu_add_action (MexMenu *menu,MxAction *action,MexMenuActionType type);
Adds a menu item to menu at the current depth. action must be a uniquely
named action, if an action with that name already exists in the menu, this
function will do nothing.
void mex_menu_action_set_detail (MexMenu *menu,const gchar *action_name,const gchar *detail);
Adds detail text to a particular menu item. This is the text that is displayed below the display-name of the menu item.
|
A MexMenu |
|
The action name |
|
The detail text |
const gchar * mex_menu_action_get_detail (MexMenu *menu,const gchar *action_name);
void mex_menu_action_set_toggled (MexMenu *menu,const gchar *action_name,gboolean toggled);
gboolean mex_menu_action_get_toggled (MexMenu *menu,const gchar *action_name);
void mex_menu_remove_action (MexMenu *menu,const gchar *action);
Remove the menu item that represents the given action name.
|
A MexMenu |
|
The action name |
GList * mex_menu_get_actions (MexMenu *menu,gint depth);
Retrieves the actions represented at the given depth of the menu. If the
given depth doesn't exist, or there are no menu items, this function will
return NULL.
The returned MxAction objects are owned by menu. The list should be freed
with g_list_free().
gint mex_menu_push (MexMenu *menu);
Increments the current depth of the menu. If the current depth is 0,
or positive, this will add a new menu level. If the depth is negative,
this will remove a menu level.
|
A MexMenu |
Returns : |
The new menu depth |
gint mex_menu_pop (MexMenu *menu);
Decrements the current depth of the menu. If the current depth is 0,
or negative, this will add a new menu level. If the depth is positive,
this will remove a menu level.
|
A MexMenu |
Returns : |
The new menu depth |
void mex_menu_clear_all (MexMenu *menu);
Removes all items from the menu.
|
A MexMenu |