Tkinter app freezes with multiple-window implementation

22 views
Skip to first unread message

Mohamed Ashraf

unread,
Aug 5, 2021, 7:42:39 PM8/5/21
to CEF Python
I am trying to make multiple window application using tkinter with implementation of CEF browser inside each window, so each window has its own browser. when I try to run function that takes sometime it freezes the whole tkinter app, like using time.sleep(), I have used something like root.after(ms) but this also freezes the app. but I when put the function inside thread it works fine, but it is not good idea to put each function inside thread. How can I make both tkinter with CEF browser on separate thread for each window created?

Czarek Tomczak.

unread,
Aug 6, 2021, 5:20:29 AM8/6/21
to CEF Python
You shouldn't block main thread in a GUI app. You can try CEF multi threaded message loop and see if that helps you.

Mohamed Ashraf

unread,
Aug 6, 2021, 10:09:45 AM8/6/21
to CEF Python
I tried it but the browser doesn't show up, also there is code line browser_frame.browser.ExecuteJavascript(js_code) that was working fine before adding "multi_threaded_message_loop":True but now it gives error: AttributeError: 'NoneType' object has no attribute 'ExecuteJavascript'
Reply all
Reply to author
Forward
0 new messages