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

Function NewScrollView

scrollview.go:30–63  ·  view source on GitHub ↗
(parent Container)

Source from the content-addressed store, hash-verified

28}
29
30func NewScrollView(parent Container) (*ScrollView, error) {
31 sv := &ScrollView{horizontal: true, vertical: true}
32
33 if err := InitWidget(
34 sv,
35 parent,
36 scrollViewWindowClass,
37 win.WS_CHILD|win.WS_HSCROLL|win.WS_VISIBLE|win.WS_VSCROLL,
38 win.WS_EX_CONTROLPARENT); err != nil {
39 return nil, err
40 }
41
42 succeeded := false
43 defer func() {
44 if !succeeded {
45 sv.Dispose()
46 }
47 }()
48
49 var err error
50 if sv.composite, err = NewComposite(sv); err != nil {
51 return nil, err
52 }
53
54 sv.composite.SizeChanged().Attach(func() {
55 sv.updateScrollBars()
56 })
57
58 sv.SetBackground(NullBrush())
59
60 succeeded = true
61
62 return sv, nil
63}
64
65func (sv *ScrollView) AsContainerBase() *ContainerBase {
66 if sv.composite == nil {

Callers

nothing calls this directly

Calls 8

updateScrollBarsMethod · 0.95
InitWidgetFunction · 0.85
NewCompositeFunction · 0.85
NullBrushFunction · 0.85
DisposeMethod · 0.65
SizeChangedMethod · 0.65
SetBackgroundMethod · 0.65
AttachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…