基本的按鈕功能
使用點擊的方式,讓文字顯示出來
1 | from tkinter import * |
結果
如果要隱藏的話….
1 | btn2 = Button(root, text = "隱藏訊息", command = root.destroy) |
這樣就可以連同視窗一起關掉了
使用lambda的時機
以下是一個範例
1 | from tkinter import * |
結果
影像功能鈕
1 | def msgShow(): |
結果
添加游標
使用cursor
1 | btn = Button(root, image = Ball, command = msgShow, cursor = "heart") |
這個部分的圖片就給你們自行去實踐了