new MenuItem attribute char* successor_id
This commit is contained in:
@@ -150,6 +150,7 @@ MenuItem *menuitem_create (MenuItemType type, char *id, MenuEventFunc(*event_fun
|
||||
free (new_item);
|
||||
return NULL;
|
||||
}
|
||||
new_item->successor_id = NULL;
|
||||
new_item->parent = NULL;
|
||||
new_item->event_func = event_func;
|
||||
new_item->text = strdup (text);
|
||||
|
||||
@@ -110,6 +110,9 @@ typedef enum MenuEventType {
|
||||
typedef struct MenuItem {
|
||||
MenuItemType type; /**< Type as defined above */
|
||||
char *id; /**< Internal name for client supplied menus */
|
||||
char *successor_id; /**< next menuitem after closing this
|
||||
* one. (A string to allow special values
|
||||
* "_quit_", "_close_", "_none_"). */
|
||||
struct MenuItem *parent; /**< Parent of this menuitem */
|
||||
MenuEventFunc (*event_func);
|
||||
/**< Defines event_func to be an event function */
|
||||
@@ -273,6 +276,11 @@ static inline MenuItem *menuitem_get_parent (MenuItem *item)
|
||||
return ((item != NULL) ? item->parent : NULL);
|
||||
}
|
||||
|
||||
static inline char *menuitem_get_successor (MenuItem *item)
|
||||
{
|
||||
return ((item != NULL) ? item->successor_id : NULL);
|
||||
}
|
||||
|
||||
/** Resets the item to the initial state.
|
||||
* You should call menuitem_update after this to see the effects.
|
||||
* This call is useless on items that have immediate effect, like a slider.
|
||||
|
||||
Reference in New Issue
Block a user