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.Notebooksample:
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()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)