I’m working on a simple video player in Python and PyGTK, using VLC as player backend. I want to show the video image in a gtk.DrawingArea so, in Linux, I use builder.get_object(‘drawingarea1’).window.xid to get the XID of the DrawingArea widget. In Windows, according to documentation, I have to use builder.get_object(‘drawingarea1’).window.handle, but when I start to play a video file, it gets played in the whole window, not just in the gtk.DrawingArea. I started digging to find what’s happening and I found that the number retrieved from builder.get_object(‘mainWindow’).window.handle is the same with builder.get_object(‘drawingarea1’).window.handle. Is this the right method to get the handler of a widget, or I do something wrong?
Share
I’m not sure what exactly you’ve done without an example, however I did a bit of searching and found this question and possible answer here http://python.6.n6.nabble.com/gtk-DrawingArea-handle-id-on-win32-bug-td1943074.html. And an example was attached. The link http://library.gnome.org/devel/gtk/2.18/gtk-migrating-ClientSideWindows.html he provides does not exist any more, but I found a updated link http://developer.gnome.org/gtk/2.24/gtk-migrating-ClientSideWindows.html. Essentially it seems you must call
to make the
attribute return the correct native handle of the drawingarea
On Linux getting the attribute
automatically calls
but
does not do this for you.
I hope this helps.