[Gtk-sharp-list] How to hide the mouse cursor in GTK#?

Jochen Rupp j.rupp at xyz.de
Tue Oct 6 13:20:34 EDT 2009


Hi Michael,

thanx very much.
It work's fine!! :-)))

Bye
Jochen

2009/10/5 Michael Hutchinson <m.j.hutchinson at gmail.com>

> On Mon, Oct 5, 2009 at 10:44 AM, aethix <j.rupp at xyz.de> wrote:
> >
> > Hallo,
> >
> > I want to hide the mouse cursor in my GTK# project.
> > With Windows Forms I can do this with
> >    Cursor.Hide();
> >
> > Is there any simular methode or anything else in GTK#?
>
> I believe  the conventional way is to create a 1x1 transparent cursor
> and use that:
>
> using (Pixmap inv = new Pixmap (null, 1, 1, 1)) {
>        invisibleCursor = new Cursor (inv, inv, Gdk.Color.Zero,
> Gdk.Color.Zero, 0, 0);
> }
>
> For an example, see
>
> http://anonsvn.mono-project.com/viewvc/trunk/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs?view=markup
>
> Don't forget to dispose the cursor when you're done.
>
> --
> Michael Hutchinson
> http://mjhutchinson.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20091006/c8335f5a/attachment.html 


More information about the Gtk-sharp-list mailing list