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

Method init

form.go:105–153  ·  view source on GitHub ↗
(form Form)

Source from the content-addressed store, hash-verified

103}
104
105func (fb *FormBase) init(form Form) error {
106 var err error
107 if fb.clientComposite, err = NewComposite(form); err != nil {
108 return err
109 }
110 fb.clientComposite.SetName("clientComposite")
111 fb.clientComposite.background = nil
112
113 fb.clientComposite.children.observer = form.AsFormBase()
114
115 fb.MustRegisterProperty("Icon", NewProperty(
116 func() interface{} {
117 return fb.Icon()
118 },
119 func(v interface{}) error {
120 icon, err := IconFrom(v, fb.DPI())
121 if err != nil {
122 return err
123 }
124
125 var img Image
126 if icon != nil {
127 img = icon
128 }
129
130 fb.SetIcon(img)
131
132 return nil
133 },
134 fb.iconChangedPublisher.Event()))
135
136 fb.MustRegisterProperty("Title", NewProperty(
137 func() interface{} {
138 return fb.Title()
139 },
140 func(v interface{}) error {
141 return fb.SetTitle(assertStringOr(v, ""))
142 },
143 fb.titleChangedPublisher.Event()))
144
145 version := win.GetVersion()
146 if (version&0xFF) > 6 || ((version&0xFF) == 6 && (version&0xFF00>>8) > 0) {
147 win.ChangeWindowMessageFilterEx(fb.hWnd, taskbarButtonCreatedMsgId, win.MSGFLT_ALLOW, nil)
148 }
149
150 fb.performLayout, fb.layoutResults, fb.inSizeLoop, fb.updateStopwatch, fb.quitLayoutPerformer = startLayoutPerformer(fb)
151
152 return nil
153}
154
155func (fb *FormBase) Dispose() {
156 if fb.hWnd != 0 {

Callers 10

NewDateLabelFunction · 0.45
NewRadioButtonFunction · 0.45
initWindowWithCfgFunction · 0.45
NewLabelWithStyleFunction · 0.45
NewSplitButtonFunction · 0.45
NewTextLabelWithStyleFunction · 0.45
NewNumberLabelFunction · 0.45
NewPushButtonFunction · 0.45
NewCheckBoxFunction · 0.45
NewToolButtonFunction · 0.45

Calls 14

IconMethod · 0.95
SetIconMethod · 0.95
TitleMethod · 0.95
SetTitleMethod · 0.95
NewCompositeFunction · 0.85
NewPropertyFunction · 0.85
IconFromFunction · 0.85
assertStringOrFunction · 0.85
startLayoutPerformerFunction · 0.85
MustRegisterPropertyMethod · 0.80
SetNameMethod · 0.65
AsFormBaseMethod · 0.65

Tested by

no test coverage detected