summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2004-08-12 03:25:49 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-08-12 03:25:49 +0000
commite6fdcff1fb9aa22d6a81bb40cd1b71cac998b96c (patch)
treed38f3876acc26a96692b6fab68a9b88ab8543dd9 /gtk
parentc710d479f1b745bd95a73b82fdf6f47be3b9bd36 (diff)
downloadgtk+-e6fdcff1fb9aa22d6a81bb40cd1b71cac998b96c.tar.gz
Add setters for the ::sensitive and ::visible properties of GtkAction.
Wed Aug 11 23:14:25 2004 Matthias Clasen <maclas@gmx.de> * gtk/gtk.symbols: * gtk/gtkaction.h: * gtk/gtkaction.c (gtk_action_set_sensitive): (gtk_action_set_visible): Add setters for the ::sensitive and ::visible properties of GtkAction. (#149622, David Malcolm)
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkaction.c56
-rw-r--r--gtk/gtkaction.h4
2 files changed, 60 insertions, 0 deletions
diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c
index a9592339f2..0a37c428d2 100644
--- a/gtk/gtkaction.c
+++ b/gtk/gtkaction.c
@@ -1242,6 +1242,34 @@ gtk_action_get_sensitive (GtkAction *action)
}
/**
+ * gtk_action_set_sensitive:
+ * @action: the action object
+ * @sensitive: %TRUE to make the action sensitive
+ *
+ * Sets the ::sensitive property of the action to @sensitive. Note that
+ * this doesn't necessarily mean effective sensitivity. See
+ * gtk_action_is_sensitive()
+ * for that.
+ *
+ * Since: 2.6
+ **/
+void
+gtk_action_set_sensitive (GtkAction *action,
+ gboolean sensitive)
+{
+ g_return_if_fail (GTK_IS_ACTION (action));
+
+ sensitive = sensitive != FALSE;
+
+ if (action->private_data->sensitive != sensitive)
+ {
+ action->private_data->sensitive = sensitive;
+
+ g_object_notify (G_OBJECT (action), "sensitive");
+ }
+}
+
+/**
* gtk_action_is_visible:
* @action: the action object
*
@@ -1285,6 +1313,34 @@ gtk_action_get_visible (GtkAction *action)
}
/**
+ * gtk_action_set_visible:
+ * @action: the action object
+ * @visible: %TRUE to make the action visible
+ *
+ * Sets the ::visible property of the action to @visible. Note that
+ * this doesn't necessarily mean effective visibility. See
+ * gtk_action_is_visible()
+ * for that.
+ *
+ * Since: 2.6
+ **/
+void
+gtk_action_set_visible (GtkAction *action,
+ gboolean visible)
+{
+ g_return_if_fail (GTK_IS_ACTION (action));
+
+ visible = visible != FALSE;
+
+ if (action->private_data->visible != visible)
+ {
+ action->private_data->visible = visible;
+
+ g_object_notify (G_OBJECT (action), "visible");
+ }
+}
+
+/**
* gtk_action_block_activate_from:
* @action: the action object
* @proxy: a proxy widget
diff --git a/gtk/gtkaction.h b/gtk/gtkaction.h
index 53209baa1d..33ae055a5e 100644
--- a/gtk/gtkaction.h
+++ b/gtk/gtkaction.h
@@ -88,8 +88,12 @@ GtkAction *gtk_action_new (const gchar *name,
const gchar* gtk_action_get_name (GtkAction *action);
gboolean gtk_action_is_sensitive (GtkAction *action);
gboolean gtk_action_get_sensitive (GtkAction *action);
+void gtk_action_set_sensitive (GtkAction *action,
+ gboolean sensitive);
gboolean gtk_action_is_visible (GtkAction *action);
gboolean gtk_action_get_visible (GtkAction *action);
+void gtk_action_set_visible (GtkAction *action,
+ gboolean visible);
void gtk_action_activate (GtkAction *action);
GtkWidget* gtk_action_create_icon (GtkAction *action,
GtkIconSize icon_size);