0

I am currently trying to create a button that can be hidden or shown with a definition (def).

root.Tk()
c = Canvas(root, wodth=1600, Height=100, bg='black')
root.attributes('-fullscreen', True)
c.pack
b = Button(c, text='I want to be unvisiblie')
b.place(x=210, y=88)

root.after(1)

Could you help me, Please? How can I do this (Please without any self-command)? Thanks

FBattle206
  • 69
  • 6

1 Answers1

1

So... You can use the "place_forget" to hide any widget..

So this is what can help you!

from tkinter import *
root = Tk()
a_button = Button(c, text='I want to by unvisiblie', command = lambda:b.place_forget())# I think the text should be "I want to be invisible!"
a_button.place(x=210, y=88)
root.mainloop()

I hope that you wanted this answer