2003-08-31 Matthias Clasen <maclas@gmx.de>
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_get_action): New function,
+ replaces gtk_ui_manager_activate(). (#120658)
+
+ * tests/testmerge.c: Use gtk_ui_manager_get_action() instead of
+ gtk_ui_manager_activate().
+
* gtk/gtkaction.c:
* gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Add a boolean property, "add_tearoffs" with
setter and getter. If it is set, add tearoff menu items to regular
menus, but not to popups. Add a signal "changed", which gets emitted
- when the merged ui has changed.
+ when the merged ui has changed. (#120649, #120656)
* tests/testmerge.c: Add button to test the generation of tearoff
menu items.
2003-08-31 Matthias Clasen <maclas@gmx.de>
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_get_action): New function,
+ replaces gtk_ui_manager_activate(). (#120658)
+
+ * tests/testmerge.c: Use gtk_ui_manager_get_action() instead of
+ gtk_ui_manager_activate().
+
* gtk/gtkaction.c:
* gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Add a boolean property, "add_tearoffs" with
setter and getter. If it is set, add tearoff menu items to regular
menus, but not to popups. Add a signal "changed", which gets emitted
- when the merged ui has changed.
+ when the merged ui has changed. (#120649, #120656)
* tests/testmerge.c: Add button to test the generation of tearoff
menu items.
2003-08-31 Matthias Clasen <maclas@gmx.de>
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_get_action): New function,
+ replaces gtk_ui_manager_activate(). (#120658)
+
+ * tests/testmerge.c: Use gtk_ui_manager_get_action() instead of
+ gtk_ui_manager_activate().
+
* gtk/gtkaction.c:
* gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Add a boolean property, "add_tearoffs" with
setter and getter. If it is set, add tearoff menu items to regular
menus, but not to popups. Add a signal "changed", which gets emitted
- when the merged ui has changed.
+ when the merged ui has changed. (#120649, #120656)
* tests/testmerge.c: Add button to test the generation of tearoff
menu items.
2003-08-31 Matthias Clasen <maclas@gmx.de>
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_get_action): New function,
+ replaces gtk_ui_manager_activate(). (#120658)
+
+ * tests/testmerge.c: Use gtk_ui_manager_get_action() instead of
+ gtk_ui_manager_activate().
+
* gtk/gtkaction.c:
* gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Add a boolean property, "add_tearoffs" with
setter and getter. If it is set, add tearoff menu items to regular
menus, but not to popups. Add a signal "changed", which gets emitted
- when the merged ui has changed.
+ when the merged ui has changed. (#120649, #120656)
* tests/testmerge.c: Add button to test the generation of tearoff
menu items.
2003-08-31 Matthias Clasen <maclas@gmx.de>
+ * gtk/gtkuimanager.[ch] (gtk_ui_manager_get_action): New function,
+ replaces gtk_ui_manager_activate(). (#120658)
+
+ * tests/testmerge.c: Use gtk_ui_manager_get_action() instead of
+ gtk_ui_manager_activate().
+
* gtk/gtkaction.c:
* gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Add a boolean property, "add_tearoffs" with
setter and getter. If it is set, add tearoff menu items to regular
menus, but not to popups. Add a signal "changed", which gets emitted
- when the merged ui has changed.
+ when the merged ui has changed. (#120649, #120656)
* tests/testmerge.c: Add button to test the generation of tearoff
menu items.
2003-08-31 Matthias Clasen <maclas@gmx.de>
+ * gtk/Makefile.am (IGNORE_HFILES): Add gtktoggleactionprivate.h
+
+ * gtk/tmpl/gtkuimanager.sgml:
+ * gtk/gtk-sections.txt: Replace gtk_ui_manager_activate by
+ gtk_ui_manager_get_action.
+
* gtk/tmpl/gtkuimanager.sgml:
* gtk/tmpl/gtkactiongroup.sgml:
* gtk/tmpl/gtkaction.sgml:
gtktextutil.h \
gtktypebuiltins.h \
gtkxembed.h \
- xembed.h
+ xembed.h \
+ gtktoggleactionprivate.h
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
gtk_ui_manager_get_action_groups
gtk_ui_manager_get_accel_group
gtk_ui_manager_get_widget
+gtk_ui_manager_get_action
gtk_ui_manager_add_ui_from_string
gtk_ui_manager_add_ui_from_file
gtk_ui_manager_remove_ui
gtk_ui_manager_get_ui
-gtk_ui_manager_activate
<SUBSECTION Standard>
GTK_TYPE_UI_MANAGER
GTK_UI_MANAGER
otherwise it is appended.
</para>
</refsect2>
-
+
<!-- ##### SECTION See_Also ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gtk_ui_manager_get_action ##### -->
+<para>
+
+</para>
+
+@self:
+@path:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_ui_manager_add_ui_from_string ##### -->
<para>
@Returns:
-<!-- ##### FUNCTION gtk_ui_manager_activate ##### -->
-<para>
-
-</para>
-
-@self:
-@path:
-
-
<!-- ##### SIGNAL GtkUIManager::add-widget ##### -->
<para>
* gtk_ui_manager_insert_action_group:
* @self: a #GtkUIManager object
* @action_group: the action group to be inserted
- * @pos: the position at which the group will be inserted
+ * @pos: the position at which the group will be inserted.
*
* Inserts an action group into the list of action groups associated
* with @self.
return NODE_INFO (node)->proxy;
}
+/**
+ * gtk_ui_manager_get_action:
+ * @self: a #GtkUIManager
+ * @path: a path
+ *
+ * Looks up an action 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 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.
+ *
+ * Return value: the action whose proxy widget is found by following the path,
+ * or %NULL if no widget was found.
+ *
+ * Since: 2.4
+ **/
+GtkAction *
+gtk_ui_manager_get_action (GtkUIManager *self,
+ const gchar *path)
+{
+ GNode *node;
+
+ g_return_val_if_fail (GTK_IS_UI_MANAGER (self), NULL);
+
+ /* ensure that there are no pending updates before we get
+ * the action */
+ gtk_ui_manager_ensure_update (self);
+
+ node = gtk_ui_manager_get_node (self, path, GTK_UI_MANAGER_UNDECIDED, FALSE);
+
+ if (node == NULL)
+ return NULL;
+
+ return NODE_INFO (node)->action;
+}
+
static GNode *
get_child_node (GtkUIManager *self,
GNode *parent,
return g_string_free (buffer, FALSE);
}
-/**
- * gtk_ui_manager_activate:
- * @self: a #GtkUIManager
- * @path: a path
- *
- * Activates the action whose proxy is found by following the given path.
- *
- * Since: 2.4
- **/
-void
-gtk_ui_manager_activate (GtkUIManager *self,
- const gchar *path)
-{
- GNode *node;
-
- g_return_if_fail (GTK_IS_UI_MANAGER (self));
-
- /* ensure that there are no pending updates before we activate
- * the action */
- gtk_ui_manager_ensure_update (self);
-
- node = gtk_ui_manager_get_node (self, path, GTK_UI_MANAGER_UNDECIDED, FALSE);
-
- if (node == NULL || NODE_INFO (node)->action == NULL)
- return;
-
- gtk_action_activate (NODE_INFO (node)->action);
-}
GtkAccelGroup *gtk_ui_manager_get_accel_group (GtkUIManager *self);
-
GtkWidget *gtk_ui_manager_get_widget (GtkUIManager *self,
const gchar *path);
+GtkAction *gtk_ui_manager_get_action (GtkUIManager *self,
+ const gchar *path);
/* these two functions are for adding UI elements to the merged user
* interface */
gchar *gtk_ui_manager_get_ui (GtkUIManager *self);
-void gtk_ui_manager_activate (GtkUIManager *self,
- const gchar *path);
-
#endif /* __GTK_UI_MANAGER_H__ */
activate_path (GtkWidget *button,
GtkUIManager *merge)
{
- gtk_ui_manager_activate (merge, "/menubar/HelpMenu/About");
+ GtkAction *action = gtk_ui_manager_get_action (merge,
+ "/menubar/HelpMenu/About");
+ if (action)
+ gtk_action_activate (action);
+ else
+ g_message ("no action found");
}
int