mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-08 02:45:38 +00:00
app: [API] rename Window.NextEvent to Event to match Source.Event
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-3
@@ -8,7 +8,7 @@ See https://gioui.org for instructions to set up and run Gio programs.
|
|||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
|
|
||||||
A Window is run by calling its NextEvent method in a loop. The first time a
|
A Window is run by calling its Event method in a loop. The first time a
|
||||||
method on Window is called, a new GUI window is created and shown. On mobile
|
method on Window is called, a new GUI window is created and shown. On mobile
|
||||||
platforms or when Gio is embedded in another project, Window merely connects
|
platforms or when Gio is embedded in another project, Window merely connects
|
||||||
with a previously created GUI window.
|
with a previously created GUI window.
|
||||||
@@ -20,7 +20,7 @@ For example:
|
|||||||
|
|
||||||
w := new(app.Window)
|
w := new(app.Window)
|
||||||
for {
|
for {
|
||||||
e := w.NextEvent()
|
e := w.Event()
|
||||||
if e, ok := e.(app.FrameEvent); ok {
|
if e, ok := e.(app.FrameEvent); ok {
|
||||||
ops.Reset()
|
ops.Reset()
|
||||||
// Add operations to ops.
|
// Add operations to ops.
|
||||||
@@ -50,7 +50,7 @@ For example, to display a blank but otherwise functional window:
|
|||||||
go func() {
|
go func() {
|
||||||
w := app.NewWindow()
|
w := app.NewWindow()
|
||||||
for {
|
for {
|
||||||
w.NextEvent()
|
w.Event()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
app.Main()
|
app.Main()
|
||||||
|
|||||||
+2
-2
@@ -672,9 +672,9 @@ func (w *Window) processEvent(e event.Event) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextEvent blocks until an event is received from the window, such as
|
// Event blocks until an event is received from the window, such as
|
||||||
// [FrameEvent], or until [Invalidate] is called.
|
// [FrameEvent], or until [Invalidate] is called.
|
||||||
func (w *Window) NextEvent() event.Event {
|
func (w *Window) Event() event.Event {
|
||||||
w.init()
|
w.init()
|
||||||
return w.basic.Event()
|
return w.basic.Event()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user