copySelected copy to the dropdown panel the selected item from the list.
()
| 178 | // copySelected copy to the dropdown panel the selected item |
| 179 | // from the list. |
| 180 | func (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 |
| 195 | func (dd *DropDown) onListChangeEvent(evname string, ev interface{}) { |