Stock Items

Name

Stock Items -- 

Synopsis


#include <gtk/gtk.h>


struct      GtkStockItem;
void        gtk_stock_add                   (const GtkStockItem *items,
                                             guint n_items);
void        gtk_stock_add_static            (const GtkStockItem *items,
                                             guint n_items);
GtkStockItem* gtk_stock_item_copy           (const GtkStockItem *item);
void        gtk_stock_item_free             (GtkStockItem *item);
GSList*     gtk_stock_list_items            (void);
gboolean    gtk_stock_lookup                (const gchar *stock_id,
                                             GtkStockItem *item);

#define     GTK_STOCK_BUTTON_APPLY
#define     GTK_STOCK_BUTTON_CANCEL
#define     GTK_STOCK_BUTTON_CLOSE
#define     GTK_STOCK_BUTTON_NO
#define     GTK_STOCK_BUTTON_OK
#define     GTK_STOCK_BUTTON_YES
#define     GTK_STOCK_DIALOG_ERROR
#define     GTK_STOCK_DIALOG_INFO
#define     GTK_STOCK_DIALOG_QUESTION
#define     GTK_STOCK_DIALOG_WARNING
#define     GTK_STOCK_HELP
#define     GTK_STOCK_NEW
#define     GTK_STOCK_OPEN
#define     GTK_STOCK_QUIT
#define     GTK_STOCK_SAVE
#define     GTK_STOCK_CLOSE
#define     GTK_STOCK_MISSING_IMAGE

Description

Details

struct GtkStockItem

struct GtkStockItem
{
  gchar *stock_id;
  gchar *label;
  GdkModifierType modifier;
  guint keyval;
  gchar *translation_domain;
};


gtk_stock_add ()

void        gtk_stock_add                   (const GtkStockItem *items,
                                             guint n_items);

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


gtk_stock_add_static ()

void        gtk_stock_add_static            (const GtkStockItem *items,
                                             guint n_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


gtk_stock_item_copy ()

GtkStockItem* gtk_stock_item_copy           (const GtkStockItem *item);

Copies a stock item, mostly useful for language bindings and not in applications.

item : a GtkStockItem
Returns : a new GtkStockItem


gtk_stock_item_free ()

void        gtk_stock_item_free             (GtkStockItem *item);

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


gtk_stock_list_items ()

GSList*     gtk_stock_list_items            (void);

Retrieves a list of all known GtkStockItem. The items are not copied; they should not be freed. However, the list itself must be freed with g_slist_free().

Returns : a list of registered stock items


gtk_stock_lookup ()

gboolean    gtk_stock_lookup                (const gchar *stock_id,
                                             GtkStockItem *item);

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


GTK_STOCK_BUTTON_APPLY

#define GTK_STOCK_BUTTON_APPLY     "gtk-button-apply"


GTK_STOCK_BUTTON_CANCEL

#define GTK_STOCK_BUTTON_CANCEL    "gtk-button-cancel"


GTK_STOCK_BUTTON_CLOSE

#define GTK_STOCK_BUTTON_CLOSE     "gtk-button-close"


GTK_STOCK_BUTTON_NO

#define GTK_STOCK_BUTTON_NO        "gtk-button-no"


GTK_STOCK_BUTTON_OK

#define GTK_STOCK_BUTTON_OK        "gtk-button-ok"


GTK_STOCK_BUTTON_YES

#define GTK_STOCK_BUTTON_YES       "gtk-button-yes"


GTK_STOCK_DIALOG_ERROR

#define GTK_STOCK_DIALOG_ERROR     "gtk-dialog-error"


GTK_STOCK_DIALOG_INFO

#define GTK_STOCK_DIALOG_INFO      "gtk-dialog-info"


GTK_STOCK_DIALOG_QUESTION

#define GTK_STOCK_DIALOG_QUESTION  "gtk-dialog-question"


GTK_STOCK_DIALOG_WARNING

#define GTK_STOCK_DIALOG_WARNING   "gtk-dialog-warning"


GTK_STOCK_HELP

#define GTK_STOCK_HELP             "gtk-help"


GTK_STOCK_NEW

#define GTK_STOCK_NEW              "gtk-new"


GTK_STOCK_OPEN

#define GTK_STOCK_OPEN             "gtk-open"


GTK_STOCK_QUIT

#define GTK_STOCK_QUIT             "gtk-quit"


GTK_STOCK_SAVE

#define GTK_STOCK_SAVE             "gtk-save"


GTK_STOCK_CLOSE

#define GTK_STOCK_CLOSE            "gtk-close"


GTK_STOCK_MISSING_IMAGE

#define GTK_STOCK_MISSING_IMAGE    "gtk-missing-image"