My graphics don't look good with my buttons


Joined
Feb 14, 2022
Messages
33
Reaction score
2
hi I am kiaan I am nine years old I am making my first app but graphics and my buttons don't look that good together can someone help with this problem I am coding In python this is the code for the graphics
code:
import turtle
t = turtle.Turtle()

t.penup()
t.forward(295)
t.right(90)
t.pendown()
t.forward(256.5)
t.right(90)
t.forward(600)
t.right(90)
t.forward(510)
t.right(90)
t.forward(600)
t.right(90)
t.forward(295)
t.penup()
t.forward(215)
t.right(90)
t.forward(600)
t.right(90)
t.forward(507.5)
t.right(90)
t.forward(300)
t.right(90)
t.forward(230)
t.pendown()
list1 = ["purple","red","blue","green","orange"]
for i in range(200):
t.color(list1[i%5])
t.pensize(i/10+1)
t.forward(i)
t.left(59)
turtle.done()

and this is how it looks
how it looks: pls check the attachment

and this is the code for the button
code:
import turtle
t = turtle.Turtle()
t.hideturtle()

s = turtle.Screen()

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

Button_x = 0
Button_y = 0
Button_xButtonlength = 80
Button_yButtonWidth = 30

t.penup()
t.goto(7, 6)
t.write("Start/Run", font=("Arial",12,"normal"))
def Button_click(x, y):
if Button_x <= x and x <= Button_x + Button_xButtonlength:
if Button_y <= y and y <= Button_y + Button_yButtonWidth:
output = tio = print("75 days are something minutes")
something = print(75*24*60)
print(tio)

s.onclick(Button_click)
s.mainloop()

and this is how it looks
how it looks: pls check the attachment


this is the code for both of them
code:
t.hideturtle()

s = turtle.Screen()

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

Button_x = 0
Button_y = 0
Button_xButtonlength = 80
Button_yButtonWidth = 30

t.penup()
t.goto(7, 6)
t.write("Start/Run", font=("Arial",12,"normal"))
def Button_click(x, y):
if Button_x <= x and x <= Button_x + Button_xButtonlength:
if Button_y <= y and y <= Button_y + Button_yButtonWidth:
output = tio = print("75 days are something minutes")
something = print(75*24*60)
print(tio)

s.onclick(Button_click)
s.mainloop()


and this is how it looks together
this is how it looks: pls check the attachment
can someone help me with this problem

Attachments​

  • graphic actual.jpg
    graphic actual.jpg
    69.4 KB · Views: 6
  • working button.jpg
    working button.jpg
    30.7 KB · Views: 5
  • buttons and graphics.jpg
    buttons and graphics.jpg
    68.2 KB · Views: 5
 
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