diff options
author | Tim Janik <timj@gtk.org> | 1998-06-17 08:48:22 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-06-17 08:48:22 +0000 |
commit | 7d0331a679c00c20db87822739e7544c67c6c2fe (patch) | |
tree | ca044e4a14619f6534aff6997b4212d6a0535fba /gtk | |
parent | 7bb4d7d961d2856f235db861c93a4838ae7b4f50 (diff) | |
download | gtk+-7d0331a679c00c20db87822739e7544c67c6c2fe.tar.gz |
new function gdk_window_at_pointer() to retrive the current GdkWindow the
Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
* gdk/gdk.h:
* gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
the current GdkWindow the pointer is on if there is any.
* gtk/gtktable.c (gtk_table_init): preallocate a table with one row
and one column, so we don't construction logic at all. changed a few
(x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
unsigned int wraps.
* gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
portion, added an additional check for parent != widget.
* more GtkType and macro fixups.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkbox.c | 8 | ||||
-rw-r--r-- | gtk/gtkbox.h | 47 | ||||
-rw-r--r-- | gtk/gtkhbox.c | 6 | ||||
-rw-r--r-- | gtk/gtkhbox.h | 17 | ||||
-rw-r--r-- | gtk/gtkmisc.c | 6 | ||||
-rw-r--r-- | gtk/gtkmisc.h | 33 | ||||
-rw-r--r-- | gtk/gtkpixmap.c | 6 | ||||
-rw-r--r-- | gtk/gtkpixmap.h | 25 | ||||
-rw-r--r-- | gtk/gtktable.c | 24 | ||||
-rw-r--r-- | gtk/gtkvbox.c | 6 | ||||
-rw-r--r-- | gtk/gtkvbox.h | 17 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 4 |
12 files changed, 106 insertions, 93 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 8ed7dc022b..0804b1d21d 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -68,10 +68,10 @@ static GtkType gtk_box_child_type (GtkContainer *container); static GtkContainerClass *parent_class = NULL; -guint +GtkType gtk_box_get_type (void) { - static guint box_type = 0; + static GtkType box_type = 0; if (!box_type) { @@ -86,7 +86,7 @@ gtk_box_get_type (void) (GtkArgGetFunc) gtk_box_get_arg, }; - box_type = gtk_type_unique (gtk_container_get_type (), &box_info); + box_type = gtk_type_unique (GTK_TYPE_CONTAINER, &box_info); } return box_type; @@ -103,7 +103,7 @@ gtk_box_class_init (GtkBoxClass *class) widget_class = (GtkWidgetClass*) class; container_class = (GtkContainerClass*) class; - parent_class = gtk_type_class (gtk_container_get_type ()); + parent_class = gtk_type_class (GTK_TYPE_CONTAINER); gtk_object_add_arg_type ("GtkBox::spacing", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_SPACING); gtk_object_add_arg_type ("GtkBox::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS); diff --git a/gtk/gtkbox.h b/gtk/gtkbox.h index 223207f958..db7a26798d 100644 --- a/gtk/gtkbox.h +++ b/gtk/gtkbox.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -26,22 +26,25 @@ #ifdef __cplusplus extern "C" { +#pragma } #endif /* __cplusplus */ -#define GTK_BOX(obj) GTK_CHECK_CAST (obj, gtk_box_get_type (), GtkBox) -#define GTK_BOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_box_get_type (), GtkBoxClass) -#define GTK_IS_BOX(obj) GTK_CHECK_TYPE (obj, gtk_box_get_type ()) +#define GTK_TYPE_BOX (gtk_box_get_type ()) +#define GTK_BOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_BOX, GtkBox)) +#define GTK_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX, GtkBoxClass)) +#define GTK_IS_BOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_BOX)) +#define GTK_IS_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOX)) -typedef struct _GtkBox GtkBox; +typedef struct _GtkBox GtkBox; typedef struct _GtkBoxClass GtkBoxClass; typedef struct _GtkBoxChild GtkBoxChild; struct _GtkBox { GtkContainer container; - + GList *children; gint16 spacing; guint homogeneous : 1; @@ -62,39 +65,39 @@ struct _GtkBoxChild }; -guint gtk_box_get_type (void); -void gtk_box_pack_start (GtkBox *box, +GtkType gtk_box_get_type (void); +void gtk_box_pack_start (GtkBox *box, GtkWidget *child, gboolean expand, gboolean fill, - guint padding); -void gtk_box_pack_end (GtkBox *box, + guint padding); +void gtk_box_pack_end (GtkBox *box, GtkWidget *child, gboolean expand, gboolean fill, - guint padding); -void gtk_box_pack_start_defaults (GtkBox *box, + guint padding); +void gtk_box_pack_start_defaults (GtkBox *box, GtkWidget *widget); -void gtk_box_pack_end_defaults (GtkBox *box, +void gtk_box_pack_end_defaults (GtkBox *box, GtkWidget *widget); -void gtk_box_set_homogeneous (GtkBox *box, +void gtk_box_set_homogeneous (GtkBox *box, gboolean homogeneous); -void gtk_box_set_spacing (GtkBox *box, - gint spacing); -void gtk_box_reorder_child (GtkBox *box, +void gtk_box_set_spacing (GtkBox *box, + gint spacing); +void gtk_box_reorder_child (GtkBox *box, GtkWidget *child, - gint position); -void gtk_box_query_child_packing (GtkBox *box, + gint position); +void gtk_box_query_child_packing (GtkBox *box, GtkWidget *child, gboolean *expand, gboolean *fill, - guint *padding, + guint *padding, GtkPackType *pack_type); -void gtk_box_set_child_packing (GtkBox *box, +void gtk_box_set_child_packing (GtkBox *box, GtkWidget *child, gboolean expand, gboolean fill, - guint padding, + guint padding, GtkPackType pack_type); diff --git a/gtk/gtkhbox.c b/gtk/gtkhbox.c index 98a4843b03..9b36dc7e1b 100644 --- a/gtk/gtkhbox.c +++ b/gtk/gtkhbox.c @@ -27,10 +27,10 @@ static void gtk_hbox_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -guint +GtkType gtk_hbox_get_type (void) { - static guint hbox_type = 0; + static GtkType hbox_type = 0; if (!hbox_type) { @@ -45,7 +45,7 @@ gtk_hbox_get_type (void) (GtkArgGetFunc) NULL, }; - hbox_type = gtk_type_unique (gtk_box_get_type (), &hbox_info); + hbox_type = gtk_type_unique (GTK_TYPE_BOX, &hbox_info); } return hbox_type; diff --git a/gtk/gtkhbox.h b/gtk/gtkhbox.h index 7d0dd95c1e..1bf5cb088c 100644 --- a/gtk/gtkhbox.h +++ b/gtk/gtkhbox.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -26,15 +26,18 @@ #ifdef __cplusplus extern "C" { +#pragma } #endif /* __cplusplus */ -#define GTK_HBOX(obj) GTK_CHECK_CAST (obj, gtk_hbox_get_type (), GtkHBox) -#define GTK_HBOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_hbox_get_type (), GtkHBoxClass) -#define GTK_IS_HBOX(obj) GTK_CHECK_TYPE (obj, gtk_hbox_get_type ()) +#define GTK_TYPE_HBOX (gtk_hbox_get_type ()) +#define GTK_HBOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_HBOX, GtkHBox)) +#define GTK_HBOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_HBOX, GtkHBoxClass)) +#define GTK_IS_HBOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_HBOX)) +#define GTK_IS_HBOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HBOX)) -typedef struct _GtkHBox GtkHBox; +typedef struct _GtkHBox GtkHBox; typedef struct _GtkHBoxClass GtkHBoxClass; struct _GtkHBox @@ -48,8 +51,8 @@ struct _GtkHBoxClass }; -guint gtk_hbox_get_type (void); -GtkWidget* gtk_hbox_new (gint homogeneous, +GtkType gtk_hbox_get_type (void); +GtkWidget* gtk_hbox_new (gint homogeneous, gint spacing); diff --git a/gtk/gtkmisc.c b/gtk/gtkmisc.c index 4c773b9773..bfe4d2fdcc 100644 --- a/gtk/gtkmisc.c +++ b/gtk/gtkmisc.c @@ -39,10 +39,10 @@ static void gtk_misc_get_arg (GtkMisc *misc, guint arg_id); -guint +GtkType gtk_misc_get_type (void) { - static guint misc_type = 0; + static GtkType misc_type = 0; if (!misc_type) { @@ -57,7 +57,7 @@ gtk_misc_get_type (void) (GtkArgGetFunc) gtk_misc_get_arg, }; - misc_type = gtk_type_unique (gtk_widget_get_type (), &misc_info); + misc_type = gtk_type_unique (GTK_TYPE_WIDGET, &misc_info); } return misc_type; diff --git a/gtk/gtkmisc.h b/gtk/gtkmisc.h index bcb28d61b4..0e1de8e6eb 100644 --- a/gtk/gtkmisc.h +++ b/gtk/gtkmisc.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -26,24 +26,27 @@ #ifdef __cplusplus extern "C" { +#pragma } #endif /* __cplusplus */ -#define GTK_MISC(obj) GTK_CHECK_CAST (obj, gtk_misc_get_type (), GtkMisc) -#define GTK_MISC_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_misc_get_type (), GtkMiscClass) -#define GTK_IS_MISC(obj) GTK_CHECK_TYPE (obj, gtk_misc_get_type ()) +#define GTK_TYPE_MISC (gtk_misc_get_type ()) +#define GTK_MISC(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MISC, GtkMisc)) +#define GTK_MISC_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MISC, GtkMiscClass)) +#define GTK_IS_MISC(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_MISC)) +#define GTK_IS_MISC_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MISC)) -typedef struct _GtkMisc GtkMisc; +typedef struct _GtkMisc GtkMisc; typedef struct _GtkMiscClass GtkMiscClass; struct _GtkMisc { GtkWidget widget; - + gfloat xalign; gfloat yalign; - + guint16 xpad; guint16 ypad; }; @@ -54,13 +57,13 @@ struct _GtkMiscClass }; -guint gtk_misc_get_type (void); -void gtk_misc_set_alignment (GtkMisc *misc, - gfloat xalign, - gfloat yalign); -void gtk_misc_set_padding (GtkMisc *misc, - gint xpad, - gint ypad); +GtkType gtk_misc_get_type (void); +void gtk_misc_set_alignment (GtkMisc *misc, + gfloat xalign, + gfloat yalign); +void gtk_misc_set_padding (GtkMisc *misc, + gint xpad, + gint ypad); #ifdef __cplusplus @@ -68,4 +71,4 @@ void gtk_misc_set_padding (GtkMisc *misc, #endif /* __cplusplus */ -#endif /* __GTK_LABEL_H__ */ +#endif /* __GTK_MISC_H__ */ diff --git a/gtk/gtkpixmap.c b/gtk/gtkpixmap.c index 06e9aa7312..eec55f0bf0 100644 --- a/gtk/gtkpixmap.c +++ b/gtk/gtkpixmap.c @@ -28,10 +28,10 @@ static void gtk_pixmap_finalize (GtkObject *object); static GtkWidgetClass *parent_class; -guint +GtkType gtk_pixmap_get_type (void) { - static guint pixmap_type = 0; + static GtkType pixmap_type = 0; if (!pixmap_type) { @@ -46,7 +46,7 @@ gtk_pixmap_get_type (void) (GtkArgGetFunc) NULL, }; - pixmap_type = gtk_type_unique (gtk_misc_get_type (), &pixmap_info); + pixmap_type = gtk_type_unique (GTK_TYPE_MISC, &pixmap_info); } return pixmap_type; diff --git a/gtk/gtkpixmap.h b/gtk/gtkpixmap.h index 9a7d5ad6ac..fbcc74c6f0 100644 --- a/gtk/gtkpixmap.h +++ b/gtk/gtkpixmap.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -26,21 +26,24 @@ #ifdef __cplusplus extern "C" { +#pragma } #endif /* __cplusplus */ -#define GTK_PIXMAP(obj) GTK_CHECK_CAST (obj, gtk_pixmap_get_type (), GtkPixmap) -#define GTK_PIXMAP_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_pixmap_get_type (), GtkPixmapClass) -#define GTK_IS_PIXMAP(obj) GTK_CHECK_TYPE (obj, gtk_pixmap_get_type ()) +#define GTK_TYPE_PIXMAP (gtk_pixmap_get_type ()) +#define GTK_PIXMAP(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_PIXMAP, GtkPixmap)) +#define GTK_PIXMAP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PIXMAP, GtkPixmapClass)) +#define GTK_IS_PIXMAP(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_PIXMAP)) +#define GTK_IS_PIXMAP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PIXMAP)) -typedef struct _GtkPixmap GtkPixmap; -typedef struct _GtkPixmapClass GtkPixmapClass; +typedef struct _GtkPixmap GtkPixmap; +typedef struct _GtkPixmapClass GtkPixmapClass; struct _GtkPixmap { GtkMisc misc; - + GdkPixmap *pixmap; GdkBitmap *mask; }; @@ -51,13 +54,13 @@ struct _GtkPixmapClass }; -guint gtk_pixmap_get_type (void); -GtkWidget* gtk_pixmap_new (GdkPixmap *pixmap, +GtkType gtk_pixmap_get_type (void); +GtkWidget* gtk_pixmap_new (GdkPixmap *pixmap, GdkBitmap *mask); -void gtk_pixmap_set (GtkPixmap *pixmap, +void gtk_pixmap_set (GtkPixmap *pixmap, GdkPixmap *val, GdkBitmap *mask); -void gtk_pixmap_get (GtkPixmap *pixmap, +void gtk_pixmap_get (GtkPixmap *pixmap, GdkPixmap **val, GdkBitmap **mask); diff --git a/gtk/gtktable.c b/gtk/gtktable.c index d3b3e36538..a62dc59385 100644 --- a/gtk/gtktable.c +++ b/gtk/gtktable.c @@ -367,6 +367,8 @@ gtk_table_init (GtkTable *table) table->column_spacing = 0; table->row_spacing = 0; table->homogeneous = FALSE; + + gtk_table_resize (table, 1, 1); } GtkWidget* @@ -544,8 +546,7 @@ gtk_table_set_row_spacing (GtkTable *table, { g_return_if_fail (table != NULL); g_return_if_fail (GTK_IS_TABLE (table)); - /* g_return_if_fail ((row >= 0) && (row < (table->nrows - 1))); */ - g_return_if_fail (row < table->nrows - 1); + g_return_if_fail (row + 1 < table->nrows); if (table->rows[row].spacing != spacing) { @@ -563,8 +564,7 @@ gtk_table_set_col_spacing (GtkTable *table, { g_return_if_fail (table != NULL); g_return_if_fail (GTK_IS_TABLE (table)); - /* g_return_if_fail ((column >= 0) && (column < (table->ncols - 1))); */ - g_return_if_fail (column < table->ncols - 1); + g_return_if_fail (column + 1 < table->ncols); if (table->cols[column].spacing != spacing) { @@ -585,7 +585,7 @@ gtk_table_set_row_spacings (GtkTable *table, g_return_if_fail (GTK_IS_TABLE (table)); table->row_spacing = spacing; - for (row = 0; row < table->nrows - 1; row++) + for (row = 0; row + 1 < table->nrows; row++) table->rows[row].spacing = spacing; if (GTK_WIDGET_VISIBLE (table)) @@ -602,7 +602,7 @@ gtk_table_set_col_spacings (GtkTable *table, g_return_if_fail (GTK_IS_TABLE (table)); table->column_spacing = spacing; - for (col = 0; col < table->ncols - 1; col++) + for (col = 0; col + 1 < table->ncols; col++) table->cols[col].spacing = spacing; if (GTK_WIDGET_VISIBLE (table)) @@ -777,12 +777,12 @@ gtk_table_size_request (GtkWidget *widget, for (col = 0; col < table->ncols; col++) requisition->width += table->cols[col].requisition; - for (col = 0; col < table->ncols - 1; col++) + for (col = 0; col + 1 < table->ncols; col++) requisition->width += table->cols[col].spacing; for (row = 0; row < table->nrows; row++) requisition->height += table->rows[row].requisition; - for (row = 0; row < table->nrows - 1; row++) + for (row = 0; row + 1 < table->nrows; row++) requisition->height += table->rows[row].spacing; requisition->width += GTK_CONTAINER (table)->border_width * 2; @@ -1244,7 +1244,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) { width = real_width; - for (col = 0; col < table->ncols - 1; col++) + for (col = 0; col + 1 < table->ncols; col++) width -= table->cols[col].spacing; for (col = 0; col < table->ncols; col++) @@ -1269,7 +1269,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) if (table->cols[col].shrink) nshrink += 1; } - for (col = 0; col < table->ncols - 1; col++) + for (col = 0; col + 1 < table->ncols; col++) width += table->cols[col].spacing; /* Check to see if we were allocated more width than we requested. @@ -1321,7 +1321,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) { height = real_height; - for (row = 0; row < table->nrows - 1; row++) + for (row = 0; row + 1 < table->nrows; row++) height -= table->rows[row].spacing; @@ -1347,7 +1347,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table) if (table->rows[row].shrink) nshrink += 1; } - for (row = 0; row < table->nrows - 1; row++) + for (row = 0; row + 1 < table->nrows; row++) height += table->rows[row].spacing; /* Check to see if we were allocated more height than we requested. diff --git a/gtk/gtkvbox.c b/gtk/gtkvbox.c index 4e9cc7921d..b819700af4 100644 --- a/gtk/gtkvbox.c +++ b/gtk/gtkvbox.c @@ -27,10 +27,10 @@ static void gtk_vbox_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -guint +GtkType gtk_vbox_get_type (void) { - static guint vbox_type = 0; + static GtkType vbox_type = 0; if (!vbox_type) { @@ -45,7 +45,7 @@ gtk_vbox_get_type (void) (GtkArgGetFunc) NULL, }; - vbox_type = gtk_type_unique (gtk_box_get_type (), &vbox_info); + vbox_type = gtk_type_unique (GTK_TYPE_BOX, &vbox_info); } return vbox_type; diff --git a/gtk/gtkvbox.h b/gtk/gtkvbox.h index dc9213639b..bf72719594 100644 --- a/gtk/gtkvbox.h +++ b/gtk/gtkvbox.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -26,15 +26,18 @@ #ifdef __cplusplus extern "C" { +#pragma } #endif /* __cplusplus */ -#define GTK_VBOX(obj) GTK_CHECK_CAST (obj, gtk_vbox_get_type (), GtkVBox) -#define GTK_VBOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_vbox_get_type (), GtkVBoxClass) -#define GTK_IS_VBOX(obj) GTK_CHECK_TYPE (obj, gtk_vbox_get_type ()) +#define GTK_TYPE_VBOX (gtk_vbox_get_type ()) +#define GTK_VBOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_VBOX, GtkVBox)) +#define GTK_VBOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_VBOX, GtkVBoxClass)) +#define GTK_IS_VBOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_VBOX)) +#define GTK_IS_VBOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VBOX)) -typedef struct _GtkVBox GtkVBox; +typedef struct _GtkVBox GtkVBox; typedef struct _GtkVBoxClass GtkVBoxClass; struct _GtkVBox @@ -48,8 +51,8 @@ struct _GtkVBoxClass }; -guint gtk_vbox_get_type (void); -GtkWidget* gtk_vbox_new (gint homogeneous, +GtkType gtk_vbox_get_type (void); +GtkWidget* gtk_vbox_new (gint homogeneous, gint spacing); diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 0737c20677..d428ce96ee 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -2532,6 +2532,7 @@ gtk_widget_set_parent (GtkWidget *widget, g_return_if_fail (widget->parent == NULL); g_return_if_fail (!GTK_WIDGET_TOPLEVEL (widget)); g_return_if_fail (parent != NULL); + g_return_if_fail (widget != parent); /* keep this function in sync with gtk_menu_attach_to_widget() */ @@ -2549,9 +2550,6 @@ gtk_widget_set_parent (GtkWidget *widget, gtk_widget_propagate_state (widget, &data); - while (parent->parent != NULL) - parent = parent->parent; - gtk_widget_set_style_recurse (widget, NULL); gtk_signal_emit (GTK_OBJECT (widget), widget_signals[PARENT_SET], NULL); |