반응형
다음과 같이 위젯이 정상적으로 표시됩니다.
Label(self, text = 'hello', visible ='yes')
이와 같은 경우 위젯이 전혀 표시되지 않습니다.
Label(self, text = 'hello', visible ='no')
해결 방법
from Tkinter import *
def hide_me(event):
event.widget.pack_forget()
root = Tk()
btn=Button(root, text="Click")
btn.bind('<Button-1>', hide_me)
btn.pack()
btn2=Button(root, text="Click too")
btn2.bind('<Button-1>', hide_me)
btn2.pack()
root.mainloop()
참조 페이지 https://stackoverflow.com/questions/3819354
반응형
'파이썬' 카테고리의 다른 글
파이썬 Fastest way to convert an iterator to a list (0) | 2020.11.02 |
---|---|
파이썬 Save Dataframe to csv directly to s3 Python (0) | 2020.11.02 |
파이썬 Java 코드를 어떻게 효율적으로 파이썬으로 번역 할 수 있습니까? (0) | 2020.11.02 |
파이썬 PySpark에서 폭발 (0) | 2020.11.02 |
파이썬 Tensorflow-배치 데이터가있는 입력 행렬의 matmul (0) | 2020.11.02 |
댓글