Python3.7 tkinter去掉邊框


import tkinter as tk

root = tk.Tk()
# root.titie("正常顯示標題") # 顯示標題
# root.attributes("-toolwindow",1) # 只顯示關閉按鈕,不顯示最小化和最大化
root.overrideredirect(True) # 工具欄全部不顯示
# root.protocol('WM_DELETE_WINDOW', no_mac_limit_use)
screenWidth = root.winfo_screenwidth()
screenHeight = root.winfo_screenheight()
ww, wh = 445, 75
root.geometry('%dx%d+%d+%d' % (ww, wh, (screenWidth - ww) / 2, (screenHeight - wh) / 2 - 200))
notice = tk.StringVar()
mac_entry = tk.StringVar()
notice.set('程序未授權,請將MAC地址發給管理員獲取授權')
now_mac = YOUR_MAC
mac_entry.set(now_mac)
tk.Entry(root, justify='center', width='40', fg='red', textvariable=notice, font=('', '14', 'bold')).grid(row=0, column=0, rowspan=1, columnspan=2)
tk.Entry(root, justify='center', width='40', fg='red', textvariable=mac_entry, font=('', '14', 'bold')).grid(row=1, column=0, rowspan=1, columnspan=2)
tk.Button(root, width='15', text="退 出", command=function_exit).grid(row=2, column=0)
tk.Button(root, text="msg", command=function_youwant).grid(row=2, column=1)
root.mainloop()


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM