-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added topmost and toggle_topmost, for Windows only. Similar to fullsc…
…reen and toggle_fullscreen
- Loading branch information
1 parent
462a01b
commit d773580
Showing
11 changed files
with
127 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Toggle topmost | ||
|
||
Switch application window to topmost mode after five seconds (window stays on top of, or in front of, other windows). | ||
|
||
``` python | ||
import webview | ||
import time | ||
|
||
def toggle_topmost(window): | ||
# wait a few seconds before toggling topmost: | ||
time.sleep(5) | ||
|
||
window.toggle_topmost() | ||
|
||
|
||
if __name__ == '__main__': | ||
window = webview.create_window('Topmost window', 'https://pywebview.flowrl.com/hello') | ||
webview.start(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Topmost window | ||
|
||
Create a window that stays on top of, or in front of, other windows. | ||
|
||
``` python | ||
import webview | ||
|
||
|
||
if __name__ == '__main__': | ||
webview.create_window('Topmost window', | ||
'https://pywebview.flowrl.com/hello', | ||
topmost=True) | ||
webview.start() | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import webview | ||
import time | ||
|
||
""" | ||
This example demonstrates how to toggle topmost mode programmatically. | ||
""" | ||
|
||
|
||
def toggle_topmost(window): | ||
# wait a few seconds before toggle topmost: | ||
time.sleep(5) | ||
|
||
window.toggle_topmost() | ||
|
||
|
||
if __name__ == '__main__': | ||
window = webview.create_window('Topmost window', 'https://pywebview.flowrl.com/hello') | ||
webview.start(toggle_topmost, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import webview | ||
|
||
""" | ||
This example demonstrates how to create a topmost webview window. | ||
""" | ||
|
||
if __name__ == '__main__': | ||
# Create webview window that stays on top of, or in front of, all other windows | ||
webview.create_window('Topmost window', | ||
'https://pywebview.flowrl.com/hello', | ||
topmost=True) | ||
webview.start() |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import webview | ||
from .util import run_test | ||
|
||
|
||
def test_toggle_topmost(): | ||
window = webview.create_window("Toggle topmost test", "https://www.example.org") | ||
run_test(webview, window, toggle_topmost) | ||
|
||
|
||
def toggle_topmost(window): | ||
try: | ||
window.toggle_topmost() | ||
except NotImplementedError: | ||
print('This OS/guilib does not yet have "topmost" feature.') |
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
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