Push Notification


Joined
Feb 14, 2022
Messages
33
Reaction score
2
i am making my first app i have done graphics now I am doing buttons I have done the graphics for the buttons and it worked but the function is not working so to make a button clickable you need to write "turtle.onclick()" but when I write it ,it says there is a word I have not added "fun" so I write
"turtle.onclick(fun)" and it says fun is not recognized to make it less confusing I will show the code:
import turtle

t = turtle.Turtle()
t.hideturtle()

for i in range(2):
t.forward(80)
t.left(90)
t.forward(30)
t.left(90)

t.penup()
t.goto(7, 6)
t.write("Start/Run", font=("Arial",12,"normal"))
def Button_click():
if Button_x<=x<=Button_x+Buttonlength:
if Button_y<=y<=Button_yButtonWidth:
print("clicked")

t.onclick(button_click)
t.mainloop()

can someone plz help me with this problem
 
Ad

Advertisements

Joined
Nov 13, 2020
Messages
140
Reaction score
23
What language are you coding in?
Nowhere in the code you supplied is "turtle.onclick()" where you say you have a problem.
Nowhere in the code you supplied do you define or use a variable named "fun".
 
Joined
Feb 14, 2022
Messages
33
Reaction score
2
What language are you coding in?
Nowhere in the code you supplied is "turtle.onclick()" where you say you have a problem.
Nowhere in the code you supplied do you define or use a variable named "fun".
I use python, no i don,t use a variable called fun thank you for replying you are the first one to reply
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top