summaryrefslogtreecommitdiff
path: root/gtk/gtkaction.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/gtkaction.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/gtkaction.c')
-rw-r--r--gtk/gtkaction.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c
index c4ef50dcb9..99bfcb96d6 100644
--- a/gtk/gtkaction.c
+++ b/gtk/gtkaction.c
@@ -414,9 +414,10 @@ gtk_action_buildable_get_name (GtkBuildable *buildable)
/**
* gtk_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 #GtkAction object. To add the action to a
* #GtkActionGroup and set the accelerator for the action,
@@ -434,16 +435,14 @@ gtk_action_new (const gchar *name,
const gchar *tooltip,
const gchar *stock_id)
{
- GtkAction *action;
-
- action = g_object_new (GTK_TYPE_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "stock-id", stock_id,
- NULL);
-
- return action;
+ g_return_val_if_fail (name != NULL, NULL);
+
+ return g_object_new (GTK_TYPE_ACTION,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "stock-id", stock_id,
+ NULL);
}
static void