Skip to content

Commit

Permalink
Merge pull request #173 from non-npc/patch-20
Browse files Browse the repository at this point in the history
Update splash-test.py
  • Loading branch information
ndonkoHenri authored Sep 12, 2024
2 parents c1b3710 + a44cfe3 commit caa7916
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions python/controls/page/splash-test.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
from time import sleep

import flet
import flet as ft
from flet import ElevatedButton, ProgressBar


def main(page):
def button_click(e):
page.splash = ProgressBar()
my_bar = ProgressBar()

page.overlay.append(my_bar)
btn.disabled = True
page.update()
sleep(3)
page.splash = None

page.overlay.remove(my_bar)
btn.disabled = False
page.update()

btn = ElevatedButton("Do some lengthy task!", on_click=button_click)

page.add(btn)


flet.app(target=main)
ft.app(target=main)

0 comments on commit caa7916

Please sign in to comment.