在全屏模式下,如何使第二个GUI窗口弹出?

时间:2019-01-27 05:06:14

标签: python user-interface tkinter tkinter-canvas

我有一个全屏屏幕,每当发生某项操作时,另一个全屏屏幕都将弹出在前一个屏幕的前面。

因此,基本上,当以全屏模式打开“ guiCreate”时,“ popUpScreen”将不会在“ guiCreate”的前面弹出。

但是,如果我不在全屏模式下,它可以正常工作。

class guiCreate(Frame): #first window

def __init__(self, master, **kwargs):

    pad = 3
    x = master.winfo_screenwidth() - pad
    y = master.winfo_screenheight() - pad

    self.globalX = x
    self.globalY = y

    Frame.__init__(self, master)

    self.master = master
    self._geom = '200x200+0+0'
    master.geometry("{0}x{1}+0+0".format(
        x, y))

class popUpScreen(Frame): #second window that is meant to popup infront of the previous one during fullscreen mode

def __init__(self, master, **kwargs):

    x = master.winfo_screenwidth()
    y = master.winfo_screenheight()

    Frame.__init__(self, master)

    self.master = master

    self._geom = '200x200+0+0'
    master.geometry("{0}x{1}+0+0".format(
        x, y))

    self.canvas = Canvas(self.master, width=x, height=y, bg='#00edff', highlightthickness=0)
    self.canvas.create_text(x/2, y/3.8, fill="white", font=("res/KeepCalm-Medium.ttf", 90),
                            text="New Payment")
    self.canvas.pack(side='top', expand=True)

我是mac用户,因此结果在Windows上可能会有所不同。

0 个答案:

没有答案