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

Function NewSplitButton

splitbutton.go:22–54  ·  view source on GitHub ↗
(parent Container)

Source from the content-addressed store, hash-verified

20}
21
22func NewSplitButton(parent Container) (*SplitButton, error) {
23 sb := new(SplitButton)
24
25 var disposables Disposables
26 defer disposables.Treat()
27
28 if err := InitWidget(
29 sb,
30 parent,
31 "BUTTON",
32 win.WS_TABSTOP|win.WS_VISIBLE|win.BS_SPLITBUTTON,
33 0); err != nil {
34 return nil, err
35 }
36 disposables.Add(sb)
37
38 sb.Button.init()
39
40 menu, err := NewMenu()
41 if err != nil {
42 return nil, err
43 }
44 disposables.Add(menu)
45 menu.window = sb
46 sb.menu = menu
47
48 sb.GraphicsEffects().Add(InteractionEffect)
49 sb.GraphicsEffects().Add(FocusEffect)
50
51 disposables.Spare()
52
53 return sb, nil
54}
55
56func (sb *SplitButton) Dispose() {
57 sb.Button.Dispose()

Callers

nothing calls this directly

Calls 7

TreatMethod · 0.95
AddMethod · 0.95
SpareMethod · 0.95
InitWidgetFunction · 0.85
NewMenuFunction · 0.85
GraphicsEffectsMethod · 0.65
initMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…