FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
UnrealEnginePython/examples/slow_task_with_progress_bar.py at develop · 20tab/UnrealEnginePython · GitHub
20tab
UnrealEnginePython
Repository navigation
Code
Issues
338
(338)
Pull requests
32
(32)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
UnrealEnginePython
/
examples
/
slow_task_with_progress_bar.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (23 loc) · 597 Bytes
Breadcrumbs
UnrealEnginePython
/
examples
/
slow_task_with_progress_bar.py
Copy path
File metadata and controls
28 lines (23 loc) · 597 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from
unreal_engine
import
SWindow
,
SProgressBar
,
SButton
,
SVerticalBox
import
unreal_engine
as
ue
progress_bar
=
SProgressBar
()
canceled
=
False
def
cancel_operation
():
global
canceled
ue
.
log_warning
(
'slow operation canceled'
)
canceled
=
True
SWindow
(
title
=
'slow task'
,
sizing_rule
=
1
)(
SVerticalBox
()
(
progress_bar
)
(
SButton
(
text
=
'cancel'
,
on_clicked
=
cancel_operation
)
)
)
for
i
in
range
(
0
,
10000
):
progress_bar
.
set_percent
(
1
/
10000
*
i
)
ue
.
log
(
'slow task iteration: {0}'
.
format
(
i
))
if
canceled
:
break
ue
.
slate_tick
()
Back
|
FazBrowse Home
|
New Git URL