summaryrefslogtreecommitdiffstats
path: root/pkg/gui/types/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/types/common.go')
-rw-r--r--pkg/gui/types/common.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go
index 650aa51eb..cb39c87b5 100644
--- a/pkg/gui/types/common.go
+++ b/pkg/gui/types/common.go
@@ -40,6 +40,11 @@ type IGuiCommon interface {
GetAppState() *config.AppState
SaveAppState() error
+
+ // Runs the given function on the UI thread (this is for things like showing a popup asking a user for input).
+ // Only necessary to call if you're not already on the UI thread i.e. you're inside a goroutine.
+ // All controller handlers are executed on the UI thread.
+ OnUIThread(f func() error)
}
type IPopupHandler interface {
@@ -73,6 +78,7 @@ type CreatePopupPanelOpts struct {
HandlersManageFocus bool
FindSuggestionsFunc func(string) []*Suggestion
+ Mask bool
}
type AskOpts struct {
@@ -88,6 +94,9 @@ type PromptOpts struct {
InitialContent string
FindSuggestionsFunc func(string) []*Suggestion
HandleConfirm func(string) error
+ // CAPTURE THIS
+ HandleClose func() error
+ Mask bool
}
type MenuItem struct {