Skip to content

Commit e01bb8f

Browse files
committed
Fix screens example
1 parent 62d4f91 commit e01bb8f

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

docs/examples/screens.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ Get available display information using `webview.screens`
66
``` python
77
import webview
88

9-
def display_screen_info():
9+
10+
if __name__ == '__main__':
1011
screens = webview.screens
1112
print('Available screens are: ' + str(screens))
1213

14+
for i, screen in enumerate(screens):
15+
webview.create_window('', html=f'placed on the monitor {i+1}', screen=screen)
1316

14-
if __name__ == '__main__':
15-
display_screen_info() # display screen info before starting app
16-
17-
window = webview.create_window('Simple browser', 'https://pywebview.flowrl.com/hello')
18-
webview.start(display_screen_info)
17+
webview.start()
1918
```

examples/screens.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
import webview
44

55

6-
def display_screen_info():
7-
screens = webview.screens
8-
9-
106

117
if __name__ == '__main__':
128
screens = webview.screens
139
print('Available screens are: ' + str(screens))
1410

15-
window = webview.create_window('', html='placed on the first monitor', screen=screens[0])
16-
window = webview.create_window('', html='placed on the second monitor', screen=screens[1])
11+
for i, screen in enumerate(screens):
12+
webview.create_window('', html=f'placed on the monitor {i+1}', screen=screen)
1713

1814
webview.start()
1915

0 commit comments

Comments
 (0)