강의노트 위젯 테두리 - relief

강의노트 • 조회수 38 • 댓글 0 • 작성 1주 전 • 수정 1주 전  
  • flat
  • raised
  • sunken
  • groove
  • ridge

relief

tkinter에서 위젯의 테두리의 모양은 Flat, Raised, Sunken, Groove, Ridge의 5개가 있다. 외부 테두리의 넓이는 borderwidth로 정한다.

import tkinter as tk
win = tk.Tk()
B1 = tk.Button(win, text ="FLAT",borderwidth=10, relief='flat' )
B2 = tk.Button(win, text ="RAISED",borderwidth=10, relief='raised')
B3 = tk.Button(win, text ="SUNKEN",borderwidth=10, relief='sunken')
B4 = tk.Button(win, text ="GROOVE",borderwidth=10, relief='groove')
B5 = tk.Button(win, text ="RIDGE",borderwidth=10, relief='ridge')
B1.pack(pady=5)
B2.pack(pady=5)
B3.pack(pady=5)
B4.pack(pady=5)
B5.pack(pady=5)
win.mainloop()

이전 글
다음 글
댓글
댓글로 소통하세요.