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

Function buildCheckBox

gui/builder_panel.go:224–242  ·  view source on GitHub ↗

buildCheckBox builds a gui object of type: CheckBox

(b *Builder, am map[string]interface{})

Source from the content-addressed store, hash-verified

222
223// buildCheckBox builds a gui object of type: CheckBox
224func buildCheckBox(b *Builder, am map[string]interface{}) (IPanel, error) {
225
226 // Builds check box and set commont attributes
227 var text string
228 if am[AttribText] != nil {
229 text = am[AttribText].(string)
230 }
231 cb := NewCheckBox(text)
232 err := b.SetAttribs(am, cb)
233 if err != nil {
234 return nil, err
235 }
236
237 // Sets optional checked value
238 if checked := am[AttribChecked]; checked != nil {
239 cb.SetValue(checked.(bool))
240 }
241 return cb, nil
242}
243
244// buildRadioButton builds a gui object of type: RadioButton
245func buildRadioButton(b *Builder, am map[string]interface{}) (IPanel, error) {

Callers

nothing calls this directly

Calls 3

NewCheckBoxFunction · 0.85
SetAttribsMethod · 0.80
SetValueMethod · 0.45

Tested by

no test coverage detected