Last active
March 15, 2022 12:47
-
-
Save jfjensen/890ab273bfef00c726c483aa778c5d6a to your computer and use it in GitHub Desktop.
Create a button to add an item to the data list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add := widget.NewButton("Add", func() { | |
w := myApp.NewWindow("Add Data") | |
itemName := widget.NewEntry() | |
addData := widget.NewButton("Add", func() { | |
data.Append(itemName.Text) | |
w.Close() | |
}) | |
cancel := widget.NewButton("Cancel", func() { | |
w.Close() | |
}) | |
w.SetContent(container.New(layout.NewVBoxLayout(), itemName, addData, cancel)) | |
w.Resize(fyne.NewSize(400, 200)) | |
w.CenterOnScreen() | |
w.Show() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment