Python Tkinter Notebook widget

Python Tkinter Notebook widget,第1张

Python Tkinter Notebook widget

Label reference:

compound

Controls how to combine text and image in the label. By default, if an image
or bitmap is given, it is drawn instead of the text. If this option is set
to CENTER , the text is drawn on top of the image. If this option is set
to one of BOTTOM , LEFT , RIGHT , or TOP , the image is
drawn besides the text (use BOTTOM to draw the image under the text,
etc.). Default is NONE.

tab1 = note.add_tab(text = "Tab One",image=scheduledimage, compound=TOP)

ttk.Notebook
sample:

from Tkinter import *from ttk import *root = Tk()scheduledimage=PhotoImage(...)note = Notebook(root)tab1 = frame(note)tab2 = frame(note)tab3 = frame(note)Button(tab1, text='Exit', command=root.destroy).pack(padx=100, pady=100)note.add(tab1, text = "Tab One",image=scheduledimage, compound=TOP)note.add(tab2, text = "Tab Two")note.add(tab3, text = "Tab Three")note.pack()root.mainloop()exit()


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5648983.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存