GTK+ Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# GtkItemFactory

## Name

GtkItemFactory --

## Synopsis

    #include <gtk/gtk.h>

    struct      GtkItemFactory;
    void        (*GtkPrintFunc)                 (gpointer func_data,
                                                 gchar *str);
    gchar*      (*GtkTranslateFunc)             (const gchar *path,
                                                 gpointer func_data);
    void        (*GtkItemFactoryCallback)       ();
    void        (*GtkItemFactoryCallback1)      (gpointer callback_data,
                                                 guint callback_action,
                                                 GtkWidget *widget);
    void        (*GtkItemFactoryCallback2)      (GtkWidget *widget,
                                                 gpointer callback_data,
                                                 guint callback_action);
    struct      GtkItemFactoryEntry;
    struct      GtkItemFactoryItem;
    GtkItemFactory* gtk_item_factory_new        (GtkType container_type,
                                                 const gchar *path,
                                                 GtkAccelGroup *accel_group);
    void        gtk_item_factory_construct      (GtkItemFactory *ifactory,
                                                 GtkType container_type,
                                                 const gchar *path,
                                                 GtkAccelGroup *accel_group);
    void        gtk_item_factory_parse_rc       (const gchar *file_name);
    void        gtk_item_factory_parse_rc_string
                                                (const gchar *rc_string);
    void        gtk_item_factory_parse_rc_scanner
                                                (GScanner *scanner);
    GtkItemFactory* gtk_item_factory_from_widget
                                                (GtkWidget *widget);
    gchar*      gtk_item_factory_path_from_widget
                                                (GtkWidget *widget);
    GtkWidget*  gtk_item_factory_get_widget     (GtkItemFactory *ifactory,
                                                 const gchar *path);
    GtkWidget*  gtk_item_factory_get_widget_by_action
                                                (GtkItemFactory *ifactory,
                                                 guint action);
    void        gtk_item_factory_dump_items     (GtkPatternSpec *path_pspec,
                                                 gboolean modified_only,
                                                 GtkPrintFunc print_func,
                                                 gpointer func_data);
    void        gtk_item_factory_dump_rc        (const gchar *file_name,
                                                 GtkPatternSpec *path_pspec,
                                                 gboolean modified_only);
    void        gtk_item_factory_print_func     (gpointer FILE_pointer,
                                                 gchar *string);
    void        gtk_item_factory_create_item    (GtkItemFactory *ifactory,
                                                 GtkItemFactoryEntry *entry,
                                                 gpointer callback_data,
                                                 guint callback_type);
    void        gtk_item_factory_create_items   (GtkItemFactory *ifactory,
                                                 guint n_entries,
                                                 GtkItemFactoryEntry *entries,
                                                 gpointer callback_data);
    void        gtk_item_factory_create_items_ac
                                                (GtkItemFactory *ifactory,
                                                 guint n_entries,
                                                 GtkItemFactoryEntry *entries,
                                                 gpointer callback_data,
                                                 guint callback_type);
    void        gtk_item_factory_delete_item    (GtkItemFactory *ifactory,
                                                 const gchar *path);
    void        gtk_item_factory_delete_entry   (GtkItemFactory *ifactory,
                                                 GtkItemFactoryEntry *entry);
    void        gtk_item_factory_delete_entries (GtkItemFactory *ifactory,
                                                 guint n_entries,
                                                 GtkItemFactoryEntry *entries);
    void        gtk_item_factory_popup          (GtkItemFactory *ifactory,
                                                 guint x,
                                                 guint y,
                                                 guint mouse_button,
                                                 guint32 time);
    void        gtk_item_factory_popup_with_data
                                                (GtkItemFactory *ifactory,
                                                 gpointer popup_data,
                                                 GtkDestroyNotify destroy,
                                                 guint x,
                                                 guint y,
                                                 guint mouse_button,
                                                 guint32 time);
    gpointer    gtk_item_factory_popup_data     (GtkItemFactory *ifactory);
    gpointer    gtk_item_factory_popup_data_from_widget
                                                (GtkWidget *widget);
    GtkItemFactory* gtk_item_factory_from_path  (const gchar *path);
    void        gtk_item_factory_create_menu_entries
                                                (guint n_entries,
                                                 GtkMenuEntry *entries);
    void        gtk_item_factories_path_delete  (const gchar *ifactory_path,
                                                 const gchar *path);
    void        gtk_item_factory_set_translate_func
                                                (GtkItemFactory *ifactory,
                                                 GtkTranslateFunc func,
                                                 gpointer data,
                                                 GtkDestroyNotify notify);

## Object Hierarchy

      GtkObject
       +----GtkItemFactory

## Description

## Details

### struct GtkItemFactory

    struct GtkItemFactory;

### GtkPrintFunc ()

    void        (*GtkPrintFunc)                 (gpointer func_data,
                                                 gchar *str);

`func_data` : |
`str` : |

### GtkTranslateFunc ()

    gchar*      (*GtkTranslateFunc)             (const gchar *path,
                                                 gpointer func_data);

`path` : |
`func_data` : |
Returns : |

### GtkItemFactoryCallback ()

    void        (*GtkItemFactoryCallback)       ();

### GtkItemFactoryCallback1 ()

    void        (*GtkItemFactoryCallback1)      (gpointer callback_data,
                                                 guint callback_action,
                                                 GtkWidget *widget);

`callback_data` : |
`callback_action` : |
`widget` : |

### GtkItemFactoryCallback2 ()

    void        (*GtkItemFactoryCallback2)      (GtkWidget *widget,
                                                 gpointer callback_data,
                                                 guint callback_action);

`widget` : |
`callback_data` : |
`callback_action` : |

### struct GtkItemFactoryEntry

    struct GtkItemFactoryEntry
    {
      gchar *path;
      gchar *accelerator;

      GtkItemFactoryCallback callback;
      guint			 callback_action;

      /* possible values:
       * NULL		-> "<Item>"
       * ""			-> "<Item>"
       * "<Title>"		-> create a title item
       * "<Item>"		-> create a simple item
       * "<CheckItem>"	-> create a check item
       * "<ToggleItem>"	-> create a toggle item
       * "<RadioItem>"	-> create a radio item
       * <path>		-> path of a radio item to link against
       * "<Separator>"	-> create a separator
       * "<Branch>"		-> create an item to hold sub items
       * "<LastBranch>"	-> create a right justified item to hold sub items
       */
      gchar		 *item_type;
    };

### struct GtkItemFactoryItem

    struct GtkItemFactoryItem
    {
      gchar *path;
      guint  accelerator_key;
      guint  accelerator_mods;
      guint	 modified : 1;
      guint  in_propagation : 1;
      gchar *dummy;

      GSList *widgets;
    };

### gtk_item_factory_new ()

    GtkItemFactory* gtk_item_factory_new        (GtkType container_type,
                                                 const gchar *path,
                                                 GtkAccelGroup *accel_group);

`container_type` : |
`path` : |
`accel_group` : |
Returns : |

### gtk_item_factory_construct ()

    void        gtk_item_factory_construct      (GtkItemFactory *ifactory,
                                                 GtkType container_type,
                                                 const gchar *path,
                                                 GtkAccelGroup *accel_group);

`ifactory` : |
`container_type` : |
`path` : |
`accel_group` : |

### gtk_item_factory_parse_rc ()

    void        gtk_item_factory_parse_rc       (const gchar *file_name);

`file_name` : |

### gtk_item_factory_parse_rc_string ()

    void        gtk_item_factory_parse_rc_string
                                                (const gchar *rc_string);

`rc_string` : |

### gtk_item_factory_parse_rc_scanner ()

    void        gtk_item_factory_parse_rc_scanner
                                                (GScanner *scanner);

`scanner` : |

### gtk_item_factory_from_widget ()

    GtkItemFactory* gtk_item_factory_from_widget
                                                (GtkWidget *widget);

`widget` : |
Returns : |

### gtk_item_factory_path_from_widget ()

    gchar*      gtk_item_factory_path_from_widget
                                                (GtkWidget *widget);

`widget` : |
Returns : |

### gtk_item_factory_get_widget ()

    GtkWidget*  gtk_item_factory_get_widget     (GtkItemFactory *ifactory,
                                                 const gchar *path);

`ifactory` : |
`path` : |
Returns : |

### gtk_item_factory_get_widget_by_action ()

    GtkWidget*  gtk_item_factory_get_widget_by_action
                                                (GtkItemFactory *ifactory,
                                                 guint action);

`ifactory` : |
`action` : |
Returns : |

### gtk_item_factory_dump_items ()

    void        gtk_item_factory_dump_items     (GtkPatternSpec *path_pspec,
                                                 gboolean modified_only,
                                                 GtkPrintFunc print_func,
                                                 gpointer func_data);

`path_pspec` : |
`modified_only` : |
`print_func` : |
`func_data` : |

### gtk_item_factory_dump_rc ()

    void        gtk_item_factory_dump_rc        (const gchar *file_name,
                                                 GtkPatternSpec *path_pspec,
                                                 gboolean modified_only);

`file_name` : |
`path_pspec` : |
`modified_only` : |

### gtk_item_factory_print_func ()

    void        gtk_item_factory_print_func     (gpointer FILE_pointer,
                                                 gchar *string);

`FILE_pointer` : |
`string` : |

### gtk_item_factory_create_item ()

    void        gtk_item_factory_create_item    (GtkItemFactory *ifactory,
                                                 GtkItemFactoryEntry *entry,
                                                 gpointer callback_data,
                                                 guint callback_type);

`ifactory` : |
`entry` : |
`callback_data` : |
`callback_type` : |

### gtk_item_factory_create_items ()

    void        gtk_item_factory_create_items   (GtkItemFactory *ifactory,
                                                 guint n_entries,
                                                 GtkItemFactoryEntry *entries,
                                                 gpointer callback_data);

`ifactory` : |
`n_entries` : |
`entries` : |
`callback_data` : |

### gtk_item_factory_create_items_ac ()

    void        gtk_item_factory_create_items_ac
                                                (GtkItemFactory *ifactory,
                                                 guint n_entries,
                                                 GtkItemFactoryEntry *entries,
                                                 gpointer callback_data,
                                                 guint callback_type);

`ifactory` : |
`n_entries` : |
`entries` : |
`callback_data` : |
`callback_type` : |

### gtk_item_factory_delete_item ()

    void        gtk_item_factory_delete_item    (GtkItemFactory *ifactory,
                                                 const gchar *path);

`ifactory` : |
`path` : |

### gtk_item_factory_delete_entry ()

    void        gtk_item_factory_delete_entry   (GtkItemFactory *ifactory,
                                                 GtkItemFactoryEntry *entry);

`ifactory` : |
`entry` : |

### gtk_item_factory_delete_entries ()

    void        gtk_item_factory_delete_entries (GtkItemFactory *ifactory,
                                                 guint n_entries,
                                                 GtkItemFactoryEntry *entries);

`ifactory` : |
`n_entries` : |
`entries` : |

### gtk_item_factory_popup ()

    void        gtk_item_factory_popup          (GtkItemFactory *ifactory,
                                                 guint x,
                                                 guint y,
                                                 guint mouse_button,
                                                 guint32 time);

`ifactory` : |
`x` : |
`y` : |
`mouse_button` : |
`time` : |

### gtk_item_factory_popup_with_data ()

    void        gtk_item_factory_popup_with_data
                                                (GtkItemFactory *ifactory,
                                                 gpointer popup_data,
                                                 GtkDestroyNotify destroy,
                                                 guint x,
                                                 guint y,
                                                 guint mouse_button,
                                                 guint32 time);

`ifactory` : |
`popup_data` : |
`destroy` : |
`x` : |
`y` : |
`mouse_button` : |
`time` : |

### gtk_item_factory_popup_data ()

    gpointer    gtk_item_factory_popup_data     (GtkItemFactory *ifactory);

`ifactory` : |
Returns : |

### gtk_item_factory_popup_data_from_widget ()

    gpointer    gtk_item_factory_popup_data_from_widget
                                                (GtkWidget *widget);

`widget` : |
Returns : |

### gtk_item_factory_from_path ()

    GtkItemFactory* gtk_item_factory_from_path  (const gchar *path);

`path` : |
Returns : |

### gtk_item_factory_create_menu_entries ()

    void        gtk_item_factory_create_menu_entries
                                                (guint n_entries,
                                                 GtkMenuEntry *entries);

`n_entries` : |
`entries` : |

### gtk_item_factories_path_delete ()

    void        gtk_item_factories_path_delete  (const gchar *ifactory_path,
                                                 const gchar *path);

`ifactory_path` : |
`path` : |

### gtk_item_factory_set_translate_func ()

    void        gtk_item_factory_set_translate_func
                                                (GtkItemFactory *ifactory,
                                                 GtkTranslateFunc func,
                                                 gpointer data,
                                                 GtkDestroyNotify notify);

`ifactory` : |
`func` : |
`data` : |
`notify` : |

<<< Previous Page | Home | Up | Next Page >>>
GtkItem | GtkLabel