Adam Pierce
Adam Pierce

Reputation: 34375

Find the Window ID of a GTK widget on Mac OS-X

I'm trying to port a GTK-based Linux app to Mac OS-X. I have the GUI working OK but now I need to create a Widget which embeds MPlayer.

I should be able to use the -wid option of MPlayer to embed it in my app but I need to find the Window ID. Does anyone know how to find the window ID of a GTK Widget or Container on OS-X ?

Upvotes: 0

Views: 1601

Answers (3)

rokfor
rokfor

Reputation: 147

I think it can be done with:

(gulong)gdk_quartz_window_get_nsview(gtk_widget_get_window((GtkWidget *widget)));

Upvotes: 0

user149341
user149341

Reputation:

If you're using the Quartz backend for either GTK or MPlayer, you can't do this. This window embedding technique only works under X11.

(And, if you're using X11, you're hardly writing a native OS X application!)

Upvotes: 1

vasi
vasi

Reputation: 1036

Are you using GTK with the X11 or Quartz backend? If X11, I imagine it should work just as on Linux. Otherwise I don't think you can do what you're trying to do, MPlayer wants a X11 window ID, and you're not using X11 at all.

Upvotes: 2

Related Questions