0

Hello,

I have added a image file to my code in tkinter but it basically fills my the whole frame so if its possible can you recommend a tutorial that shows or explains how to do this.... unless you can show me on here.

I havent added my full code but the code below should display a test image once you have it saved in the python directory.

I would like to create 'next' button which would open up a new frame with another image on it.

Regards

James

from Tkinter import *

root = Tk()
ButtonImage = PhotoImage(file='test.gif')
testButton = Button(root, image=ButtonImage)
testButton.pack()
root.mainloop()

Edited by Plonkaa

3
Contributors
2
Replies
34
Views
4 Years
Discussion Span
Last Post by vegaseat
0

Have you considered using the height and width options.

Eg.

example = Tkinter.Button(text = "example", height = 20, width = 60)

Along those lines.
The numbers are how many pixels high and wide.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.