+2005-07-21 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkwidget.c (gtk_widget_modify_bg, gtk_widget_modify_base):
+ Add hints on how to handle "no window" widgets. (#136347)
+
+
2005-07-20 Keith Packard <keithp@keithp.com>
* gdk/x11/gdkdrawable-x11.c: (gdk_x11_ref_cairo_surface):
}
}
+static void
+check_window (gpointer window,
+ gpointer widget)
+{
+ gpointer data;
+
+ gdk_window_get_user_data (GDK_WINDOW (window), &data);
+
+ if (data == widget)
+ g_warning ("Faulty widget implementation: unrealize failed to clear window");
+}
+
/**
* gtk_widget_unrealize:
* @widget: a #GtkWidget
GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED | GTK_MAPPED);
g_object_unref (widget);
}
+
+#ifdef GDK_WINDOWING_X11
+ gdk_x11_display_foreach_window (gtk_widget_get_display (widget),
+ check_window, widget);
+#endif
}
/*****************************************
*
* Sets the background color for a widget in a particular state. All
* other style values are left untouched. See also
- * gtk_widget_modify_style().
+ * gtk_widget_modify_style().
+ *
+ * Note that "no window" widgets (which have the %GTK_NO_WINDOW flag set)
+ * draw on their parent container's window and thus may not draw any background
+ * themselves. This is the case for e.g. #GtkLabel. To modify the background
+ * of such widgets, you have to set the background color on their parent; if you want
+ * to set the background of a rectangular area around a label, try placing the
+ * label in a #GtkEventBox widget and setting the background color on that.
**/
void
gtk_widget_modify_bg (GtkWidget *widget,
* is the background color used along with the text color
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
* and #GtkTextView. See also gtk_widget_modify_style().
+ *
+ * Note that "no window" widgets (which have the %GTK_NO_WINDOW flag set)
+ * draw on their parent container's window and thus may not draw any background
+ * themselves. This is the case for e.g. #GtkLabel. To modify the background
+ * of such widgets, you have to set the base color on their parent; if you want
+ * to set the background of a rectangular area around a label, try placing the
+ * label in a #GtkEventBox widget and setting the base color on that.
**/
void
gtk_widget_modify_base (GtkWidget *widget,