forked from fyne-io/fyne
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththread.go
More file actions
20 lines (18 loc) · 792 Bytes
/
Copy paththread.go
File metadata and controls
20 lines (18 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package fyne
// DoAndWait is used to execute a specified function in the main Fyne runtime context.
// This is required when a background process wishes to adjust graphical elements of a running app.
// Developers should use this only from within goroutines they have created.
//
// Since: 2.6
func DoAndWait(fn func()) {
CurrentApp().Driver().DoFromGoroutine(fn, true)
}
// Do is used to execute a specified function in the main Fyne runtime context without waiting.
// This is required when a background process wishes to adjust graphical elements of a running app.
// Developers should use this only from within goroutines they have created and when the result does not have to
// be waited for.
//
// Since: 2.6
func Do(fn func()) {
CurrentApp().Driver().DoFromGoroutine(fn, false)
}