Skip to content
← Back to Community
Text box and Button problem
Profile icon

I created a post on this but The problem is still there. I want to know two things:
1.How to get my text box lower
2.How to make a button change it's image and function
Thanks in advance,

Answered by 19wintersp [earned 5 cycles]
View Answer
Profile icon
Profile icon
Profile icon

To move your text box lower on the screen, change the parameters to the grid call on line 194 to have a higher number for row. The grid lays the widgets out in a grid, and you can place things in different places by modifying these numbers. row goes down as it increases, column goes right as it increases.

To change the properties of a widget (in this case, your buttons), you store it in a variable. Here's an example: (I've cropped out tkinter setup)

def update_button(): my_button.config(text="You clicked me!") #change button my_button = Button(root, text="Click me!", command=update_button) #store in variable my_button.pack()

You can call the config method on a widget and re-set any properties you'd like, such as command, background image, text, etc.

Profile icon


, you are a life saver :-)
I'll try to apply the code soon