MCPcopy
hub / github.com/g3n/engine / copySelected

Method copySelected

gui/dropdown.go:180–192  ·  view source on GitHub ↗

copySelected copy to the dropdown panel the selected item from the list.

()

Source from the content-addressed store, hash-verified

178// copySelected copy to the dropdown panel the selected item
179// from the list.
180func (dd *DropDown) copySelected() {
181
182 selected := dd.list.Selected()
183 if len(selected) > 0 {
184 dd.selItem = selected[0].(*ImageLabel)
185 dd.litem.CopyFields(dd.selItem)
186 dd.litem.SetWidth(dd.selItem.Width())
187 dd.recalc()
188 dd.Dispatch(OnChange, nil)
189 } else {
190 return
191 }
192}
193
194// onListChangeEvent is called when an item in the list is selected
195func (dd *DropDown) onListChangeEvent(evname string, ev interface{}) {

Callers 2

SetSelectedMethod · 0.95
onListChangeEventMethod · 0.95

Calls 6

recalcMethod · 0.95
CopyFieldsMethod · 0.80
SetWidthMethod · 0.80
WidthMethod · 0.65
DispatchMethod · 0.65
SelectedMethod · 0.45

Tested by

no test coverage detected