Area and drawing
The ui.Area widget presents a canvas-like control—a surface that can be drawn on using Path and other drawing primitives. At the time of writing, these APIs are all part of the ui package, but it may soon move to ui/draw in an effort to separate them from the main controls API. An area can either be the size of the space it occupies or it can be larger, in which case it will be embedded in a scrollable control. The desired behavior is chosen based on whether ui.NewArea(handler) or ui.NewScrollingArea(handler, width, height) is called (where width and height are the desired content size).
The logic behind an area is ui.AreaHandler, the first parameter to either of the area constructor functions. Its Draw(*ui.Area, *ui.AreaDrawParams ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access