I did this but it doesn't work
type buttonWithID struct {
widget.ListItemID
}
func newButtonWithID(button widget.Button) *buttonWithID {
newButton := &buttonWithID{}
newButton.ExtendBaseWidget(newButton)
newButton.ListItemID = 0
return newButton
}
and it returns this error:
newButton.ExtendBaseWidget undefined (type *buttonWithID has no field or method ExtendBaseWidget)
If you want to extend Button then your struct must embed the widget.Button
type. Extra fields would be added below that.
See the tutorial at https://developer.fyne.io/tutorial/extending-widgets