-
-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
18 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
# Topmost window | ||
|
||
Create a window that stays on top of, or in front of, other windows. | ||
Create a window that stays on top of other windows. | ||
|
||
``` python | ||
import pywebview | ||
import webview | ||
import time | ||
|
||
|
||
def deactivate(window): | ||
#window starts on top and is changed later | ||
time.sleep(5) | ||
#window starts as on top of and reverts back to normal after 20 seconds | ||
time.sleep(20) | ||
window.on_top = False | ||
window.load_html("<h1>This window is no longer on top of other windows</h1>") | ||
|
||
|
||
if __name__ == '__main__': | ||
# Create webview window that stays on top of, or in front of, all other windows | ||
window = webview.create_window('Topmost window', | ||
'https://pywebview.flowrl.com/hello', | ||
# Create webview window that stays on top of, all other windows | ||
window = webview.create_window('Topmost window', html="<h1>This window is on top of other windows</h1>", | ||
on_top=True) | ||
webview.start(deactivate, window) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters