Re: global cursor setting?
- From: Arnaud Charlet <charlet ACT-Europe FR>
- To: "Dugas, Alan" <alan dugas analog com>
- Cc: Havoc Pennington <hp redhat com>, gtk-app-devel-list gnome org, gtk-list gnome org
- Subject: Re: global cursor setting?
- Date: Sat, 13 Jan 2001 18:14:49 +0100
Function gtk_file_selection_populate() is called via a callback connected to
a gtkentry contained within a gtkfileselection. The gtkfileselection window
is being displayed when I trigger this callback. In addition to this, I was
able to step through it's execution with ddd/gdb. Is it possible for
someone to independently verify this odd behavior? Any suggestion would
also be greatly appreciated.
I confirm the behavior. We've also made a similar change locally to Gtk,
since some of our GtkAda users asked for it (in particular when looking
through network directories).
Here is the patch we've ended up with in case someone else is interested.
Would such a patch be integrated into the official Gtk+ ?
We'd perfer to avoid having to maintain a separate version of Gtk+ if
possible.
Arno
--
*** gtk/gtkfilesel.c.old Sat Jan 13 16:32:04 2001
--- gtk/gtkfilesel.c Sat Jan 13 17:31:24 2001
*************** gtk_file_selection_populate (GtkFileSele
*** 1308,1317 ****
gint selection_index = -1;
gint file_list_width;
gint dir_list_width;
g_return_if_fail (fs != NULL);
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
!
cmpl_state = (CompletionState*) fs->cmpl_state;
poss = cmpl_completion_matches (rel_path, &rem_path, cmpl_state);
--- 1308,1329 ----
gint selection_index = -1;
gint file_list_width;
gint dir_list_width;
+ GdkCursor *cursor = NULL;
+ GdkWindow *window;
g_return_if_fail (fs != NULL);
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
!
! window = GTK_WIDGET (fs)->window;
!
! if (window != NULL)
! {
! cursor = gdk_cursor_new (GDK_WATCH);
! gdk_window_set_cursor (window, cursor);
! gdk_cursor_destroy (cursor);
! cursor = gdk_cursor_new (GDK_LEFT_PTR);
! }
!
cmpl_state = (CompletionState*) fs->cmpl_state;
poss = cmpl_completion_matches (rel_path, &rem_path, cmpl_state);
*************** gtk_file_selection_populate (GtkFileSele
*** 1319,1324 ****
--- 1331,1342 ----
{
/* Something went wrong. */
gtk_file_selection_abort (fs);
+
+ if (window != NULL)
+ {
+ gdk_window_set_cursor (window, cursor);
+ gdk_cursor_destroy (cursor);
+ }
return;
}
*************** gtk_file_selection_populate (GtkFileSele
*** 1455,1460 ****
--- 1473,1484 ----
gtk_file_selection_update_history_menu (fs, cmpl_reference_position (cmpl_state));
}
+ }
+
+ if (window != NULL)
+ {
+ gdk_window_set_cursor (window, cursor);
+ gdk_cursor_destroy (cursor);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]