MCPcopy
hub / github.com/lxn/walk / NewCheckBox

Function NewCheckBox

checkbox.go:30–61  ·  view source on GitHub ↗
(parent Container)

Source from the content-addressed store, hash-verified

28}
29
30func NewCheckBox(parent Container) (*CheckBox, error) {
31 cb := new(CheckBox)
32
33 if err := InitWidget(
34 cb,
35 parent,
36 "BUTTON",
37 win.WS_TABSTOP|win.WS_VISIBLE|win.BS_AUTOCHECKBOX,
38 0); err != nil {
39 return nil, err
40 }
41
42 cb.Button.init()
43
44 cb.SetBackground(nullBrushSingleton)
45
46 cb.GraphicsEffects().Add(InteractionEffect)
47 cb.GraphicsEffects().Add(FocusEffect)
48
49 cb.MustRegisterProperty("CheckState", NewProperty(
50 func() interface{} {
51 return cb.CheckState()
52 },
53 func(v interface{}) error {
54 cb.SetCheckState(CheckState(assertIntOr(v, 0)))
55
56 return nil
57 },
58 cb.CheckStateChanged()))
59
60 return cb, nil
61}
62
63func (cb *CheckBox) TextOnLeftSide() bool {
64 return cb.hasStyleBits(win.BS_LEFTTEXT)

Callers 1

NewGroupBoxFunction · 0.85

Calls 12

InitWidgetFunction · 0.85
NewPropertyFunction · 0.85
CheckStateTypeAlias · 0.85
assertIntOrFunction · 0.85
MustRegisterPropertyMethod · 0.80
CheckStateMethod · 0.80
SetCheckStateMethod · 0.80
CheckStateChangedMethod · 0.80
SetBackgroundMethod · 0.65
GraphicsEffectsMethod · 0.65
initMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…