Changeset 945:90f458a3bc2d
- Timestamp:
- 04/30/19 14:49:39 (6 years ago)
- Branch:
- python3
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/cef.py
r944 r945 14 14 import tempfile 15 15 import traceback 16 import ctypes 16 17 import urllib.request, urllib.error, urllib.parse 17 18 from lxml import etree … … 322 323 """Start a browser instance in the given container with the given URL.""" 323 324 if os.name=="nt": 324 window = container.get_window() 325 if window is None: 326 print("mlx.gui.cef.startInContainer: no window found!") 327 windowID = None 328 else: 329 windowID = window.handle 325 gdk.threads_enter() 326 ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p 327 ctypes.pythonapi.PyCapsule_GetPointer.argtypes = \ 328 [ctypes.py_object] 329 gpointer = ctypes.pythonapi.PyCapsule_GetPointer( 330 container.get_property("window").__gpointer__, None) 331 libgdk = ctypes.CDLL("libgdk-3-0.dll") 332 windowID = libgdk.gdk_win32_window_get_handle(gpointer) 333 container.windowID = windowID 334 gdk.threads_leave() 330 335 else: 331 336 container.set_visual(container.get_screen().lookup_visual(0x21)) … … 427 432 428 433 def _handleSizeAllocate(widget, sizeAlloc): 429 """Handle the size-allocate event.""" 430 window = widget.get_window() 434 """Handle the size-allocate event on Windows.""" 431 435 if widget is not None: 432 cefpython.WindowUtils.OnSize(wi ndow.handle, 0, 0, 0)436 cefpython.WindowUtils.OnSize(widget.windowID, 0, 0, 0) -
src/mlx/gui/gui.py
r931 r945 199 199 200 200 window.show_all() 201 if os.name=="nt":202 window.get_window().focus()203 201 204 202 self._wizard.grabDefault() … … 767 765 Here we reset the focus to the main window as CEF might have acquired 768 766 it earlier.""" 769 self._mainWindow.get_window().focus( )767 self._mainWindow.get_window().focus(0) 770 768 771 769 def raiseCallback(self):
Note:
See TracChangeset
for help on using the changeset viewer.