diff options
author | Owen Taylor <owt1@cornell.edu> | 1998-01-18 15:09:10 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-01-18 15:09:10 +0000 |
commit | 11d37c506779ac9979725f67ed5bf0fd0c602d71 (patch) | |
tree | 4a10b0a5bc22d47ed4fae673c9d984edaada5fbb /gtk/gtkhandlebox.c | |
parent | 1e34b9ba8db676f841a60f18979c601311e08542 (diff) | |
download | gtk+-11d37c506779ac9979725f67ed5bf0fd0c602d71.tar.gz |
gtkbutton.c gtkclist.c gtkdrawingarea.c gtkentry.c gtkeventbox.c
Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu>
* gtkbutton.c gtkclist.c gtkdrawingarea.c gtkentry.c gtkeventbox.c
gtkfixed.c gtkhandlebox.c gtkhscale.c gtkhscrollbar.c gtkitem.c
gtklist.c gtkmenushell.c gtkmisc.c gtknotebook.c gtkpaned.c
gtkpreview.c gtkprogressbar.c gtkruler.c gtktext.c gtktree.c
gtkviewport.c gtkvscale.c gtkvscrollbar.c gtkwidget.{c,h}
Added gtk_widget_set_parent and gtk_widget_get_parent. All
widgets should use:
gtk_widget_get_parent() instead of widget->parent->window.
Any widget that wants to have children not in the parent window,
should use gtk_widget_set_parent () in their realize() and
add () routines.
CList and Viewport widgets changed to do this. (Viewport
widget using code from gtk-fortier-980117-0.patch.)
Diffstat (limited to 'gtk/gtkhandlebox.c')
-rw-r--r-- | gtk/gtkhandlebox.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index 827203f4eb..344ed432c4 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -231,7 +231,7 @@ gtk_handle_box_realize (GtkWidget *widget) attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - hb->steady_window = gdk_window_new (widget->parent->window, &attributes, attributes_mask); + hb->steady_window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gdk_window_set_user_data (hb->steady_window, widget); attributes.x = 0; @@ -601,10 +601,13 @@ gtk_handle_box_motion (GtkWidget *widget, hb->is_onroot = TRUE; gdk_pointer_ungrab (GDK_CURRENT_TIME); - gtk_widget_show (hb->float_window); + + if (!GTK_WIDGET_REALIZED (hb->float_window)) + gtk_widget_realize (hb->float_window); + gtk_widget_set_uposition (hb->float_window, newx, newy); - gdk_window_reparent (widget->window, hb->float_window->window, 0, 0); + gtk_widget_show (hb->float_window); while (gdk_pointer_grab (widget->window, FALSE, @@ -628,10 +631,10 @@ gtk_handle_box_delete_float (GtkWidget *widget, { GtkHandleBox *hb; - g_return_if_fail (widget != NULL); - g_return_if_fail (event != NULL); - g_return_if_fail (data != NULL); - g_return_if_fail (GTK_IS_HANDLE_BOX (data)); + g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (event != NULL, FALSE); + g_return_val_if_fail (data != NULL, FALSE); + g_return_val_if_fail (GTK_IS_HANDLE_BOX (data), FALSE); hb = GTK_HANDLE_BOX (data); |