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

Method init

button.go:34–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32}
33
34func (b *Button) init() {
35 b.MustRegisterProperty("Checked", NewBoolProperty(
36 func() bool {
37 return b.Checked()
38 },
39 func(v bool) error {
40 b.SetChecked(v)
41 return nil
42 },
43 b.CheckedChanged()))
44
45 b.MustRegisterProperty("Image", NewProperty(
46 func() interface{} {
47 return b.Image()
48 },
49 func(v interface{}) error {
50 img, err := ImageFrom(v)
51 if err != nil {
52 return err
53 }
54
55 b.SetImage(img)
56
57 return nil
58 },
59 b.imageChangedPublisher.Event()))
60
61 b.MustRegisterProperty("Text", NewProperty(
62 func() interface{} {
63 return b.Text()
64 },
65 func(v interface{}) error {
66 return b.SetText(assertStringOr(v, ""))
67 },
68 b.textChangedPublisher.Event()))
69}
70
71func (b *Button) ApplyDPI(dpi int) {
72 b.WidgetBase.ApplyDPI(dpi)

Callers

nothing calls this directly

Calls 13

CheckedMethod · 0.95
SetCheckedMethod · 0.95
CheckedChangedMethod · 0.95
ImageMethod · 0.95
SetImageMethod · 0.95
TextMethod · 0.95
SetTextMethod · 0.95
NewBoolPropertyFunction · 0.85
NewPropertyFunction · 0.85
ImageFromFunction · 0.85
assertStringOrFunction · 0.85
MustRegisterPropertyMethod · 0.80

Tested by

no test coverage detected