ItemFactory

Description As of GTK+ 2.4, GtkItemFactory has been deprecated in favour of GtkUIManager.

Constructors

this
this(GtkItemFactory* gtkItemFactory)

Sets our main struct and passes it to the parent class

this
this(GType containerType, string path, AccelGroup accelGroup)

Warning gtk_item_factory_new has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Creates a new GtkItemFactory. Beware that the returned object does not have a floating reference.

Members

Functions

construct
void construct(GType containerType, string path, AccelGroup accelGroup)

Warning gtk_item_factory_construct has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Initializes an item factory.

createItem
void createItem(GtkItemFactoryEntry* entry, void* callbackData, uint callbackType)

Warning gtk_item_factory_create_item has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Creates an item for entry.

createItems
void createItems(uint nEntries, GtkItemFactoryEntry* entries, void* callbackData)

Warning gtk_item_factory_create_items has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Creates the menu items from the entries.

createItemsAc
void createItemsAc(uint nEntries, GtkItemFactoryEntry* entries, void* callbackData, uint callbackType)

Warning gtk_item_factory_create_items_ac has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Creates the menu items from the entries.

deleteEntries
void deleteEntries(uint nEntries, GtkItemFactoryEntry* entries)

Warning gtk_item_factory_delete_entries has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Deletes the menu items which were created from the entries by the given item factory.

deleteEntry
void deleteEntry(GtkItemFactoryEntry* entry)

Warning gtk_item_factory_delete_entry has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Deletes the menu item which was created from entry by the given item factory.

deleteItem
void deleteItem(string path)

Warning gtk_item_factory_delete_item has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Deletes the menu item which was created for path by the given item factory.

getItem
Widget getItem(string path)

Warning gtk_item_factory_get_item has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Obtains the menu item which corresponds to path. If the widget corresponding to path is a menu item which opens a submenu, then the item is returned. If you are interested in the submenu, use gtk_item_factory_get_widget() instead.

getItemByAction
Widget getItemByAction(uint action)

Warning gtk_item_factory_get_item_by_action has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Obtains the menu item which was constructed from the first GtkItemFactoryEntry with the given action.

getItemFactoryStruct
GtkItemFactory* getItemFactoryStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

getWidget
Widget getWidget(string path)

Warning gtk_item_factory_get_widget has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Obtains the widget which corresponds to path. If the widget corresponding to path is a menu item which opens a submenu, then the submenu is returned. If you are interested in the menu item, use gtk_item_factory_get_item() instead.

getWidgetByAction
Widget getWidgetByAction(uint action)

Warning gtk_item_factory_get_widget_by_action has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Obtains the widget which was constructed from the GtkItemFactoryEntry with the given action. If there are multiple items with the same action, the result is undefined.

popup
void popup(uint x, uint y, uint mouseButton, uint time)

Warning gtk_item_factory_popup has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Pops up the menu constructed from the item factory at (x, y). The mouse_button parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, mouse_button should be 0. The time_ parameter should be the time stamp of the event that initiated the popup. If such an event is not available, use gtk_get_current_event_time() instead. The operation of the mouse_button and the time_ parameter is the same as the button and activation_time parameters for gtk_menu_popup().

popupData
void* popupData()

Warning gtk_item_factory_popup_data has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Obtains the popup_data which was passed to gtk_item_factory_popup_with_data(). This data is available until the menu is popped down again.

popupWithData
void popupWithData(void* popupData, GDestroyNotify destroy, uint x, uint y, uint mouseButton, uint time)

Warning gtk_item_factory_popup_with_data has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Pops up the menu constructed from the item factory at (x, y). Callbacks can access the popup_data while the menu is posted via gtk_item_factory_popup_data() and gtk_item_factory_popup_data_from_widget(). The mouse_button parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, mouse_button should be 0. The time_ parameter should be the time stamp of the event that initiated the popup. If such an event is not available, use gtk_get_current_event_time() instead. The operation of the mouse_button and the time_ parameters is the same as the button and activation_time parameters for gtk_menu_popup().

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setTranslateFunc
void setTranslateFunc(GtkTranslateFunc func, void* data, GDestroyNotify notify)

Warning gtk_item_factory_set_translate_func has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Sets a function to be used for translating the path elements before they are displayed.

Static functions

addForeign
void addForeign(Widget accelWidget, string fullPath, AccelGroup accelGroup, uint keyval, GdkModifierType modifiers)

Warning gtk_item_factory_add_foreign has been deprecated since version 2.4 and should not be used in newly-written code. The recommended API for this purpose are the functions gtk_menu_item_set_accel_path() and gtk_widget_set_accel_path(); don't use gtk_item_factory_add_foreign() in new code, since it is likely to be removed in the future. Installs an accelerator for accel_widget in accel_group, that causes the ::activate signal to be emitted if the accelerator is activated. This function can be used to make widgets participate in the accel saving/restoring functionality provided by gtk_accel_map_save() and gtk_accel_map_load(), even if they haven't been created by an item factory.

fromPath
ItemFactory fromPath(string path)

Warning gtk_item_factory_from_path has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Finds an item factory which has been constructed using the "<name>" prefix of path as the path argument for gtk_item_factory_new().

fromWidget
ItemFactory fromWidget(Widget widget)

Warning gtk_item_factory_from_widget has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Obtains the item factory from which a widget was created.

itemFactoriesPathDelete
void itemFactoriesPathDelete(string ifactoryPath, string path)

Warning gtk_item_factories_path_delete has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Deletes all widgets constructed from the specified path.

pathFromWidget
string pathFromWidget(Widget widget)

Warning gtk_item_factory_path_from_widget has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. If widget has been created by an item factory, returns the full path to it. (The full path of a widget is the concatenation of the factory path specified in gtk_item_factory_new() with the path specified in the GtkItemFactoryEntry from which the widget was created.)

popupDataFromWidget
void* popupDataFromWidget(Widget widget)

Warning gtk_item_factory_popup_data_from_widget has been deprecated since version 2.4 and should not be used in newly-written code. Use GtkUIManager instead. Obtains the popup_data which was passed to gtk_item_factory_popup_with_data(). This data is available until the menu is popped down again.

Variables

gtkItemFactory
GtkItemFactory* gtkItemFactory;

the main Gtk struct

Inherited Members

From ObjectGtk

gtkObject
GtkObject* gtkObject;

the main Gtk struct

getObjectGtkStruct
GtkObject* getObjectGtkStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getId
string getId(StockID id)
connectedSignals
int[string] connectedSignals;
onDestroyListeners
void delegate(ObjectGtk)[] onDestroyListeners;
Undocumented in source.
addOnDestroy
void addOnDestroy(void delegate(ObjectGtk) dlg, ConnectFlags connectFlags)

Signals that all holders of a reference to the GtkObject should release the reference that they hold. May result in finalization of the object if all references are released. See Also GObject

callBackDestroy
void callBackDestroy(GtkObject* objectStruct, ObjectGtk _objectGtk)
Undocumented in source. Be warned that the author may not have intended to support it.
sink
void sink()

Warning gtk_object_sink has been deprecated since version 2.10 and should not be used in newly-written code. Use g_object_ref_sink() instead Removes the floating reference from a GtkObject, if it exists; otherwise does nothing. See the GtkObject overview documentation at the top of the page.

weakref
void weakref(GDestroyNotify notify, void* data)

Warning gtk_object_weakref is deprecated and should not be used in newly-written code. Use g_object_weak_ref() instead. Adds a weak reference callback to an object. Weak references are used for notification when an object is finalized. They are called "weak references" because they allow you to safely hold a pointer to an object without calling g_object_ref() (g_object_ref() adds a strong reference, that is, forces the object to stay alive).

weakunref
void weakunref(GDestroyNotify notify, void* data)

Warning gtk_object_weakunref is deprecated and should not be used in newly-written code. Use g_object_weak_unref() instead. Removes a weak reference callback to an object.

destroy
void destroy()

Warning gtk_object_destroy has been deprecated since version 2.24 and should not be used in newly-written code. Use gtk_widget_destroy() instead (if object is a widget) Emits the "destroy" signal notifying all reference holders that they should release the GtkObject. See the overview documentation at the top of the page for more details. The memory for the object itself won't be deleted until its reference count actually drops to 0; gtk_object_destroy() merely asks reference holders to release their references, it does not free the object.

removeNoNotify
void removeNoNotify(string key)

Warning gtk_object_remove_no_notify is deprecated and should not be used in newly-written code. Use g_object_steal_data() instead. Remove a specified datum from the object's data associations (the object_data), without invoking the association's destroy handler. Just like gtk_object_remove_data() except that any destroy handler will be ignored. Therefore this only affects data set using gtk_object_set_data_full().

setUserData
void setUserData(void* data)

Warning gtk_object_set_user_data is deprecated and should not be used in newly-written code. Use g_object_set_data() instead. For convenience, every object offers a generic user data pointer. This function sets it.

getUserData
void* getUserData()

Warning gtk_object_get_user_data is deprecated and should not be used in newly-written code. Use g_object_get_data() instead. Get the object's user data pointer. This is intended to be a pointer for your convenience in writing applications.

addArgType
void addArgType(string argName, GType argType, uint argFlags, uint argId)

Warning gtk_object_add_arg_type is deprecated and should not be used in newly-written code. Deprecated in favor of the GObject property system including GParamSpec. Add a new type of argument to an object class. Usually this is called when registering a new type of object.

setDataById
void setDataById(GQuark dataId, void* data)

Warning gtk_object_set_data_by_id is deprecated and should not be used in newly-written code. Use g_object_set_qdata() instead. Just like gtk_object_set_data() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

setDataByIdFull
void setDataByIdFull(GQuark dataId, void* data, GDestroyNotify destroy)

Warning gtk_object_set_data_by_id_full is deprecated and should not be used in newly-written code. Use g_object_set_qdata_full() instead. Just like gtk_object_set_data_full() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

getDataById
void* getDataById(GQuark dataId)

Warning gtk_object_get_data_by_id is deprecated and should not be used in newly-written code. Use g_object_get_qdata() instead. Just like gtk_object_get_data() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

removeDataById
void removeDataById(GQuark dataId)

Warning gtk_object_remove_data_by_id is deprecated and should not be used in newly-written code. Use g_object_set_qdata() with data of NULL instead. Just like gtk_object_remove_data() except that it takes a GQuark instead of a string, so it is slightly faster. Remove a specified datum from the object's data associations. Subsequent calls to gtk_object_get_data() will return NULL. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

removeNoNotifyById
void removeNoNotifyById(GQuark keyId)

Warning gtk_object_remove_no_notify_by_id is deprecated and should not be used in newly-written code. Use g_object_steal_qdata() instead. Just like gtk_object_remove_no_notify() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

Meta