Each stock item is identified by a stock ID; stock IDs are just strings, but macros such as GTK_STOCK_OPEN are provided to avoid typing mistakes in the strings. Applications can register their own stock items in addition to those built-in to GTK+. Each stock ID can be associated with a GtkStockItem, which contains the user-visible label, keyboard accelerator, and translation domain of the menu or toolbar item; and/or with an icon stored in a GtkIconFactory. See GtkIconFactory for more information on stock icons. The connection between a GtkStockItem and stock icons is purely conventional (by virtue of using the same stock ID); it's possible to register a stock item but no icon, and vice versa. Stock icons may have a RTL variant which gets used for right-to-left locales.
Public Member Functions
|GtkStockItem *||getStockItemStruct ()|
|this (GtkStockItem *gtkStockItem)|
|Sets our main struct and passes it to the parent class. |
|void||add (uint nItems)|
|Registers each of the stock items in items. |
|void||addStatic (uint nItems)|
|Same as gtk_stock_add(), but doesn't copy items, so items must persist until application exit. |
|Copies a stock item, mostly useful for language bindings and not in applications. |
|Frees a stock item allocated on the heap, such as one returned by gtk_stock_item_copy(). |
Static Public Member Functions
|static ListSG||listIds ()|
|Retrieves a list of all known stock IDs added to a GtkIconFactory or registered with gtk_stock_add(). |
|static int||lookup (char stockId, StockItem item)|
|Fills item with the registered values for stock_id, returning TRUE if stock_id was known. |
|static void||setTranslateFunc (char domain, GtkTranslateFunc func, void *data, GtkDestroyNotify notify)|
|Sets a function to be used for translating the label of a stock item. |
Protected Member Functions
|void *||getStruct ()|
|the main Gtk struct as a void* |
|the main Gtk struct |
Sets our main struct and passes it to the parent class.
Registers each of the stock items in items.
If an item already exists with the same stock ID as one of the items, the old item gets replaced. The stock items are copied, so GTK+ does not hold any pointer into items and items can be freed. Use gtk_stock_add_static() if items is persistent and GTK+ need not copy the array. items: a GtkStockItem or array of items n_items: number of GtkStockItem in items
Same as gtk_stock_add(), but doesn't copy items, so items must persist until application exit.
items: a GtkStockItem or array of GtkStockItem n_items: number of items
the main Gtk struct as a void*
Copies a stock item, mostly useful for language bindings and not in applications.
item: a GtkStockItem Returns: a new GtkStockItem
Frees a stock item allocated on the heap, such as one returned by gtk_stock_item_copy().
Also frees the fields inside the stock item, if they are not NULL. item: a GtkStockItem
|static ListSG gtk.StockItem.StockItem.listIds||(||)||
Retrieves a list of all known stock IDs added to a GtkIconFactory or registered with gtk_stock_add().
The list must be freed with g_slist_free(), and each string in the list must be freed with g_free(). Returns: a list of known stock IDs
Fills item with the registered values for stock_id, returning TRUE if stock_id was known.
stock_id: a stock item name item: stock item to initialize with values Returns: TRUE if item was initialized
|static void gtk.StockItem.StockItem.setTranslateFunc||(||char||domain,|
Sets a function to be used for translating the label of a stock item.
If no function is registered for a translation domain, dgettext() is used. domain: the translation domain for which func shall be used func: a GtkTranslateFunc data: data to pass to func notify: a GtkDestroyNotify that is called when data is no longer needed Since 2.8