使用tkin更改python中的背景色

2024-05-14 08:18:16 发布

您现在位置:Python中文网/ 问答频道 /正文

嘿,我正在尝试使用tkinter更改python应用程序的背景色。 我试过了,但没用。在

app.configure(background='#FBC311')

我明白了:

enter image description here

我想把整个背景都填满。我的代码是:

^{pr2}$

Tags: 代码app应用程序tkinterconfigurebackground背景背景色
1条回答
网友
1楼 · 发布于 2024-05-14 08:18:16

在帧的for循环中,为背景添加一行:

for F in (StartPage, Departure, PageTwo):
    page_name = F.__name__
    frame = F(parent=container, controller=self)
    self.frames[page_name] = frame
    frame.config(bg="black") # or whatever color you like

相关问题 更多 >

    热门问题