I'm trying to interpret this code:
if e, ok := e.(widget.SubmitEvent); ok {
I get this:
impossible type assertion: gioui.org/widget.SubmitEvent does not implement
gioui.org/widget.EditorEvent (missing isEditorEvent method)
Well, widget.SubmitEvent does actually implement isEditorEvent.
widget is this, e is a widget.EditorEvent (here) which looks like this:
type EditorEvent interface {
isEditorEvent()
}
widget.ChangeEvent, SubmitEvent, and SelectEvent all implement isEditorEvent() (here):
func (s ChangeEvent) isEditorEvent() {}
func (s SubmitEvent) isEditorEvent() {}
func (s SelectEvent) isEditorEvent() {}
This works in the regular compiled code.
I'm trying to interpret this code:
I get this:
Well,
widget.SubmitEventdoes actually implementisEditorEvent.widgetis this,eis awidget.EditorEvent(here) which looks like this:widget.ChangeEvent,SubmitEvent, andSelectEventall implementisEditorEvent()(here):This works in the regular compiled code.