diff options
author | Federico Mena Quintero <federico@nuclecu.unam.mx> | 1998-06-09 21:01:45 +0000 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1998-06-09 21:01:45 +0000 |
commit | a1fe6d0337f1f234a6ac3ece433be960d17a9578 (patch) | |
tree | a9f623e0bf6584399f99335fad8182ce97baef83 /gtk/gtkhandlebox.c | |
parent | aff37e7bea575f4b874053384bce9451f20d0e92 (diff) | |
download | gtk+-a1fe6d0337f1f234a6ac3ece433be960d17a9578.tar.gz |
Removed the fleur_cursor field. Now the cursor is created/destroyed on
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
fleur_cursor field. Now the cursor is created/destroyed on demand
by the routines that need it.
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed):
(gtk_handle_box_motion): The fleur cursor is created and destroyed
only when needed.
Diffstat (limited to 'gtk/gtkhandlebox.c')
-rw-r--r-- | gtk/gtkhandlebox.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index a59f643ea1..dc45477ce2 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -183,7 +183,6 @@ gtk_handle_box_init (GtkHandleBox *handle_box) handle_box->child_detached = FALSE; handle_box->in_drag = FALSE; handle_box->shrink_on_detach = TRUE; - handle_box->fleur_cursor = gdk_cursor_new (GDK_FLEUR); handle_box->dragoff_x = 0; handle_box->dragoff_y = 0; } @@ -321,7 +320,6 @@ gtk_handle_box_realize (GtkWidget *widget) gdk_window_set_user_data (hb->float_window, widget); gdk_window_set_decorations (hb->float_window, 0); - widget->style = gtk_style_attach (widget->style, widget->window); gtk_style_set_background (widget->style, widget->window, GTK_WIDGET_STATE (hb)); gtk_style_set_background (widget->style, hb->bin_window, GTK_WIDGET_STATE (hb)); @@ -345,9 +343,6 @@ gtk_handle_box_unrealize (GtkWidget *widget) gdk_window_destroy (hb->float_window); hb->float_window = NULL; - gdk_cursor_destroy (hb->fleur_cursor); - hb->fleur_cursor = NULL; - if (GTK_WIDGET_CLASS (parent_class)->unrealize) (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget); } @@ -801,6 +796,7 @@ gtk_handle_box_button_changed (GtkWidget *widget, { GtkHandleBox *hb; gboolean event_handled; + GdkCursor *fleur; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_HANDLE_BOX (widget), FALSE); @@ -849,14 +845,16 @@ gtk_handle_box_button_changed (GtkWidget *widget, gtk_grab_add (widget); hb->in_drag = TRUE; + fleur = gdk_cursor_new (GDK_FLEUR); while (gdk_pointer_grab (hb->bin_window, FALSE, (GDK_BUTTON1_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK), NULL, - hb->fleur_cursor, + fleur, GDK_CURRENT_TIME) != 0); /* wait for success */ + gdk_cursor_destroy (fleur); event_handled = TRUE; } } @@ -881,6 +879,7 @@ gtk_handle_box_motion (GtkWidget *widget, gint ox, oy; gint snap_x, snap_y; gboolean in_handle; + GdkCursor *fleur; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_HANDLE_BOX (widget), FALSE); @@ -941,14 +940,16 @@ gtk_handle_box_motion (GtkWidget *widget, handle_box_signals[SIGNAL_CHILD_ATTACHED], GTK_BIN (hb)->child); + fleur = gdk_cursor_new (GDK_FLEUR); while (gdk_pointer_grab (hb->bin_window, FALSE, (GDK_BUTTON1_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK), NULL, - hb->fleur_cursor, + fleur, GDK_CURRENT_TIME) != 0); /* wait for success */ + gdk_cursor_destroy (fleur); gtk_widget_queue_resize (widget); } @@ -989,14 +990,16 @@ gtk_handle_box_motion (GtkWidget *widget, GTK_BIN (hb)->child); gtk_handle_box_draw_ghost (hb); + fleur = gdk_cursor_new (GDK_FLEUR); while (gdk_pointer_grab (hb->bin_window, FALSE, (GDK_BUTTON1_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK), NULL, - hb->fleur_cursor, + fleur, GDK_CURRENT_TIME) != 0); /* wait for success */ + gdk_cursor_destroy (fleur); gtk_widget_queue_resize (widget); } |