[gtk+] GtkButton: do not allow both types of actions
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkButton: do not allow both types of actions
- Date: Mon, 9 Jan 2012 14:16:20 +0000 (UTC)
commit cf2590d673744dd72bbaed6bd929ee1c606d70fb
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Jan 6 13:16:36 2012 -0500
GtkButton: do not allow both types of actions
Only allow one of 'action-name' or 'related-action' to be set.
https://bugzilla.gnome.org/show_bug.cgi?id=667394
gtk/gtkbutton.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index f7a9084..d0d905f 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -732,6 +732,7 @@ gtk_button_set_action_name (GtkActionable *actionable,
GtkButton *button = GTK_BUTTON (actionable);
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)
{
@@ -1041,6 +1042,8 @@ gtk_button_set_related_action (GtkButton *button,
{
GtkButtonPrivate *priv = button->priv;
+ g_return_if_fail (button->priv->action_name == NULL);
+
if (priv->action == action)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]