MCPcopy Index your code
hub / github.com/lxn/walk / SetFrozen

Method SetFrozen

tableviewcolumn.go:253–293  ·  view source on GitHub ↗

SetFrozen sets if the column is frozen.

(frozen bool)

Source from the content-addressed store, hash-verified

251
252// SetFrozen sets if the column is frozen.
253func (tvc *TableViewColumn) SetFrozen(frozen bool) (err error) {
254 if frozen == tvc.frozen {
255 return nil
256 }
257
258 var checkBoxes bool
259 if tvc.tv != nil {
260 checkBoxes = tvc.tv.CheckBoxes()
261 }
262
263 old := tvc.frozen
264 defer func() {
265 if err != nil {
266 tvc.frozen = old
267
268 if tvc.tv != nil {
269 tvc.create()
270 }
271 }
272
273 if tvc.tv != nil {
274 tvc.tv.hasFrozenColumn = tvc.tv.visibleFrozenColumnCount() > 0
275 tvc.tv.SetCheckBoxes(checkBoxes)
276 tvc.tv.applyImageList()
277 }
278 }()
279
280 if tvc.tv != nil && tvc.visible {
281 if err = tvc.destroy(); err != nil {
282 return
283 }
284 }
285
286 tvc.frozen = frozen
287
288 if tvc.tv != nil && tvc.visible {
289 return tvc.create()
290 }
291
292 return nil
293}
294
295// Width returns the width of the column in pixels.
296func (tvc *TableViewColumn) Width() int {

Callers 2

CreateMethod · 0.95
RestoreStateMethod · 0.80

Calls 6

createMethod · 0.95
destroyMethod · 0.95
CheckBoxesMethod · 0.80
SetCheckBoxesMethod · 0.80
applyImageListMethod · 0.80

Tested by

no test coverage detected