-1

I have a problem with my Python code with tkitner. I created a window that has a resolution of 600 x 400, but when I start the project the window remains with the standard resolution (the one that widens only if you add objects). This is my code:

import tkinter as tk 
import random

schermata = tk.Tk()
schermata.geometry = ('600x400')

schermata.title('8 Ball Game!')
input_testo = tk.StringVar()
entrata = tk.Entry(schermata, textvariable = input_testo, width = 30, borderwidth = 5)
entrata.grid(row = 0, column = 10 )

parole = ['Secondo me si', 'Credo di si', 'Per niente', 'Non dire cavolate', 'Stai scherzando vero?', 'Ma che razza di domande sono', '...', 'Certo', 'Stai zitto']


def risposte():
    global parole 

    input_testo.set(random.choice(parole))

bottone = tk.Button(text = 'Gioca!', command=lambda:risposte())
bottone.grid(row = 2, column = 5)

if __name__ == '__main__':
    schermata.mainloop()

Things I tried to fix: I wrote ('600 x 400'), (600, 400) and (600x400). I also tried to rewrite all the code by hand and saw that this happened after writing the entry. Can anyone help me?

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
  • 3
    [`geometry` is a method](https://www.geeksforgeeks.org/python-geometry-method-in-tkinter/). It should be: `schermata.geometry('600x400')` – Tomerikoo May 19 '20 at 10:12
  • 1
    Does this answer your question? [How to set a tkinter window to a constant size](https://stackoverflow.com/questions/36575890/how-to-set-a-tkinter-window-to-a-constant-size) – Tomerikoo May 19 '20 at 10:15

1 Answers1

0

I have the same "error" with schermata.minsize(600, 400), I think the error is the entry but i don't know where is it.