I'm still new to tkinter
, and noticed that when I tried to increase the size of a button using
button.config(height=20, width=50)
It didn't work at all. It was just a huge area of white space in the violet background, and then the button in the middle of the white space. If I clicked anywhere within the white space though, it worked and did its command.
Here's the code:
from tkinter import *
root = Tk()
def cheese():
print ('hi')
logo = PhotoImage('../Desktop/logothing.gif')
explanation = """Flaming Arrows whizz over your hair, War rages around you. Suddenly,
it charges into you. A 8 foot tall mechanical beast the enemy have been training for war.
You have no chance but to fight it. You swing your sword as hard as you can...Only to
leave a minor dent on it's armor. With one blow from its club, you fall unconscious."""
w2 = Label(root, justify=LEFT, text=explanation, image = logo,
compound = CENTER, fg="blue", bg= "Violet",
font="ComicSansMS 32 bold",padx=1000, pady=1000).pack(side='left')
w1 = Button(root, text = 'Hello',command = cheese, padx=10)
w1.config(height=20, width = 50)
w1.place(x=500, y=500)