Python Forum
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Button Help
#1
I have created a choice-based game in Python for a project in my AP Computer Science class. It works, for the most part, but I am having trouble getting the buttons to disappear once they are pressed. Help would be much obliged.

def new_1_button(frame,text,function):
   #frame.stop()
   #frame = simplegui.create_frame('CYOA', FRAMEWIDTH,FRAMEHEIGHT)
   hp_color() #frame.set_draw_handler(draw_handler)
   frame.set_canvas_background('black')
   #frame.start()
   frame.add_button(text, function)

def new_2_button(frame, text_1, func_1, text_2, func_2):
   #frame.stop()
   #frame = simplegui.create_frame('CYOA', FRAMEWIDTH,FRAMEHEIGHT)
   hp_color() frame.set_draw_handler(draw_handler)
   frame.set_canvas_background('black')
   #frame.start()
   frame.add_button(text_1,func_1)
   frame.add_label(" ")
   frame.add_button(text_2,func_2)
This is the code for the buttons.
Reply


Messages In This Thread
Button Help - by slopz - Apr-29-2017, 03:46 PM
RE: Button Help - by nilamo - Apr-29-2017, 05:04 PM
RE: Button Help - by slopz - Apr-29-2017, 05:42 PM
RE: Button Help - by OPi - Apr-10-2021, 01:55 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020