相关疑难解决方法(0)

如何在 macOS 上全屏显示 tkinter 应用程序?

我刚刚学习Python,我正在尝试让一个窗口全屏显示,我已经实现了,但我现在想去掉顶部的标题栏。它目前看起来如下图所示,但我希望它也能覆盖顶部的 Mac 顶部工具栏(如启动屏幕)。

在此输入图像描述

from tkinter import *
root = Tk()

root.attributes('-fullscreen', True)
root.attributes('-topmost', True)
root.overrideredirect(True)



def quitApp():
    # mlabel = Label (root, text = 'Close').pack()
    root.destroy()

# placing the button on my window
button = Button(text = 'QUIT', command = quitApp).pack()
Run Code Online (Sandbox Code Playgroud)

python macos tkinter fullscreen python-2.7

3
推荐指数
1
解决办法
5330
查看次数

标签 统计

fullscreen ×1

macos ×1

python ×1

python-2.7 ×1

tkinter ×1