Send sends an new event of the given type to this widget, optionally starting from values in the given original event (recommended to include where possible). Do not send an existing event using this method if you want the Handled state to persist throughout the call chain; call HandleEvent directly
(typ events.Types, original ...events.Event)
| 167 | // want the Handled state to persist throughout the call chain; |
| 168 | // call HandleEvent directly for any existing events. |
| 169 | func (wb *WidgetBase) Send(typ events.Types, original ...events.Event) { |
| 170 | if wb.This == nil { |
| 171 | return |
| 172 | } |
| 173 | var e events.Event |
| 174 | if len(original) > 0 && original[0] != nil { |
| 175 | e = original[0].NewFromClone(typ) |
| 176 | } else { |
| 177 | e = &events.Base{Typ: typ} |
| 178 | e.Init() |
| 179 | } |
| 180 | wb.HandleEvent(e) |
| 181 | } |
| 182 | |
| 183 | // SendChange sends a new [events.Change] event, which is widely used to signal |
| 184 | // value changing for most widgets. It takes the event that the new change event |