[gimp] app: do not add both a GtkLabel and GtkImage child to a GtkCheckButton.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: do not add both a GtkLabel and GtkImage child to a GtkCheckButton.
- Date: Thu, 11 Feb 2016 15:00:55 +0000 (UTC)
commit e6f4dad28c1e763e877cb6158ea5e507cf4a400b
Author: Jehan <jehan girinstud io>
Date: Thu Feb 11 15:54:36 2016 +0100
app: do not add both a GtkLabel and GtkImage child to a GtkCheckButton.
Since commit 9c4dd96, a NULL label to gimp_prop_check_button_new()
generates a label from the property nick. Trying to add a GtkImage in
the button outputs a warning because a GtkBin can have only one child.
Fixes the warning:
Gtk-WARNING **: Attempting to add a widget with type GtkImage to a
GtkCheckButton, but as a GtkBin subclass a GtkCheckButton can only contain one
widget at a time; it already contains a widget of type GtkLabel
app/widgets/gimpviewablebox.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpviewablebox.c b/app/widgets/gimpviewablebox.c
index 6fdc7b0..ce40644 100644
--- a/app/widgets/gimpviewablebox.c
+++ b/app/widgets/gimpviewablebox.c
@@ -374,6 +374,10 @@ gradient_box_new (GimpContainer *container,
image = gtk_image_new_from_icon_name (GIMP_STOCK_FLIP_HORIZONTAL,
GTK_ICON_SIZE_MENU);
+ /* gimp_prop_check_button_new() adds the property nick as label of
+ * the button by default. */
+ gtk_container_remove (GTK_CONTAINER (toggle),
+ gtk_bin_get_child (GTK_BIN (toggle)));
gtk_container_add (GTK_CONTAINER (toggle), image);
gtk_widget_show (image);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]