Class: Gtk::UIManager
- Inherits:
-
Object
- Object
- Gtk::UIManager
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#accel_group ⇒ Gtk::AccelGroup
Returns the Gtk::AccelGroup associated with manager.
-
#action_groups ⇒ GLib::List
Returns the list of action groups associated with manager.
-
#add_tearoffs ⇒ TrueClass
Returns whether menus generated by this Gtk::UIManager will have tearoff menu items.
-
#add_tearoffs=(add_tearoffs) ⇒ TrueClass
The “add-tearoffs” property controls whether generated menus have tearoff menu items.
-
#add_tearoffs? ⇒ TrueClass
The “add-tearoffs” property controls whether generated menus have tearoff menu items.
-
#add_ui(merge_id, path, name, action, type, top) ⇒ nil
Adds a UI element to the current contents of manager.
-
#add_ui_from_file(filename) ⇒ Integer
Parses a file containing a [UI definition] and merges it with the current contents of manager.
-
#add_ui_from_resource(resource_path) ⇒ Integer
Parses a resource file containing a [UI definition] and merges it with the current contents of manager.
-
#add_ui_from_string(buffer, length) ⇒ Integer
Parses a string containing a [UI definition] and merges it with the current contents of manager.
-
#ensure_update ⇒ nil
Makes sure that all pending updates to the UI have been completed.
-
#get_action(path) ⇒ Gtk::Action
Looks up an action by following a path.
-
#get_toplevels(types) ⇒ GLib::SList
Obtains a list of all toplevel widgets of the requested types.
-
#get_widget(path) ⇒ Gtk::Widget
Looks up a widget by following a path.
-
#insert_action_group(action_group, pos) ⇒ nil
Inserts an action group into the list of action groups associated with manager.
-
#new ⇒ Gtk::UIManager
Creates a new ui manager object.
-
#new_merge_id ⇒ Integer
Returns an unused merge id, suitable for use with gtk_ui_manager_add_ui().
-
#remove_action_group(action_group) ⇒ nil
Removes an action group from the list of action groups associated with manager.
-
#remove_ui(merge_id) ⇒ nil
Unmerges the part of manager’s content identified by merge_id.
-
#ui ⇒ String
Ui.
- #ui=(ui) ⇒ String
Instance Method Details
#accel_group ⇒ Gtk::AccelGroup
Returns the Gtk::AccelGroup associated with manager.
#action_groups ⇒ GLib::List
Returns the list of action groups associated with manager.
#add_tearoffs ⇒ TrueClass
Returns whether menus generated by this Gtk::UIManager will have tearoff menu items.
#add_tearoffs=(add_tearoffs) ⇒ TrueClass
The “add-tearoffs” property controls whether generated menus have tearoff menu items.
Note that this only affects regular menus. Generated popup menus never have tearoff menu items.
#add_tearoffs? ⇒ TrueClass
The “add-tearoffs” property controls whether generated menus have tearoff menu items.
Note that this only affects regular menus. Generated popup menus never have tearoff menu items.
#add_ui(merge_id, path, name, action, type, top) ⇒ nil
Adds a UI element to the current contents of manager.
If type is %GTK_UI_MANAGER_AUTO, GTK+ inserts a menuitem, toolitem or separator if such an element can be inserted at the place determined by path. Otherwise type must indicate an element that can be inserted at the place determined by path.
If path points to a menuitem or toolitem, the new element will be inserted before or after this item, depending on top.
#add_ui_from_file(filename) ⇒ Integer
Parses a file containing a [UI definition] and merges it with the current contents of manager.
#add_ui_from_resource(resource_path) ⇒ Integer
Parses a resource file containing a [UI definition] and merges it with the current contents of manager.
#add_ui_from_string(buffer, length) ⇒ Integer
Parses a string containing a [UI definition] and merges it with the current contents of manager. An enclosing <ui> element is added if it is missing.
#ensure_update ⇒ nil
Makes sure that all pending updates to the UI have been completed.
This may occasionally be necessary, since Gtk::UIManager updates the UI in an idle function. A typical example where this function is useful is to enforce that the menubar and toolbar have been added to the main window before showing it:
gtk_container_add (GTK_CONTAINER (window), vbox);
g_signal_connect (merge, "add-widget",
G_CALLBACK (add_widget), vbox);
gtk_ui_manager_add_ui_from_file (merge, "my-menus");
gtk_ui_manager_add_ui_from_file (merge, "my-toolbars");
gtk_ui_manager_ensure_update (merge);
gtk_widget_show (window);
#get_action(path) ⇒ Gtk::Action
Looks up an action by following a path. See gtk_ui_manager_get_widget() for more information about paths.
#get_toplevels(types) ⇒ GLib::SList
Obtains a list of all toplevel widgets of the requested types. all toplevel widgets of the requested types. Free the returned list with g_slist_free().
#get_widget(path) ⇒ Gtk::Widget
Looks up a widget by following a path. The path consists of the names specified in the XML description of the UI. separated by “/”. Elements which don’t have a name or action attribute in the XML (e.g. <popup>) can be addressed by their XML element name (e.g. “popup”). The root element (“/ui”) can be omitted in the path.
Note that the widget found by following a path that ends in a <menu>; element is the menuitem to which the menu is attached, not the menu it manages.
Also note that the widgets constructed by a ui manager are not tied to the lifecycle of the ui manager. If you add the widgets returned by this function to some container or explicitly ref them, they will survive the destruction of the ui manager.
#insert_action_group(action_group, pos) ⇒ nil
Inserts an action group into the list of action groups associated with manager. Actions in earlier groups hide actions with the same name in later groups.
If pos is larger than the number of action groups in manager, or negative, action_group will be inserted at the end of the internal list.
#new ⇒ Gtk::UIManager
Creates a new ui manager object.
#new_merge_id ⇒ Integer
Returns an unused merge id, suitable for use with gtk_ui_manager_add_ui().
#remove_action_group(action_group) ⇒ nil
Removes an action group from the list of action groups associated with manager.
#remove_ui(merge_id) ⇒ nil
Unmerges the part of manager’s content identified by merge_id.
#ui ⇒ String
Returns ui.