Skip to content

Commit 38bcf0c

Browse files
committed
Fix maximize/restore events in tkinter_.py example (cztomczak#464)
This is a temporary fix to use ctypes until thw new WindowUtils.UpdateBrowserSize utility func is exposed.
1 parent 3f765a6 commit 38bcf0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/tkinter_.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# and Issue #284).
1616

1717
from cefpython3 import cefpython as cef
18+
import ctypes
1819
try:
1920
import tkinter as tk
2021
except ImportError:
@@ -201,7 +202,9 @@ def on_root_configure(self):
201202
def on_mainframe_configure(self, width, height):
202203
if self.browser:
203204
if WINDOWS:
204-
WindowUtils.OnSize(self.get_window_handle(), 0, 0, 0)
205+
ctypes.windll.user32.SetWindowPos(
206+
self.browser.GetWindowHandle(), 0,
207+
0, 0, width, height, 0x0002)
205208
elif LINUX:
206209
self.browser.SetBounds(0, 0, width, height)
207210
self.browser.NotifyMoveOrResizeStarted()

0 commit comments

Comments
 (0)