Page 1 of 1

PBv6.30b6 WaitWindowEvent without parentheses

Posted: Thu Jan 01, 2026 3:06 pm
by PeDe
PB v6.30b6 arm64 Raspberry Pi OS (Debian 13, Wayland/labwc)

If you use ‘WaitWindowEvent’ without parentheses, there is no syntax error and the program cannot be closed. Other events are also not processed.
I don't know if this is a PB error or just a user error.

Peter

Code: Select all

OpenWindow(0, 0, 0, 300, 200, "Test")
Repeat : Until WaitWindowEvent = #PB_Event_CloseWindow
;Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

Re: PBv6.30b6 WaitWindowEvent without parentheses

Posted: Thu Jan 01, 2026 3:18 pm
by minimy
Yes, normal, because WaitWindowEvent is a var.
WaitWindowEvent = 0

Re: PBv6.30b6 WaitWindowEvent without parentheses

Posted: Thu Jan 01, 2026 3:47 pm
by PeDe
Thanks, and I thought EnableExplicit wasn't necessary for such a simple example. It's a bit embarrassing.

Peter

Re: PBv6.30b6 WaitWindowEvent without parentheses

Posted: Thu Jan 01, 2026 6:11 pm
by minimy
PeDe wrote: Thu Jan 01, 2026 3:47 pm Thanks, and I thought EnableExplicit wasn't necessary for such a simple example. It's a bit embarrassing.

Peter
I never use EnableExplicit, make me crazy :lol:
The error is very comun, I did many times, dont worry.
I prefer use ev= WaitWindowEvent(1) because i got control over all the main loop.
Happy new year!!! Hip! :lol:

Re: PBv6.30b6 WaitWindowEvent without parentheses

Posted: Thu Jan 01, 2026 8:04 pm
by miso
I don't like it, but also can't live without it...

Re: PBv6.30b6 WaitWindowEvent without parentheses

Posted: Thu Jan 01, 2026 11:10 pm
by mk-soft
WaitWindowEvent() is completely sufficient. You can (must) only specify a timeout if you want to do something outside the events in the Main Event Loop.
But there is AddWindowTimer ...
With Timeout, the event loop runs pointlessly.