Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::ItemFactoryEntry< T > Struct Template Reference

A C++ class that represents a GtkItemFactoryEntry. More...

`#include <inti/gtk/itemfactory.h>`

List of all members.

## Public Types

- typedef void(T::* PMF )()
    A generic pointer-to-member function.

## Public Attributes

- const char * path
    The path to the menu item.
- const char * accelerator
    The accelerator for the menu item.
- GtkItemFactoryCallback callback
    The C menu item callback; unused.
- unsigned int callback_action
    The callback action; unused.
- const char * item_type
    The menu item type to create.
- const void * image_item_or_stock_item
    An image or stock item.
- PMF pmf
    A pointer to the member function to call when the menu item is activated.

## Detailed Description

### template<typename T>
struct Inti::Gtk::ItemFactoryEntry< T >

A C++ class that represents a GtkItemFactoryEntry.

ItemFactoryEntry holds all the information needed to create an item in an item factory map. Each entry in a map is referred to by a path that specifies the hierarchical relationship between the entries. The first six data members in ItemFactoryEntry are indentical to the fields in GtkItemFactoryEntry. This is so an ItemFactoryEntry can be cast to a GtkItemFactoryEntry when passed to a C function expecting the latter. Like GtkItemFactoryEntry not all the data members are used. The callback and callback_action members are seldom used. The path and item_type are always used. The accelerator and image_item_or_stock_item are sometimes used, depending on the item entry type. You don't have to worry about which members to use though, macros are defined for each item entry type that require the correct number of arguments.

A path is a character string, with / delimiters indicating the levels (parent/child relationships) in the hierarchy. For example, the file menu would be "/_File", and the New item on the file menu would be "/File/_New".

The accelerator is a character string indicating the keyboard shortcut for the menu item, if any. It consists of any modifiers and the accelerator key. For example, "\<Ctrl\>N" is used for the New item on the file menu. Alternatively this could be "\<Ctrl\>N" or "\<control\>N". Other modifiers are <Alt>, <Shift>, <Shft> and <Release>. A modifier can have any variation in capitalization because GTK+ checks the modifer one letter at a time for both upper and lower case.

The item_type is not used directly. Instead each item_type has its own macro. Some of the macros defined are IFM_ITEM, IFM_STOCK_ITEM, IFM_RADIO_ITEM, IFM_TEAROFF_ITEM, IFM_SEPARATOR and IFM_BRANCH. All of the macros are listed in <inti/gtk/itemfactory.h> (see the itemfactory.h file reference).

The documentation for this struct was generated from the following file:

- itemfactory.h

Main Page - Footer