Skip to content

Commit

Permalink
Merge pull request #1515 from dlech/fix-window-title-example
Browse files Browse the repository at this point in the history
Fix window change title example exit
  • Loading branch information
r0x0r authored Nov 12, 2024
2 parents 93eae4f + 5b7128f commit 8a51239
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/window_title_change.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"""Change window title every three seconds."""

import time

import webview


def change_title(window):
"""changes title every 3 seconds"""
for i in range(1, 100):
time.sleep(3)
# exit loop when window is closed
if window.events.closed.wait(3):
break

window.title = f'New Title #{i}'
print(window.title)

Expand Down

0 comments on commit 8a51239

Please sign in to comment.