-
Hi team, I have tried to find the answer elsewhere but couldn't
Thanks for any guidance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This is the wrong repository. I suppose you meant to open in fyne-io/fyne. |
Beta Was this translation helpful? Give feedback.
-
To answer your question: You just set the OnCancel method later: deviceForm := &widget.Form{
Items: []*widget.FormItem{
{Text: "Name", Widget: name},
{Text: "URL", Widget: url},
},
OnSubmit: func() {
log.Println("device:", name.Text)
log.Println("url:", url.Text)
},
SubmitText: "Add Device",
CancelText: "Cancel",
}
deviceForm.OnCancel = func() {
deviceForm.Hide()
fmt.Println("Hide the form")
}
deviceForm.Hide() |
Beta Was this translation helpful? Give feedback.
To answer your question:
You just set the OnCancel method later: