I’m familiar with python Tkinter and I’m also learning Julia Tk. Today I was experimenting with creating buttons but I couldn’t figure out how to execute a function when the button is pressed.
Example of my code:
function t_f()
(Tab) println(“It works!”)
end
function menuscreen(window)
(Tab) newfile = Button(window,
text=“New File”,
command=t_f)
end
window = Toplevel()
menuscreen(window)
When I try to run this it says that the ‘t_f’ function doesn’t exist, but the ‘t_f()’ does. And adding two parentheses to the end ‘()’ returns a different error.
In summary: how do I call a function using a button?
I’ve gotta add that I absolutely love the language, so far it has to be my favorite out of all the languages I know (Python, C++, and some bits of a few more)