~eliasnaur/giouiorg

84212b45d91b8ae63631be1b9c3255b394bcdda7 — Chris Waldon 5 months ago ba73359
architecture: clarify and expand window section

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
1 files changed, 2 insertions(+), 2 deletions(-)

M content/doc/architecture/window.md
M content/doc/architecture/window.md => content/doc/architecture/window.md +2 -2
@@ 7,7 7,7 @@ Since a GUI library needs to talk to some sort of display system to display info

<{{files/architecture/main.go}}[/START DRAWLOOP OMIT/,/END DRAWLOOP OMIT/]

[`app.NewWindow`](http://gioui.org/app#NewWindow) chooses the appropriate "driver" depending on the environment and build context. It might choose Wayland, Win32, Cocoa among several others.
[`app.NewWindow`](http://gioui.org/app#NewWindow) chooses the appropriate "driver" depending on the environment and build context. It might choose Wayland, Win32, or Cocoa among several others.

An `app.Window` sends events from the display system to the [`window.Events()`](https://gioui.org/app#Window.Events) channel. The system events are listed in [`gioui.org/io/system`](https://gioui.org/io/system). The input events, such as [`gioui.org/io/pointer`](https://gioui.org/io/pointer) and [`gioui.org/io/key`](https://gioui.org/io/key), are also sent into that channel.



@@ 22,4 22,4 @@ For example, recording an operation that sets the current color to red:

<{{files/architecture/draw.go}}[/START OPERATIONS OMIT/,/END OPERATIONS OMIT/]

You might be thinking that it would be more usual to have an `ops.Add(ColorOp{Color: red})` method instead of using `op.ColorOp{Color: red}.Add(ops)`. It's like this so that the `Add` method doesn't have to take an interface-typed argument, which would often require an allocation to call. This is a key aspect of Gio's "zero allocation" design.
\ No newline at end of file
You might be thinking that it would be more usual to have an `ops.Add(ColorOp{Color: red})` method instead of using `op.ColorOp{Color: red}.Add(ops)`. It's like this so that the `Add` method doesn't have to take an interface-typed argument, which would often require an allocation to call. This is a key aspect of Gio's "zero allocation" design.