app,io/system,layout: [API] move FrameEvent and Insets to package app

In the early days of Gio, FrameEvent was part of package app. It was
moved to package system to enable layout.NewContext be a convenient
short-hand for constructing a layout.

However, it seems the better design to leave FrameEvent (and Insets) in
package app, and move layout.NewContext there as well. More importantly,
the move allows us to replace the event.Queue interface with a concrete
type.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-10-08 12:21:41 -05:00
parent 60bfb9e064
commit cb1e605203
16 changed files with 103 additions and 107 deletions
+1 -3
View File
@@ -17,12 +17,10 @@ FrameEvent that prompts an update of the window contents.
For example:
import "gioui.org/unit"
w := app.NewWindow()
for {
e := w.NextEvent()
if e, ok := e.(system.FrameEvent); ok {
if e, ok := e.(app.FrameEvent); ok {
ops.Reset()
// Add operations to ops.
...