Python Add Image
Hi, I would like some help to add an image to my button, this is my toolbar code: Python code:
Code:
self.toolbar = Frame(self.window) |
Look at http://www.nmt.edu/tcc/help/lang/python/tkinter.pdf - A tkinter reference (I assume that's what you're using).
I think you have to add a bitmap option in the creation of the button. Where the value of bitmap= is a bitmap, perhaps created by Canvas?? Look it up! |
Thanks for your reply, I added with
self.toolbar = Frame(self.window) image=PhotoImage(file='/home/neo/Images/new.gif') self.new = Button(self.toolbar,image=image,width=40, command=self.new, relief=RIDGE) self.new.pack(side=LEFT, padx=2, pady=2) self.toolbar.pack(side=TOP, fill=X) self.window.mainloop() |
All times are GMT -5. The time now is 04:17 PM. |