Get the window handle in PyGI

后端 未结 2 698
面向向阳花
面向向阳花 2021-01-16 12:54

In my program I use PyGObject/PyGI and GStreamer to show a video in my GUI. The video is shown in a Gtk.DrawingArea and therefore I need to get it\'s window-han

2条回答
  •  遥遥无期
    2021-01-16 13:30

    Have you tried:

    def OnSyncMessage(self, bus, msg):
        if msg.get_structure() is None:
            return True
        message_name = msg.get_structure().get_name()
        if message_name == 'prepare-window-handle':
            imagesink = msg.src
            imagesink.set_property('force-aspect-ratio', True)
            imagesink.set_window_handle(self.DrawingArea.GetHandle())
        return True    
    

提交回复
热议问题