0

Env - python2.7, gstreamer 1.0 on windows7

I was trying to run codes from http://bazaar.launchpad.net/~jderose/+junk/gst-examples/view/head:/video-player-1.0 on my env, and it's failing with AttributeError: 'gtk.gdk.Win32Window' object has no attribute 'get_xid'

I found minimum code to test get_xid and pasting it here:-

import gi
gi.require_version("GdkX11", "3.0")
gi.require_version('Gtk', '3.0')
from gi.repository import GdkX11, Gtk, GstVideo

class App:
    def __init__(self):
        win = Gtk.Window()
        win.resize(400, 400)
        win.connect('delete-event', Gtk.main_quit)

        da = Gtk.DrawingArea()
        win.add(da)
        win.show_all()
        import pdb;pdb.set_trace()
        print da.get_property('window').get_xid()

if __name__ == "__main__":
    App()
    Gtk.main()

AttributeError: 'gtk.gdk.Win32Window' object has no attribute 'get_xid'

Ideally if i have imported GdkX11 then window object should have get_xid, But its not working on windows7 environment, looks like GdkX11 is not for windows user. Please suggest me how should I solve this issue.

AlokThakur
  • 3,599
  • 1
  • 19
  • 32

1 Answers1

0

On Windows machines, get_xid() will cause the issue you are seeing.

A workaround is provided in the following answer: Get the window handle in PyGI

Community
  • 1
  • 1
Kevin
  • 1