Add informative messages for common problems. (#137974, Owen Taylor)

Fri May 28 14:57:13 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkwidget.c (gtk_widget_set_parent): Add informative
	messages for common problems.  (#137974, Owen Taylor)
This commit is contained in:
Matthias Clasen
2004-05-28 19:01:20 +00:00
committed by Matthias Clasen
parent 4e1f3b630d
commit eecfff186b
5 changed files with 30 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Fri May 28 15:00:01 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwidget.c (gtk_widget_set_parent): Add informative
messages for common problems. (#137974, Owen Taylor)
Fri May 28 14:20:17 2004 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkevents-x11.c: Fix off-by-one allocation

View File

@ -1,3 +1,8 @@
Fri May 28 15:00:01 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwidget.c (gtk_widget_set_parent): Add informative
messages for common problems. (#137974, Owen Taylor)
Fri May 28 14:20:17 2004 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkevents-x11.c: Fix off-by-one allocation

View File

@ -1,3 +1,8 @@
Fri May 28 15:00:01 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwidget.c (gtk_widget_set_parent): Add informative
messages for common problems. (#137974, Owen Taylor)
Fri May 28 14:20:17 2004 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkevents-x11.c: Fix off-by-one allocation

View File

@ -1,3 +1,8 @@
Fri May 28 15:00:01 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwidget.c (gtk_widget_set_parent): Add informative
messages for common problems. (#137974, Owen Taylor)
Fri May 28 14:20:17 2004 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkevents-x11.c: Fix off-by-one allocation

View File

@ -4253,10 +4253,18 @@ gtk_widget_set_parent (GtkWidget *widget,
GtkStateData data;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (widget->parent == NULL);
g_return_if_fail (!GTK_WIDGET_TOPLEVEL (widget));
g_return_if_fail (GTK_IS_WIDGET (parent));
g_return_if_fail (widget != parent);
if (widget->parent != NULL)
{
g_warning ("Can't set a parent on widget which has a parent\n");
return;
}
if (GTK_WIDGET_TOPLEVEL (widget))
{
g_warning ("Can't set a parent on a toplevel widget\n");
return;
}
/* keep this function in sync with gtk_menu_attach_to_widget()
*/