窗口置顶
小于 1 分钟
窗口置顶
创建一个始终保持在其他窗口顶部的窗口。
import time
import webview
def deactivate(window):
# 窗口最初位于顶层,20秒后还原为正常状态
time.sleep(20)
window.on_top = False
window.load_html('<h1>此窗口不再位于其他窗口顶部</h1>')
if __name__ == '__main__':
# 创建始终位于顶层的窗口,高于所有其他窗口
window = webview.create_window(
'最上层窗口', html='<h1>此窗口位于其他窗口顶部</h1>', on_top=True
)
webview.start(deactivate, window)