mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
apps/hello: rename context to gtx for consistency
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+7
-7
@@ -39,7 +39,7 @@ func loop(w *app.Window) error {
|
|||||||
maroon := color.RGBA{127, 0, 0, 255}
|
maroon := color.RGBA{127, 0, 0, 255}
|
||||||
face := faces.For(regular, unit.Sp(72))
|
face := faces.For(regular, unit.Sp(72))
|
||||||
message := "Hello, Gio"
|
message := "Hello, Gio"
|
||||||
c := &layout.Context{
|
gtx := &layout.Context{
|
||||||
Queue: w.Queue(),
|
Queue: w.Queue(),
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
@@ -48,14 +48,14 @@ func loop(w *app.Window) error {
|
|||||||
case app.DestroyEvent:
|
case app.DestroyEvent:
|
||||||
return e.Err
|
return e.Err
|
||||||
case app.UpdateEvent:
|
case app.UpdateEvent:
|
||||||
c.Reset(&e.Config, e.Size)
|
gtx.Reset(&e.Config, e.Size)
|
||||||
faces.Reset(c.Config)
|
faces.Reset(gtx.Config)
|
||||||
var material op.MacroOp
|
var material op.MacroOp
|
||||||
material.Record(c.Ops)
|
material.Record(gtx.Ops)
|
||||||
paint.ColorOp{Color: maroon}.Add(c.Ops)
|
paint.ColorOp{Color: maroon}.Add(gtx.Ops)
|
||||||
material.Stop()
|
material.Stop()
|
||||||
text.Label{Material: material, Face: face, Alignment: text.Middle, Text: message}.Layout(c)
|
text.Label{Material: material, Face: face, Alignment: text.Middle, Text: message}.Layout(gtx)
|
||||||
w.Update(c.Ops)
|
w.Update(gtx.Ops)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user