My program draws the fractal using pointSize_max
and pointSize
variables, which are entered by the user in Tkinter. The problem is that the fractal is drawn before pressing a button (as soon as the program is run), and the program does not draw the fractal when the button is pressed.
pointLabel = tk.Label(frame,text="minimaalne pikkus")
pointLabel.pack()
pointSize = tk.StringVar()
pointEntry = tk.Entry(frame,textvariable=pointSize)
pointEntry.pack()
pointSize.set(str(10))
pointLabel_max = tk.Label(frame,text="maksimaalne pikkus")
pointLabel_max.pack()
pointSize_max = tk.StringVar()
pointEntry_max = tk.Entry(frame,textvariable=pointSize_max)
pointEntry_max.pack()
pointSize_max.set(str(30))
drawButton = tk.Button(frame, text = "Draw a fractal", command=koch(int(pointSize_max.get()), int(pointSize.get())))
# koch function draws the fractal
drawButton.pack()
tk.mainloop()