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

Function NewTextLabelWithStyle

textlabel.go:22–41  ·  view source on GitHub ↗
(parent Container, style uint32)

Source from the content-addressed store, hash-verified

20}
21
22func NewTextLabelWithStyle(parent Container, style uint32) (*TextLabel, error) {
23 tl := new(TextLabel)
24
25 if err := tl.init(tl, parent, style); err != nil {
26 return nil, err
27 }
28
29 tl.textAlignment = AlignHNearVNear
30
31 tl.MustRegisterProperty("Text", NewProperty(
32 func() interface{} {
33 return tl.Text()
34 },
35 func(v interface{}) error {
36 return tl.SetText(assertStringOr(v, ""))
37 },
38 tl.textChangedPublisher.Event()))
39
40 return tl, nil
41}
42
43func (tl *TextLabel) asStatic() *static {
44 return &tl.static

Callers 1

NewTextLabelFunction · 0.85

Calls 7

NewPropertyFunction · 0.85
assertStringOrFunction · 0.85
MustRegisterPropertyMethod · 0.80
TextMethod · 0.65
initMethod · 0.45
SetTextMethod · 0.45
EventMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…