Re: Q: How to hide mouse cursor when it's within a GtkText?



On Wed, 2002-08-28 22:23:25 +0200, Jan-Benedict Glaw <jbglaw lug-owl de>
wrote in message <20020828202324 GK27967 lug-owl de>:
> On Wed, 2002-08-28 20:44:11 +0200, Jan-Benedict Glaw <jbglaw lug-owl de>
> wrote in message <20020828184411 GI27967 lug-owl de>:
> > I've written a small program (kind of a graphical frontend to a text
> > based program which basically is a GtkWindow containing a GtkLayout
> > containing some GtkText.
> > 
> > I've read the archive(s) of several lists and used the advise to create
> > an invisible  one-pixel image cursor, which I applied to the GtkWindow.
> 
> > Oh, I'm compiling/linking against libgtk+-1.2.10...
> 
> I've just copied the program to an older box with gtk-1.2.7 installed.
> There, it works as expected (read: mouse cursor is invisible everywhere,
> not only on the window's background).

I've diff'ed out the changes between 1.2.7 and 1.2.10 and it seems this
part is causing my trouble:


--- gtk+1.2-1.2.7/gtk/gtktext.c Wed Feb 16 12:18:08 2000
+++ gtk+1.2-1.2.10/gtk/gtktext.c        Thu Mar 15 21:15:12 2001
@@ -1309,9 +1309,14 @@
   attributes.y = (widget->style->klass->ythickness + TEXT_BORDER_ROOM);
   attributes.width = MAX (1, (gint)widget->allocation.width - (gint)attributes.x * 2);
   attributes.height = MAX (1, (gint)widget->allocation.height - (gint)attributes.y * 2);
+
+  attributes.cursor = gdk_cursor_new (GDK_XTERM);
+  attributes_mask |= GDK_WA_CURSOR;
   
   text->text_area = gdk_window_new (widget->window, &attributes, attributes_mask);
   gdk_window_set_user_data (text->text_area, text);
+
+  gdk_cursor_destroy (attributes.cursor); /* The X server will keep it around as long as necessary */
   
   widget->style = gtk_style_attach (widget->style, widget->window);
   


But - how can I (inside me app) change the attributed ot the GtkText's
GdkWindow to

	attributes_mask &= ~GDK_WA_CURSOR;

Please help me on that, I don't see the way...

MfG, JBG

-- 
Jan-Benedict Glaw   .   jbglaw lug-owl de   .   +49-172-7608481
	 -- New APT-Proxy written in shell script --
	   http://lug-owl.de/~jbglaw/software/ap2/

Attachment: pgp05KjgBiVKE.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]