How to hide the mouse cursor in GTK#?

View: New views
3 Messages — Rating Filter:   Alert me  

How to hide the mouse cursor in GTK#?

by Jochen Rupp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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#?

Thanx, for your help!! :-)

Bye
AETHIX

Re: How to hide the mouse cursor in GTK#?

by Michael Hutchinson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Oct 5, 2009 at 10:44 AM, aethix <j.rupp@...> 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
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Re: How to hide the mouse cursor in GTK#?

by Jochen Rupp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Michael,

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

Bye
Jochen

2009/10/5 Michael Hutchinson <m.j.hutchinson@...>
On Mon, Oct 5, 2009 at 10:44 AM, aethix <j.rupp@...> 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



_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list