konstantin_doncov
konstantin_doncov

Reputation: 2879

How to get a window handle of GTK# widget or container?

I use libvlc_media_player_set_hwnd() function in GTK# (Xamarin). But I can't get a HWND of GTK# widget and set it in libvlc_media_player_set_hwnd() function. In GTK+ I can use gdk_x11_drawable_get_xid(), but I haven't found this function in GTK#.

So how I can get a HWND of widgets or use this function for output media in the needed window/container/widget?

Upvotes: 0

Views: 1471

Answers (1)

Josh
Josh

Reputation: 63

You could always import gdk_x11_drawable_get_xid() manually from the library:

[SuppressUnmanagedCodeSecurity, DllImport(GDK_X11_LIB)]
public static extern IntPtr gdk_x11_drawable_get_xid(IntPtr gdkDisplay);

Where GDK_X11_LIB is a string containing the your gdk-x11 library. For GTK 2.0 GDK_X11_LIB would be "libgdk-x11-2.0.so" on GNU/Linux.

Upvotes: 1

Related Questions