diff --git a/dialog.go b/dialog.go index 1cd3928..e40c011 100644 --- a/dialog.go +++ b/dialog.go @@ -24,8 +24,8 @@ type clickable interface { OnClick (func ()) event.Cookie } -// New creates a new dialog window given a dialog kind. -func (kind DialogKind) New (parent tomo.Window, title, message string, options ...tomo.Object) (*Dialog, error) { +// NewDialog creates a new dialog window given a dialog kind. +func NewDialog (kind DialogKind, parent tomo.Window, title, message string, options ...tomo.Object) (*Dialog, error) { if title == "" { switch kind { case DialogInformation: title = "Information" @@ -73,8 +73,8 @@ func (kind DialogKind) New (parent tomo.Window, title, message string, options . return dialog, nil } -// NewOk creates a new dialog window with an OK option. -func (kind DialogKind) NewOk (parent tomo.Window, title, message string, onOk func ()) (*Dialog, error) { +// NewDialogOk creates a new dialog window with an OK option. +func NewDialogOk (kind DialogKind, parent tomo.Window, title, message string, onOk func ()) (*Dialog, error) { okButton := NewButton("OK") okButton.SetIcon(theme.IconStatusOkay) okButton.OnClick(func () { @@ -82,11 +82,11 @@ func (kind DialogKind) NewOk (parent tomo.Window, title, message string, onOk fu }) okButton.SetFocused(true) - return kind.New(parent, title, message, okButton) + return NewDialog(kind, parent, title, message, okButton) } -// NewOkCancel creates a new dialog window with OK and Cancel options. -func (kind DialogKind) NewOkCancel (parent tomo.Window, title, message string, onOk func ()) (*Dialog, error) { +// NewDialogOkCancel creates a new dialog window with OK and Cancel options. +func NewDialogOkCancel (kind DialogKind, parent tomo.Window, title, message string, onOk func ()) (*Dialog, error) { cancelButton := NewButton("Cancel") cancelButton.SetIcon(theme.IconStatusCancel) @@ -97,5 +97,5 @@ func (kind DialogKind) NewOkCancel (parent tomo.Window, title, message string, o }) okButton.SetFocused(true) - return kind.New(parent, title, message, cancelButton, okButton) + return NewDialog(kind, parent, title, message, cancelButton, okButton) }