Commit d29ec308 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

Add an active property. (#322673, Jorn Baayen)

2005-11-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktoggleaction.c (gtk_toggle_action_class_init): Add
	an active property.  (#322673, Jorn Baayen)
parent 924765a2
2005-11-29 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktoggleaction.c (gtk_toggle_action_class_init): Add
an active property. (#322673, Jorn Baayen)
Properly handle model changes in GtkTreeSelection: (#322569,
Milosz Derezynski)
......
2005-11-29 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktoggleaction.c (gtk_toggle_action_class_init): Add
an active property. (#322673, Jorn Baayen)
Properly handle model changes in GtkTreeSelection: (#322569,
Milosz Derezynski)
......
......@@ -47,7 +47,8 @@ enum
enum {
PROP_0,
PROP_DRAW_AS_RADIO
PROP_DRAW_AS_RADIO,
PROP_ACTIVE
};
static void gtk_toggle_action_init (GtkToggleAction *action);
......@@ -133,6 +134,21 @@ gtk_toggle_action_class_init (GtkToggleActionClass *klass)
FALSE,
GTK_PARAM_READWRITE));
/**
* GtkToggleAction:active:
*
* If the toggle action should be active in or not.
*
* Since: 2.10
*/
g_object_class_install_property (gobject_class,
PROP_ACTIVE,
g_param_spec_boolean ("active",
P_("Active"),
P_("If the toggle action should be active in or not"),
FALSE,
GTK_PARAM_READWRITE));
action_signals[TOGGLED] =
g_signal_new (I_("toggled"),
G_OBJECT_CLASS_TYPE (klass),
......@@ -199,6 +215,9 @@ get_property (GObject *object,
case PROP_DRAW_AS_RADIO:
g_value_set_boolean (value, gtk_toggle_action_get_draw_as_radio (action));
break;
case PROP_ACTIVE:
g_value_set_boolean (value, gtk_toggle_action_get_active (action));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -218,6 +237,9 @@ set_property (GObject *object,
case PROP_DRAW_AS_RADIO:
gtk_toggle_action_set_draw_as_radio (action, g_value_get_boolean (value));
break;
case PROP_ACTIVE:
gtk_toggle_action_set_active (action, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -235,6 +257,8 @@ gtk_toggle_action_activate (GtkAction *action)
toggle_action->private_data->active = !toggle_action->private_data->active;
g_object_notify (action, "active");
gtk_toggle_action_toggled (toggle_action);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment