How to fix a window over others with Tkinter

Asked

Viewed 12 times

0

I would like to leave a fixed window on all others that are also open and maximized, even if the user clicks on other windows.

The language is Python with the Tkinter library.

Here is a minimally replicable example in which I would like to leave the window fixed.

import time
from tkinter import *

def MarcarTempo():
    global a
    a = ('Segunda onda: '+time.ctime(time.time()+50)+'\n\n'
         +'Terceira onda: '+time.ctime(time.time()+100)+'\n\n'
         +'Quarta onda: '+time.ctime(time.time()+150)+'\n\n'
         +'Quinta onda: '+time.ctime(time.time()+200)+'\n\n'
         +'Sexta onda: '+time.ctime(time.time()+250)+'\n\n'
         +'Sétima onda: '+time.ctime(time.time()+300)+'\n\n'
         +'Oitava onda: '+time.ctime(time.time()+350)+'\n\n'
         +'Nona onda: '+time.ctime(time.time()+400)+'\n\n'
         +'Décima onda: '+time.ctime(time.time()+450)+'\n\n'
         +'O chefe nascerá: '+time.ctime(time.time()+500))
    tempo['text'] = a

janela = Tk()

janela.title('Marcar Tempo Arena')

texto = Label(janela,text='TEMPOS DE SURGIMENTO')
texto.grid(row=0,column=0)

tempo = Label(janela,text='')
tempo.grid(row=1,column=0)

botao = Button(janela,text='Marcar',command=MarcarTempo)
botao.grid(row=2,column=0)

janela.mainloop()
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.