From bbce939c82dc5966a1919e5fefc01d71a8f9eb23 Mon Sep 17 00:00:00 2001 From: AllenDang Date: Thu, 26 Mar 2020 18:43:59 +0800 Subject: [PATCH] Simplify Msgbox and provide advance usage by MsgboxV. --- Msgbox.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Msgbox.go b/Msgbox.go index 4a7733ce..90bd4580 100644 --- a/Msgbox.go +++ b/Msgbox.go @@ -113,7 +113,11 @@ func PrepareMsgbox() Layout { } } -func Msgbox(title, content string, buttons MsgboxButtons, resultCallback func(DialogResult)) { +func Msgbox(title, content string) { + MsgboxV(title, content, MsgboxButtonsOk, nil) +} + +func MsgboxV(title, content string, buttons MsgboxButtons, resultCallback func(DialogResult)) { stateRaw := Context.GetState(msgboxId) if stateRaw == nil { fmt.Println("Msgbox is not prepared. Invoke giu.PrepareMsgbox in the end of the layout.")