ScrollUpdateFromGeom updates the scrollbar for given dimension based on the current Geom.Scroll value for that dimension. This can be used to programatically update the scroll value.
(d math32.Dims)
| 109 | // based on the current Geom.Scroll value for that dimension. |
| 110 | // This can be used to programatically update the scroll value. |
| 111 | func (fr *Frame) ScrollUpdateFromGeom(d math32.Dims) { |
| 112 | if !fr.HasScroll[d] || fr.scrolls[d] == nil { |
| 113 | return |
| 114 | } |
| 115 | sb := fr.scrolls[d] |
| 116 | cv := fr.Geom.Scroll.Dim(d) |
| 117 | sb.setValueEvent(-cv) |
| 118 | fr.This.(Layouter).ApplyScenePos() // computes updated positions |
| 119 | fr.NeedsRender() |
| 120 | } |
| 121 | |
| 122 | // ScrollValues returns the maximum size that could be scrolled, |
| 123 | // the visible size (which could be less than the max size, in which |
no test coverage detected