簡體   English   中英

我的程序正在運行,但已最小化

[英]My program is running, but it is minimized

def Poland():
    import turtle as t
    t.bgcolor("black")
    t.width(10)
    t.color("white")
    t.forward(50)
    t.right(90)
    t.penup()
    t.forward(10)
    t.right(90)
    t.pendown()
    t.color("red")
    t.forward(50)

Z = eval(input("Your country: "))
if (Z == Poland):
    Poland()

當我運行這個程序並用波蘭回答“你的國家”問題時,它確實有效(它打開“Python Turtle Graphics”window 並繪制一個標志),但它被最小化了。 請幫忙。 我對此很陌生。

如果你想最大化海龜 window 只需使用:

t.Screen().cv._rootwindow.wm_state("zoomed")

或者

t.Screen().cv._rootwindow.state("zoomed")

這是有效的,因為海龜只不過是 tkinter window。

但是 window 將在后台播放。

在第一層彈出它:

t.Screen().cv._rootwindow.attributes("-topmost", True)

更多 tkinter 在海龜t.Screen().cv._rootwindow.here_comes_the_tkinter_window_command

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM