/**
* SECTION:gtkbutton
- * @Short_description: A widget that creates a signal when clicked on
+ * @Short_description: A widget that emits a signal when clicked on
* @Title: GtkButton
*
- * The #GtkButton widget is generally used to attach a function to that is
+ * The #GtkButton widget is generally used to trigger a callback function that is
* called when the button is pressed. The various signals and how to use them
* are outlined below.
*
- * The #GtkButton widget can hold any valid child widget. That is it can hold
- * most any other standard #GtkWidget. The most commonly used child is the
+ * The #GtkButton widget can hold any valid child widget. That is, it can hold
+ * almost any other standard #GtkWidget. The most commonly used child is the
* #GtkLabel.
*/
g_return_if_fail (GTK_IS_BUTTON (button));
g_return_if_fail (button->priv->action == NULL);
- if (g_strcmp0 (action_name, button->priv->action_name) != 0)
- {
- g_free (button->priv->action_name);
- button->priv->action_name = g_strdup (action_name);
+ g_free (button->priv->action_name);
+ button->priv->action_name = g_strdup (action_name);
- gtk_button_update_action_observer (button);
+ gtk_button_update_action_observer (button);
- g_object_notify (G_OBJECT (button), "action-name");
- }
+ g_object_notify (G_OBJECT (button), "action-name");
}
static void
if (priv->focus_on_click && !gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
- if (event->button == 1)
+ if (event->button == GDK_BUTTON_PRIMARY)
g_signal_emit (button, button_signals[PRESSED], 0);
}
{
GtkButton *button;
- if (event->button == 1)
+ if (event->button == GDK_BUTTON_PRIMARY)
{
button = GTK_BUTTON (widget);
g_signal_emit (button, button_signals[RELEASED], 0);