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)
| 92 | // MessageDialog opens a new Dialog displaying the given message |
| 93 | // in the context of the given widget. An optional title can be provided. |
| 94 | func 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 |