看板 Python 關於我們 聯絡資訊
各位版上的大大下午好 我需要在一個Frame裡面建立多個Option menu. 目前在網路上找到的教學都是一個的。 Sample code如下 from Tkinter import * master = Tk() variable = StringVar(master) variable.set("one") # default value w = OptionMenu(master, variable, "one", "two", "three") w.pack() mainloop() 我的問題在於variable=StringVar(master)這裡 如果我有兩個的時候這一行要怎麼改寫? Var2=StringVar(master)嗎? 感覺怪怪的。 懇請高手指導,感謝。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.33.116.8 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1594712368.A.3BE.html
alvinlin: 照抄就好了 07/14 19:54
alvinlin: https://i.imgur.com/o7fGXnJ.jpg 07/14 19:54
yimean: 感恩指導,想不到竟然是這樣。 07/15 20:39