summaryrefslogtreecommitdiff
path: root/gtk/gtktoggleaction.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2007-09-09 20:18:24 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2007-09-09 20:18:24 +0000
commit8fb6c039bbfee62cadc25238091711f2f7058985 (patch)
tree29ae3574869897ce7cb8a0523c0146306110535e /gtk/gtktoggleaction.c
parentc87cfa8afdb9b71127de0fe0a6c751109f81657b (diff)
downloadgtk+-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/gtktoggleaction.c')
-rw-r--r--gtk/gtktoggleaction.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/gtk/gtktoggleaction.c b/gtk/gtktoggleaction.c
index 941b6b7963..1a1eaa0824 100644
--- a/gtk/gtktoggleaction.c
+++ b/gtk/gtktoggleaction.c
@@ -143,9 +143,10 @@ gtk_toggle_action_init (GtkToggleAction *action)
/**
* 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
+ * @label: The label displayed in menu items and on buttons, or %NULL
+ * @tooltip: A tooltip for the action, or %NULL
+ * @stock_id: The stock icon to display in widgets representing the
+ * action, or %NULL
*
* Creates a new #GtkToggleAction object. To add the action to
* a #GtkActionGroup and set the accelerator for the action,
@@ -161,16 +162,14 @@ gtk_toggle_action_new (const gchar *name,
const gchar *tooltip,
const gchar *stock_id)
{
- GtkToggleAction *action;
+ g_return_val_if_fail (name != NULL, NULL);
- action = g_object_new (GTK_TYPE_TOGGLE_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "stock-id", stock_id,
- NULL);
-
- return action;
+ return g_object_new (GTK_TYPE_TOGGLE_ACTION,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "stock-id", stock_id,
+ NULL);
}
static void