diff options
author | Elliot Lee <sopwith@src.gnome.org> | 1998-01-01 03:31:11 +0000 |
---|---|---|
committer | Elliot Lee <sopwith@src.gnome.org> | 1998-01-01 03:31:11 +0000 |
commit | 0516fcead1091e0f48c45d29ff566911a26582dc (patch) | |
tree | d90a08e8ee20fbcf7bebf5331b4b77c3ba908101 /gtk/gtkhandlebox.c | |
parent | f872397c0c6f3fd532ec867fa2fbc1cb89af1a94 (diff) | |
download | gtk+-0516fcead1091e0f48c45d29ff566911a26582dc.tar.gz |
handlebox now lets you set in_root flag (and if you set that, its location as well)
Diffstat (limited to 'gtk/gtkhandlebox.c')
-rw-r--r-- | gtk/gtkhandlebox.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index 50ade03b5b..180c58fa51 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -350,21 +350,23 @@ gtk_handle_box_button_changed(GtkWidget *widget, return TRUE; } -static void -gtk_handle_box_reparent (GtkWidget *widget, - gboolean in_root) +void +gtk_handle_box_set_location (GtkWidget *widget, + gboolean in_root, + gint x, gint y) { GtkHandleBox *hb; hb = GTK_HANDLE_BOX(widget); - if(in_root) + if(in_root != FALSE) { GTK_HANDLE_BOX(widget)->is_onroot = TRUE; + if(x < 0) x = parentx; + if(y < 0) y = parenty; gdk_window_set_override_redirect(widget->window, TRUE); gdk_window_reparent(widget->window, GDK_ROOT_PARENT(), - parentx, - parenty); + x, y); gdk_window_raise(widget->window); widget->requisition = hb->real_requisition; gtk_widget_queue_resize(widget->parent); @@ -409,12 +411,12 @@ gtk_handle_box_motion (GtkWidget *widget, && abs(parenty - newy) < 10) { if(hb->is_onroot == TRUE) - gtk_handle_box_reparent(widget, FALSE); + gtk_handle_box_set_location(widget, FALSE, 0, 0); } else { if(hb->is_onroot == FALSE) - gtk_handle_box_reparent(widget, TRUE); + gtk_handle_box_set_location(widget, TRUE, parentx, parenty); gdk_window_move(widget->window, newx, newy); } } |