MCPcopy Create free account
hub / github.com/cogentcore/core / MessageDialog

Function MessageDialog

core/dialog.go:94–101  ·  view source on GitHub ↗

MessageDialog opens a new Dialog displaying the given message in the context of the given widget. An optional title can be provided.

(ctx Widget, message string, title ...string)

Source from the content-addressed store, hash-verified

92// MessageDialog opens a new Dialog displaying the given message
93// in the context of the given widget. An optional title can be provided.
94func MessageDialog(ctx Widget, message string, title ...string) {
95 b := NewBody(ctx.AsTree().Name + "-message-dialog")
96 if len(title) > 0 {
97 b.AddTitle(title[0])
98 }
99 b.AddText(message).AddOKOnly()
100 b.RunDialog(ctx)
101}
102
103// ErrorDialog opens a new dialog displaying the given error
104// in the context of the given widget. An optional title can

Callers 4

CutMethod · 0.92
mainFunction · 0.92
dialogsFunction · 0.92
TestDialogMessageFunction · 0.85

Calls 6

AddTitleMethod · 0.95
AddTextMethod · 0.95
RunDialogMethod · 0.95
NewBodyFunction · 0.85
AddOKOnlyMethod · 0.80
AsTreeMethod · 0.65

Tested by 1

TestDialogMessageFunction · 0.68