PROP_VALUE,
PROP_SIZE,
PROP_ADJUSTMENT,
- PROP_ICONS
+ PROP_ICONS,
+ PROP_ACTIVE
};
typedef struct
G_TYPE_STRV,
GTK_PARAM_READWRITE));
+ /**
+ * GtkScaleButton:active: (attributes org.gtk.Property.get=gtk_scale_button_get_active)
+ *
+ * If the scale button should be pressed in.
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_ACTIVE,
+ g_param_spec_boolean ("active", NULL, NULL,
+ FALSE,
+ GTK_PARAM_READABLE));
+
/**
* GtkScaleButton::value-changed:
* @button: the object which received the signal
GtkScaleButtonPrivate *priv = gtk_scale_button_get_instance_private (button);
gboolean active;
+ g_object_notify (G_OBJECT (button), "active");
+
active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->button));
if (active)
case PROP_ICONS:
g_value_set_boxed (value, priv->icon_list);
break;
+ case PROP_ACTIVE:
+ g_value_set_boolean (value, gtk_scale_button_get_active (button));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
return priv->dock;
}
+/**
+ * gtk_scale_button_get_active: (attributes org.gtk.Method.get_property=active)
+ * @button: a `GtkScaleButton`
+ *
+ * Queries a `GtkScaleButton` and returns its current state.
+ *
+ * Returns %TRUE if the scale button is pressed in and %FALSE
+ * if it is raised.
+ *
+ * Returns: whether the button is pressed
+ *
+ * Since: 4.10
+ */
+gboolean
+gtk_scale_button_get_active (GtkScaleButton *button)
+{
+ GtkScaleButtonPrivate *priv = gtk_scale_button_get_instance_private (button);
+
+ g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), FALSE);
+
+ return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->button));
+}
+
static void
gtk_scale_button_set_orientation_private (GtkScaleButton *button,
GtkOrientation orientation)
GtkWidget * gtk_scale_button_get_minus_button (GtkScaleButton *button);
GDK_AVAILABLE_IN_ALL
GtkWidget * gtk_scale_button_get_popup (GtkScaleButton *button);
+GDK_AVAILABLE_IN_4_10
+gboolean gtk_scale_button_get_active (GtkScaleButton *button);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkScaleButton, g_object_unref)