การใช้งาน Python GUI (Tkinter) : Scrollbar Widget (วิดเจ็ตสเปรดชีต)

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: การใช้งาน Python GUI (Tkinter) : Scrollbar Widget (วิดเจ็ตสเปรดชีต)

การใช้งาน Python GUI (Tkinter) : Scrollbar Widget (วิดเจ็ตสเปรดชีต)

โดย Jom07 » 05/03/2018 6:16 pm

การใช้งาน Python GUI (Tkinter) : Scrollbar Widget (วิดเจ็ตสเปรดชีต) เป็นการกำหนดค่า แล้วค่าที่ได้จะออกอัตโนมัติ เช่น
ตัวอย่าง

โค้ด: เลือกทั้งหมด

from Tkinter import *

root =Tk()
root.title("Scrollbar")
scroll = Scrollbar(root)
scroll.pack(side = RIGHT,fill=Y)

list1 = Listbox(root,yscrollcommand=scroll.set)
for line in range(10):
    list1.insert(END, "number" + str(line))

list1.pack(side=LEFT,fill=BOTH)
scroll.config(command=list1.yview)

mainloop()
ผลรัน
รูปภาพ

ข้างบน