| 69 | return super(Gtk3Example, self).run(argv) |
| 70 | |
| 71 | def get_handle(self): |
| 72 | if WINDOWS: |
| 73 | Gdk.threads_enter() |
| 74 | ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p |
| 75 | ctypes.pythonapi.PyCapsule_GetPointer.argtypes = \ |
| 76 | [ctypes.py_object] |
| 77 | gpointer = ctypes.pythonapi.PyCapsule_GetPointer( |
| 78 | self.window.get_property("window").__gpointer__, None) |
| 79 | libgdk = ctypes.CDLL("libgdk-3-0.dll") |
| 80 | self.win32_handle = libgdk.gdk_win32_window_get_handle(gpointer) |
| 81 | Gdk.threads_leave() |
| 82 | return self.win32_handle |
| 83 | elif LINUX: |
| 84 | return self.window.get_property("window").get_xid() |
| 85 | elif MAC: |
| 86 | # TODO: Must call libgdk.gdk_quartz_window_get_nsview(gpointer) |
| 87 | # similarly as on Windows. |
| 88 | print("[gtk3.py] WARNING: get_handle not implemented on Mac") |
| 89 | return 0 |
| 90 | |
| 91 | def on_timer(self): |
| 92 | cef.MessageLoopWork() |