*
* A toggle button is created by calling either gtk_toggle_button_new() or
* gtk_toggle_button_new_with_label(). If using the former, it is advisable to
- * pack a widget, (such as a #GtkLabel and/or a #GtkPixmap), into the toggle
+ * pack a widget, (such as a #GtkLabel and/or a #GtkImage), into the toggle
* button's container. (See #GtkButton for more information).
*
* The state of a #GtkToggleButton can be set specifically using
};
-static gint gtk_toggle_button_draw (GtkWidget *widget,
- cairo_t *cr);
static gboolean gtk_toggle_button_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling);
static void gtk_toggle_button_pressed (GtkButton *button);
gobject_class->set_property = gtk_toggle_button_set_property;
gobject_class->get_property = gtk_toggle_button_get_property;
- widget_class->draw = gtk_toggle_button_draw;
widget_class->mnemonic_activate = gtk_toggle_button_mnemonic_activate;
button_class->pressed = gtk_toggle_button_pressed;
*
* Sets the status of the toggle button. Set to %TRUE if you want the
* GtkToggleButton to be 'pressed in', and %FALSE to raise it.
- * This action causes the toggled signal to be emitted.
+ * This action causes the #GtkToggleButton::toggled signal and the
+ * #GtkButton::clicked signal to be emitted.
*/
void
gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
return toggle_button->priv->inconsistent;
}
-static gint
-gtk_toggle_button_draw (GtkWidget *widget,
- cairo_t *cr)
-{
- GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (widget);
- GtkToggleButtonPrivate *priv = toggle_button->priv;
- GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
- GtkButton *button = GTK_BUTTON (widget);
- GtkStateType state;
-
- state = gtk_widget_get_state_flags (widget);
-
- if (priv->inconsistent)
- state |= GTK_STATE_FLAG_INCONSISTENT;
- else if (button->priv->depressed)
- state |= GTK_STATE_FLAG_ACTIVE;
-
- _gtk_button_paint (button, cr,
- gtk_widget_get_allocated_width (widget),
- gtk_widget_get_allocated_height (widget),
- state);
-
- if (child)
- gtk_container_propagate_draw (GTK_CONTAINER (widget), child, cr);
-
- return FALSE;
-}
-
static gboolean
gtk_toggle_button_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling)
else
depressed = priv->active;
- if (button->priv->in_button && (!button->priv->button_down || priv->draw_indicator))
+ if (button->priv->in_button)
new_state |= GTK_STATE_FLAG_PRELIGHT;
if (depressed)