Below is the code I am trying to run. I want to open a browser and still be able to use the entry box. I am using threading and the browser opens up or loads correctly. However the entry box becomes inactive. How can be able to use the entry box while the browser is opening. Would really appreciate any help.
'''
import tkinter as tk
from tkinter import messagebox
from cefpython3 import cefpython as cef
import threading
import sys
def test_thread(frame,link):
sys.excepthook = cef.ExceptHook
window_info = cef.WindowInfo(frame.winfo_id())
window_info.SetAsChild(frame.winfo_id(), rect)
cef.Initialize()
browser = cef.CreateBrowserSync(window_info, url=link)
root.after(1,activate_after_thread)
cef.MessageLoop()
def on_closing():
print('closing')
help(cef)
root.destroy()
def activate_after_thread():
entry.config(bg="blue")
pass
root = tk.Tk()
root.geometry('800x600')
root.protocol('WM_DELETE_WINDOW', on_closing)
frame = tk.Frame(root, bg='blue', height=200)
frame2 = tk.Frame(root, bg='white', height=200)
frame.pack(side='top', fill='x')
frame2.pack(side='top', fill='x')
tk.Button(frame2, text='Exit', command=on_closing).pack(side='left')
tk.Button(frame2, text='Show something',
command=lambda: messagebox.showinfo('TITLE', 'Shown something')).pack(side='right')
#
var = tk.StringVar()
entry = tk.Entry(frame2, width=70, textvariable=var)
entry.pack()
rect = [0, 0, 800, 200]
print('browser: ', rect[2], 'x', rect[3])
link = "https://www.google.com/"
thread = threading.Thread(target=test_thread, args=(frame,link,))
thread.start()
root.mainloop()
'''