diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-09-09 20:18:24 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-09-09 20:18:24 +0000 |
commit | 8fb6c039bbfee62cadc25238091711f2f7058985 (patch) | |
tree | 29ae3574869897ce7cb8a0523c0146306110535e /gtk/gtkradioaction.c | |
parent | c87cfa8afdb9b71127de0fe0a6c751109f81657b (diff) | |
download | gtk+-8fb6c039bbfee62cadc25238091711f2f7058985.tar.gz |
Update the documentation to mark the optional constructors parameters. The
2007-09-09 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkaction.c:
* gtk/gtkradioaction.c:
* gtk/gtkrecentaction.c:
* gtk/gtktoggleaction.c: Update the documentation to mark
the optional constructors parameters. The GtkAction::name
property is required, instead, as it is used by GtkUIManager
to find the action object from the XML. (#450032, Murray Cumming,
patch by Emmanuele Bassi)
svn path=/trunk/; revision=18773
Diffstat (limited to 'gtk/gtkradioaction.c')
-rw-r--r-- | gtk/gtkradioaction.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/gtk/gtkradioaction.c b/gtk/gtkradioaction.c index 123e310c80..b2c8adee76 100644 --- a/gtk/gtkradioaction.c +++ b/gtk/gtkradioaction.c @@ -181,11 +181,12 @@ gtk_radio_action_init (GtkRadioAction *action) /** * gtk_radio_action_new: * @name: A unique name for the action - * @label: The label displayed in menu items and on buttons - * @tooltip: A tooltip for this action - * @stock_id: The stock icon to display in widgets representing this action - * @value: The value which gtk_radio_action_get_current_value() should return - * if this action is selected. + * @label: The label displayed in menu items and on buttons, or %NULL + * @tooltip: A tooltip for this action, or %NULL + * @stock_id: The stock icon to display in widgets representing this + * action, or %NULL + * @value: The value which gtk_radio_action_get_current_value() should + * return if this action is selected. * * Creates a new #GtkRadioAction object. To add the action to * a #GtkActionGroup and set the accelerator for the action, @@ -202,17 +203,15 @@ gtk_radio_action_new (const gchar *name, const gchar *stock_id, gint value) { - GtkRadioAction *action; - - action = g_object_new (GTK_TYPE_RADIO_ACTION, - "name", name, - "label", label, - "tooltip", tooltip, - "stock-id", stock_id, - "value", value, - NULL); - - return action; + g_return_val_if_fail (name != NULL, NULL); + + return g_object_new (GTK_TYPE_RADIO_ACTION, + "name", name, + "label", label, + "tooltip", tooltip, + "stock-id", stock_id, + "value", value, + NULL); } static void |