GntMenu

GntMenu — A widget for a toplevel or popup menu

Functions

Types and Values

Description

Functions

GNT_MENU_FLAGS()

#define GNT_MENU_FLAGS(obj)				(GNT_MENU(obj)->priv.flags)

GNT_MENU_FLAGS has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.


GNT_MENU_SET_FLAGS()

#define GNT_MENU_SET_FLAGS(obj, flags)		(GNT_MENU_FLAGS(obj) |= flags)

GNT_MENU_SET_FLAGS has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.


GNT_MENU_UNSET_FLAGS()

#define GNT_MENU_UNSET_FLAGS(obj, flags) (GNT_MENU_FLAGS(obj) &= ~(flags))

GNT_MENU_UNSET_FLAGS has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.


gnt_menu_get_gtype ()

GType
gnt_menu_get_gtype (void);

Returns

The GType for GntMenu.


gnt_menu_new ()

GntWidget *
gnt_menu_new (GntMenuType type);

Create a new menu.

Parameters

type

The type of the menu, whether it's a toplevel menu or a popup menu.

 

Returns

The newly created menu.


gnt_menu_add_item ()

void
gnt_menu_add_item (GntMenu *menu,
                   GntMenuItem *item);

Add an item to the menu.

Parameters

menu

The menu.

 

item

The item to add to the menu.

 

gnt_menu_get_item ()

GntMenuItem *
gnt_menu_get_item (GntMenu *menu,
                   const char *id);

Return the GntMenuItem with the given ID.

Parameters

menu

The menu.

 

id

The ID for an item.

 

Returns

The menuitem with the given ID, or NULL.

[transfer none]

Since: 2.3.0

Types and Values

enum GntMenuType

A toplevel-menu is displayed at the top of the screen, and it spans accross the entire width of the screen. A popup-menu could be displayed, for example, as a context menu for widgets.

Members

GNT_MENU_TOPLEVEL

Menu for a toplevel window

 

GNT_MENU_POPUP

A popup menu

 

struct GntMenu

struct GntMenu {
	GntTree parent;
	GntMenuType GNTSEAL(type);

	GList *GNTSEAL(list);
	int GNTSEAL(selected);

	/* This will keep track of its immediate submenu which is visible so that
	 * keystrokes can be passed to it. */
	GntMenu *GNTSEAL(submenu);
	GntMenu *GNTSEAL(parentmenu);
};

Access to any fields is deprecated. See inline comments for replacements.


GntMenuPriv

typedef struct _GntMenuPriv GntMenuPriv;

GntMenuPriv has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.

See Also

GntMenuItem GntMenuItemCheck