【发布时间】:2021-10-28 02:06:37
【问题描述】:
dates = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31] month = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUNE', 'JULY', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'] year = [2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040] Date = StringVar(plane) Date.set(dates[0]) Month = StringVar(plane) Month.set(month[0]) Year = StringVar(plane) Year.set(year[0]) date_option = OptionMenu(plane, Date, *dates) month_option = OptionMenu(plane, Month, *month) year_option = OptionMenu(plane, Year, *year) date_option.config(font=("Arial", 18, "bold")) month_option.config(font=("Arial", 18, "bold")) year_option.config(font=("Arial", 18, "bold")) date_option.pack(side="left", fill="x", expand="yes") month_option.pack(side="left", fill="x", expand="yes") year_option.pack(side="left", fill="x", expand="yes") submit = Button(plane, text="Submit", font=("Engrave", 15, "bold"), fg="black", bg="silver") submit.pack(side="right", padx=30)
如果我将提交按钮放在年份选项菜单旁边,我无法将提交按钮打包在日期输入下拉框下方。
【问题讨论】:
标签: python python-3.x tkinter