The following is my code. After I run it, I find that my button and entry are not displayed. I don't know what went wrong.
import tkinter as tk
import ttkbootstrap as ttk
root = tk.Tk()
root.title("test")
root.geometry("1200x740")
target_group = ttk.LabelFrame(root, text="test", bootstyle="info")
target_group.grid(row=0, column=0, padx=10, pady=10)
a_label = ttk.Label(target_group,text="test",bootstyle="inverse-danger",font=("Times New Roman", 15))
a_label.grid(row=0, column=0, padx=20, pady=5)
a = tk.StringVar(target_group, value="test")
a_text = ttk.Entry(target_group, bootstyle="success", width=91, textvariable=a)
a_text.grid(row=0, column=1, padx=5, pady=5)
e_group = ttk.LabelFrame(root, text="test", bootstyle="info")
e_group.grid(row=1, column=0, padx=10, pady=10)
o = ttk.Frame(e_group)
c_frame = ttk.Frame(e_group)
e_notebook = ttk.Notebook(e_group, bootstyle="info")
e_notebook.add(o, text='test1')
e_notebook.add(c_frame, text='test2')
def collect_i():
pass
i_collect_button = tk.Button(o, text="Start Collect", command=collect_i, width=30)
i_collect_button.grid(row=0, column=0, padx=5, pady=5)
i_show = tk.StringVar(o, value="test")
i_show_text = tk.Entry(o, width=61, textvariable=i_show)
i_show_text.grid(row=1, column=0, padx=5, pady=5)
e_notebook.grid(row=0, column=0, padx=10, pady=10)
root.mainloop()
After I tried it, I found that if I replace i_collect_button = tk.Button(o, text="Start Collect~", command=collect_i, width=30)
with i_collect_button = tk.Button(target_group, text="Start Collect~", command=collect_i, width=30)
, it can run successfully.