0

i am a noob, please help me :(

how can i change font size of the TTK optionmenu widget and also how can i place it right beside the entry box of the tank number to make it look good

this is how it is currently

enter image description here this is my code

# Creating Frame to Put widgets
frame = tk.Frame(main_window)

# Heading of the Window
ttk.Label(main_window, text="INVOICE GENERATOR", font=("Roboto", 30)).pack(ipady=20)

# Invoice No Label And Invoice No Entry
ttk.Label(frame, text='Invoice Number', font=("Roboto", 19)).grid(row=0, column=0, pady=7, 
sticky=tk.W)
ttk.Entry(frame, textvariable=invoice_no, width=40, font=("Roboto", 19)).grid(row=0, column=1, 
pady=7)

# Name Label And Name Entry 
ttk.Label(frame, text='Name', font=("Roboto", 19)).grid(row=1, column=0, pady=7, sticky=tk.W)
ttk.Entry(frame, textvariable=name, width=40, font=("Roboto", 19)).grid(row=1, column=1, 
pady=7)

# Date Label And Date Entry
ttk.Label(frame, text='Date', font=("Roboto", 19)).grid(row=2, column=0, pady=7, sticky=tk.W)
ttk.Entry(frame, textvariable=date, width=40, font=("Roboto", 19)).grid(row=2, column=1, 
pady=7)

# Vehicle No Label And Vehicle No Entry
ttk.Label(frame, text='Vehicle Number', font=("Roboto", 19)).grid(row=3, column=0, pady=7, 
sticky=tk.W)
ttk.Entry(frame, textvariable=vehicle_no, width=40, font=("Roboto", 19)).grid(row=3, column=1, 
pady=7)
# Price Label And Price Entry
ttk.Label(frame, text='Price', font=("Roboto", 19)).grid(row=4, column=0, pady=7, sticky=tk.W)
ttk.Entry(frame, textvariable=price, width=40, font=("Roboto", 19)).grid(row=4, column=1, 
pady=7)
# Tank Number Label And Tank Number Entry
ttk.Label(frame, text='Tank Number', font=("Roboto", 19)).grid(row=5, column=0, pady=7, 
sticky=tk.W, columnspan=5)
ttk.Entry(frame, textvariable=tank_no, width=30, font=("Roboto", 19)).grid(row=5, column=1, 
pady=7, sticky=tk.W)
tank_capacity_dropdown = ttk.OptionMenu(frame, tank_capacity, *options)
tank_capacity_dropdown['menu'].configure(font=('Roboto', 18))
tank_capacity_dropdown.grid(row=5, column=2, sticky=tk.W, ipadx= 10, ipady=9)
# Reducer Number Label And Reducer Number Entry
ttk.Label(frame, text='Reducer Number', font=("Roboto", 19)).grid(row=6, column=0, pady=7, 
padx=7, sticky=tk.W)
ttk.Entry(frame, textvariable=reducer_no, width=40, font=("Roboto", 19)).grid(row=6, column=1, 
pady=7)
# Button used to update and export the INVOICE.xlsx file
ttk.Button(frame, text="Export Invoice", command=gnrt_file, style="Accentbutton").grid(row=7, 
column=0, columnspan=3,
pady=7)
frame.place(anchor="c", relx=.5, rely=.5)
main_window.mainloop()
codingsenpi
  • 71
  • 1
  • 6

0 Answers0