評等結果
點擊便能為這篇文章進行評等!
[評等總次數: 0,平均評等: 0]
python3 程式練習 GUI Tkinter 使用按鈕開啟/關閉 全螢幕
安裝 tkinter gui 指令
sudo apt-get install python3-tk
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
#root.attributes('-zoomed',True)保有控制項的全螢幕
root.attributes('-fullscreen',True)
label=ttk.Label(root,text="Hello world")
label.pack()
#------關閉全螢幕----開始
btn_close_full = ttk.Button(root,text='關閉全營幕')
btn_close_full.pack()
def on_close_full():
    root.attributes('-fullscreen',False)
btn_close_full.config(command=on_close_full)
#-------關閉全螢幕----結束
#-------開啟全螢幕----開始
btn_open_full = ttk.Button(root,text='開啟全營幕')
btn_open_full.pack()
def on_open_full():
    root.attributes('-fullscreen',True)
btn_open_full.config(command=on_open_full)
#-------開啟全螢幕----結束
root.mainloop()
評等結果
點擊便能為這篇文章進行評等!
[評等總次數: 0,平均評等: 0]
			
 香積麵 藥膳 風味 84gx5包 素泡麵 純素 素食 蔬食 慈濟 靜思 
 好滋味御品/麻油猴頭菇 
 平衡豬 獨輪車小豬 平衡玩具 不倒翁平衡豬 
 3M 日本原裝進口 速效型 防水噴霧 170ml 衣物 鞋子 皮革 透氣 防水 團購