Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- import tkinter.ttk as ttk
- links_conf = tk.Tk()
- links_conf.title("Links configurer")
- links_conf['bg']='white'
- links_conf.iconbitmap("Link.ico")
- links_conf.minsize(350, 100)
- # links_conf.geometry('300x200')
- frame1 = tk.Frame(master=links_conf, width=200, height=100, bg="white")
- frame1.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
- frame2 = tk.Frame(master=links_conf, width=100, bg="white")
- frame2.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
- frame3 = tk.Frame(master=links_conf, width=50, bg="white")
- frame3.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
- combobox = ttk.Combobox(master=frame1)
- combobox['values'] = ['Hello', 'World']
- combobox['state'] = 'normal'
- def resize_combobox(event):
- frame_width = event.width
- combobox.config(width=int(frame_width/2))
- frame1.bind("<Configure>", resize_combobox)
- combobox.place(relx=0.5, rely=0.5, anchor=tk.CENTER)
- entry = tk.Entry(master=frame2, bg="white", width=50)
- entry.place(relx=0.5, rely=0.5, anchor=tk.CENTER)
- button = tk.Button(text="Click me!", master=frame3)
- button.place(relx=0.5, rely=0.5, anchor=tk.CENTER)
- links_conf.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement