diff options
author | Matthias Clasen <maclas@gmx.de> | 2004-01-07 21:54:33 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-01-07 21:54:33 +0000 |
commit | a11e45a1ebc9574ea3a60f6bc031affecd088208 (patch) | |
tree | 943f86d4e5a2fe931d447710bfb59593eabffc6d /gtk/gtktoggleaction.c | |
parent | 8f5b438e6b3eb37af60b368b9bda366fc23f2d42 (diff) | |
download | gtk+-a11e45a1ebc9574ea3a60f6bc031affecd088208.tar.gz |
Add creation functions for actions.
Wed Jan 7 22:20:20 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkaction.h:
* gtk/gtkaction.c (gtk_action_new):
* gtk/gtktoggleaction.h:
* gtk/gtktoggleaction.c (gtk_toggle_action_new):
* gtk/gtkradioaction.h:
* gtk/gtkradioaction.c (gtk_radio_action_new): Add creation
functions for actions.
* gtk/gtkactiongroup.c (gtk_action_group_add_actions_full):
(gtk_action_group_add_toggle_actions_full):
(gtk_action_group_add_radio_actions_full): and use the
new functions here. (#125322, Patch by Jeff Frank)
Diffstat (limited to 'gtk/gtktoggleaction.c')
-rw-r--r-- | gtk/gtktoggleaction.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/gtk/gtktoggleaction.c b/gtk/gtktoggleaction.c index c3ac2d71f6..1f4a8d7a03 100644 --- a/gtk/gtktoggleaction.c +++ b/gtk/gtktoggleaction.c @@ -151,6 +151,39 @@ gtk_toggle_action_init (GtkToggleAction *action) action->private_data->draw_as_radio = FALSE; } +/** + * gtk_toggle_action_new: + * @name: A unique name for the action + * @label: The label displayed in menu items and on buttons + * @tooltip: A tooltip for the action + * @stock_id: The stock icon to display in widgets representing the action + * + * Creates a new #GtkToggleAction object. To add the action to + * a #GtkActionGroup and set the accelerator for the action, + * call gtk_action_group_add_action_with_accel(). + * + * Return value: a new #GtkToggleAction + * + * Since: 2.4 + */ +GtkToggleAction * +gtk_toggle_action_new (const gchar *name, + const gchar *label, + const gchar *tooltip, + const gchar *stock_id) +{ + GtkToggleAction *action; + + action = g_object_new (GTK_TYPE_TOGGLE_ACTION, + "name", name, + "label", label, + "tooltip", tooltip, + "stock_id", stock_id, + NULL); + + return action; +} + static void get_property (GObject *object, guint prop_id, @@ -170,7 +203,6 @@ get_property (GObject *object, } } - static void set_property (GObject *object, guint prop_id, |