changeset 403:6a3ef130962f

Check that the child is actually a label before trying to operate on it. Will avoid warnings on bitmap buttons.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 10 May 2003 07:54:09 +0000
parents 0f0183aa2b05
children 720e61df8cf6
files gtk/dw.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Sat May 10 07:35:38 2003 +0000
+++ b/gtk/dw.c	Sat May 10 07:54:09 2003 +0000
@@ -2824,7 +2824,12 @@
 	else if(GTK_IS_LABEL(handle))
 		gtk_label_set_text(GTK_LABEL(handle), text);
 	else if(GTK_IS_BUTTON(handle))
-		gtk_label_set_text(GTK_LABEL(GTK_BUTTON(handle)->child), text);
+	{
+		GtkWidget *label = GTK_BUTTON(handle)->child;
+
+		if(GTK_IS_LABEL(label))
+			gtk_label_set_text(GTK_LABEL(label), text);
+	}
 	else if(GTK_IS_FRAME(handle))
 	{
 		GtkWidget *tmp = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_label");