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

Function NewLabelWithStyle

label.go:28–47  ·  view source on GitHub ↗
(parent Container, style uint32)

Source from the content-addressed store, hash-verified

26}
27
28func NewLabelWithStyle(parent Container, style uint32) (*Label, error) {
29 l := new(Label)
30
31 if err := l.init(l, parent, style); err != nil {
32 return nil, err
33 }
34
35 l.SetTextAlignment(AlignNear)
36
37 l.MustRegisterProperty("Text", NewProperty(
38 func() interface{} {
39 return l.Text()
40 },
41 func(v interface{}) error {
42 return l.SetText(assertStringOr(v, ""))
43 },
44 l.textChangedPublisher.Event()))
45
46 return l, nil
47}
48
49func (l *Label) asStatic() *static {
50 return &l.static

Callers 1

NewLabelFunction · 0.85

Calls 8

NewPropertyFunction · 0.85
assertStringOrFunction · 0.85
MustRegisterPropertyMethod · 0.80
TextMethod · 0.65
initMethod · 0.45
SetTextAlignmentMethod · 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…