我到处都看了看,尝试了所有内容,但仍然无法正常工作。我有一组标签和一组条目。我不能将它们全部放在一栏中,因为所有内容都无法放入屏幕,因此我想添加一个滚动条(它是笔记本的一部分)。这是我的代码:
nbm = ttk.Notebook(main)
nbm.grid(row=3, column=0, columnspan=1, rowspan=100, sticky="Nesw", padx=0,
pady=0)
page0 = ttk.Frame(nbm) # page 1 Set-Up ------------------------------------
nbm.add(page0, text="Set-Up")
s0 = Label(page0, width=15, text='Chassis', bg='grey28', fg="SpringGreen2", padx=0, pady=1, font="Times 8").grid(
row=1, column=1)
s00 = Label(page0, width=8, text='', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=1, column=3)
s1 = Label(page0, width=15, text='Upper Bocola', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=2, column=1)
s2 = Label(page0, width=15, text='Lower Bocola', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=3, column=1)
s3 = Label(page0, width=15, text='Upper Bracket Height', bg='grey28', fg="white", padx=0, pady=1,
font="Times 8").grid(row=4, column=1)
s4 = Label(page0, width=15, text='Seat Height', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=5,
column=1)
s5 = Label(page0, width=15, text='Wheelbase', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=6,
column=1)
s6 = Label(page0, width=15, text='Swing Arm Length', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=7, column=1)
s7 = Label(page0, width=15, text='Front Wheel Diam', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=8, column=1)
s8 = Label(page0, width=15, text='Rear Wheel Diamr', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=9, column=1)
s9 = Label(page0, width=15, text='Spring Center', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=10, column=1)
s10 = Label(page0, width=15, text='RCU Stroke', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=11, column=1)
s11 = Label(page0, width=15, text='Front Wheel stroke', bg='grey28', fg="white", padx=0, pady=1,
font="Times 8").grid(row=12, column=1)
s12 = Label(page0, width=15, text='Rear Wheel stroke', bg='grey28', fg="white", padx=0, pady=1,
font="Times 8").grid(row=13, column=1)
s13 = Label(page0, width=15, text='Steering', bg='grey28', fg="SpringGreen2", padx=0, pady=1, font="Times 8").grid(
row=14, column=1)
s14 = Label(page0, width=15, text='Offset', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=15,
column=1)
s15 = Label(page0, width=15, text='Rake(Castor Angle)', bg='grey28', fg="white", padx=0, pady=1,
font="Times 8").grid(row=16, column=1)
s16 = Label(page0, width=15, text='Radius', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=17,
column=1)
s17 = Label(page0, width=15, text='Trail', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=18,
column=1)
s18 = Label(page0, width=15, text='Front suspension', bg='grey28', fg="SpringGreen2", padx=0, pady=1,
font="Times 8").grid(row=19, column=1)
s19 = Label(page0, width=15, text='Assy Number', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=20, column=1)
s20 = Label(page0, width=15, text='Valving', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=21,
column=1)
s21 = Label(page0, width=15, text='Rebound Spring', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=22, column=1)
s22 = Label(page0, width=15, text='Fork top Height', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=23, column=1)
s23 = Label(page0, width=15, text='Spring', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=24,
column=1)
s24 = Label(page0, width=15, text='Preload', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=25,
column=1)
s25 = Label(page0, width=15, text='Extension', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=26,
column=1)
s26 = Label(page0, width=15, text='Compression', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=27, column=1)
s27 = Label(page0, width=15, text='Oil Level', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=28,
column=1)
s27b = Label(page0, width=15, text='Rear Suspension', bg='grey28', fg="SpringGreen2", padx=0, pady=1,
font="Times 8").grid(row=29, column=1)
s28 = Label(page0, width=15, text='Assy Number', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=30, column=1)
s29 = Label(page0, width=15, text='Valving', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=31,
column=1)
s30 = Label(page0, width=15, text='Rebound Spring', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=32, column=1)
s31 = Label(page0, width=15, text='Shock Length', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=33, column=1)
s32 = Label(page0, width=15, text='Spring', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=34,
column=1)
s33 = Label(page0, width=15, text='Total Preload', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=35, column=1)
s34 = Label(page0, width=15, text='Rebound', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=36,
column=1)
s35 = Label(page0, width=15, text='Compression', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=37, column=1)
s36 = Label(page0, width=15, text='Pivot', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(row=38,
column=1)
s37 = Label(page0, width=15, text='Gearing', bg='grey28', fg="SpringGreen2", padx=0, pady=1, font="Times 8").grid(
row=39, column=1)
s38 = Label(page0, width=15, text='Front Sprocket', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=40, column=1)
s39 = Label(page0, width=15, text='Rear Sprocket', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=41, column=1)
s40 = Label(page0, width=15, text='Chain Links', bg='grey28', fg="white", padx=0, pady=1, font="Times 8").grid(
row=42, column=1)
se1 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se1.insert(END, 'se1')
se2 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se2.insert(END, '2')
se3 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se3.insert(END, '3')
se4 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se4.insert(END, '4')
se5 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se5.insert(END, '5')
se6 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se6.insert(END, '6')
se7 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se7.insert(END, '7')
se8 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se8.insert(END, '8')
se9 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se9.insert(END, '9')
se10 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se10.insert(END, '10')
se11 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se11.insert(END, '11')
se12 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se12.insert(END, '12')
se13 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se13.insert(END, '13')
se14 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se14.insert(END, '14')
se15 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se15.insert(END, '15')
se16 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se16.insert(END, '16')
se17 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se17.insert(END, '17')
se18 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se18.insert(END, '18')
se19 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se19.insert(END, '19')
se20 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se20.insert(END, '20')
se21 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se21.insert(END, '21')
se22 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se22.insert(END, '22')
se23 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se23.insert(END, '23')
se24 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se24.insert(END, '24')
se25 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se25.insert(END, '25')
se26 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se26.insert(END, '26')
se27 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se27.insert(END, '27')
se28 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se28.insert(END, '28')
se29 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se29.insert(END, '29')
se30 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se30.insert(END, '30')
se31 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se31.insert(END, '31')
se32 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se32.insert(END, '32')
se33 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se33.insert(END, '33')
se34 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se34.insert(END, '34')
se35 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se35.insert(END, '35')
se36 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se36.insert(END, '36')
se37 = Entry(page0, width=8, bg="grey28", bd=0, font="Times 8 bold italic", fg="white", justify="center")
se37.insert(END, '37')
se1.grid(row=2, column=3)
se2.grid(row=3, column=3)
se3.grid(row=4, column=3)
se4.grid(row=5, column=3)
se5.grid(row=6, column=3)
se6.grid(row=7, column=3)
se7.grid(row=8, column=3)
se8.grid(row=9, column=3)
se9.grid(row=10, column=3)
se10.grid(row=11, column=3)
se11.grid(row=12, column=3)
se12.grid(row=13, column=3)
se13.grid(row=15, column=3)
se14.grid(row=16, column=3)
se15.grid(row=17, column=3)
se16.grid(row=18, column=3)
se17.grid(row=20, column=3)
se18.grid(row=21, column=3)
se19.grid(row=22, column=3)
se20.grid(row=23, column=3)
se21.grid(row=24, column=3)
se22.grid(row=25, column=3)
se23.grid(row=26, column=3)
se24.grid(row=27, column=3)
se25.grid(row=28, column=3)
se26.grid(row=30, column=3)
se27.grid(row=31, column=3)
se28.grid(row=32, column=3)
se29.grid(row=33, column=3)
se30.grid(row=34, column=3)
se31.grid(row=35, column=3)
se32.grid(row=36, column=3)
se33.grid(row=37, column=3)
se34.grid(row=38, column=3)
se35.grid(row=40, column=3)
se36.grid(row=41, column=3)
se37.grid(row=42, column=3)
谁能告诉我如何添加一个滚动条来容纳所有这些标签和条目???非常感谢你!