views:

182

answers:

2

I'm looking to create an invisible window for the processing of certain X events (sort of like NativeWindow in Winforms). Is this possible in GTK#? Or do I need to manually create such a window using P/Invoke to the X libraries?

+1  A: 

I'm not quite sure I understand what you're trying to do, but Windows in Gtk are invisible by default. If you never set the visibility to true:

window.Visible = true;

or if you explicitly set it to false:

window.Visible = false;

it will remain invisible.

Edit: This is the real solution to Zach's problem:

I just checked the GTK source code, and you can call Realize() on a GTK Window to make the GTK window create its corresponding GDK Window. The GDK Window is immediately hooked into the X server when it is created.

Matthew
Thanks for your answer! Is there anything I need to do to make sure the `Window` is connected to the X server, while still having the `Window` invisible?
Zach Johnson
I'm not sure, I don't really know anything about X itself. You might find a better answer on the gtk-sharp-list mailing list (http://lists.ximian.com/mailman/listinfo/gtk-sharp-list).
Matthew
I just checked the GTK source code, and you can call `Realize()` on a GTK Window to make the GTK window create its corresponding GDK Window. The GDK Window is immediately hooked into the X server when it is created.
Zach Johnson
A: 

There is also Gtk.Invisible class which is used for capturing events.

el.pescado