PBv6.30b6 WaitWindowEvent without parentheses

Raspberry PI specific forum
PeDe
Enthusiast
Enthusiast
Posts: 338
Joined: Sun Nov 26, 2017 3:13 pm

PBv6.30b6 WaitWindowEvent without parentheses

Post 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
User avatar
minimy
Addict
Addict
Posts: 821
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: PBv6.30b6 WaitWindowEvent without parentheses

Post by minimy »

Yes, normal, because WaitWindowEvent is a var.
WaitWindowEvent = 0
If translation=Error: reply="Sorry, Im Spanish": Endif
PeDe
Enthusiast
Enthusiast
Posts: 338
Joined: Sun Nov 26, 2017 3:13 pm

Re: PBv6.30b6 WaitWindowEvent without parentheses

Post by PeDe »

Thanks, and I thought EnableExplicit wasn't necessary for such a simple example. It's a bit embarrassing.

Peter
User avatar
minimy
Addict
Addict
Posts: 821
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: PBv6.30b6 WaitWindowEvent without parentheses

Post 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:
If translation=Error: reply="Sorry, Im Spanish": Endif
miso
Enthusiast
Enthusiast
Posts: 636
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PBv6.30b6 WaitWindowEvent without parentheses

Post by miso »

I don't like it, but also can't live without it...
User avatar
mk-soft
Always Here
Always Here
Posts: 6500
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PBv6.30b6 WaitWindowEvent without parentheses

Post 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.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply