Page 2 of 2
Re: delay not working as expected
Posted: Wed Apr 02, 2025 9:53 am
by miso
Right, I forgot to add a delay(1). Fixed the code with waitwindowevent(1).
Re: delay not working as expected
Posted: Wed Apr 02, 2025 5:03 pm
by solo
Fred wrote: Wed Apr 02, 2025 9:44 am
you need to change WindowEvent() with WaitWindowEvent(1)
there is not a single 'WindowEvent()' in any of the code suggestions.
Re: delay not working as expected
Posted: Wed Apr 02, 2025 5:27 pm
by miso
I'm sorry. It was in my code, I fixed it already. I wrote some explanation that I did that, to not to confuse the forum readers. So I'm sorry again, there was a windowevent(), but now its gone, I replaced it as a correction.
Re: delay not working as expected
Posted: Wed Apr 02, 2025 5:27 pm
by HeX0R
I like this most in this weird thread

:
Marc56us wrote: Wed Apr 02, 2025 7:57 am
Code: Select all
Until WaitWindowEvent = #PB_Event_CloseWindow
Re: delay not working as expected
Posted: Wed Apr 02, 2025 5:28 pm
by jacdelad
Bold move, correcting the one who creates, maintained and develops PureBasic.
However, yes, it's a typo: Fred meant to replace WaitWindowEvent() with WaitWindowEvent(1).
Also, you should learn the basics first...
Edit: Yeah, my post was a bit late.
Re: delay not working as expected
Posted: Wed Apr 02, 2025 5:40 pm
by Marc56us
HeX0R wrote: Wed Apr 02, 2025 5:27 pm
I like this most in this weird thread

:
Marc56us wrote: Wed Apr 02, 2025 7:57 am
Code: Select all
Until WaitWindowEvent = #PB_Event_CloseWindow
Hi,
This line comes from the initiator of
the subject.

Extraordinary thing with PB, even something weird works !

Re: delay not working as expected
Posted: Wed Apr 02, 2025 5:53 pm
by miso
Just for clarification, with gadgets and windows, the windowtimer is the logical solution.
Managing a windowed application might be confusing at first for someone new. It needs some experimenting and testing (with failures) to get some understanding before it starts to work. Small examples included with pb should be the best to analyze first.
Re: delay not working as expected
Posted: Wed Apr 02, 2025 6:18 pm
by Mindphazer
Are you sure this guy, "solo" is real, made of flesh and blood ?
Re: delay not working as expected
Posted: Wed Apr 02, 2025 6:20 pm
by miso
97.7341865% percent sure. Or I'm an April's Fool, I take it

Re: delay not working as expected
Posted: Wed Apr 02, 2025 6:36 pm
by solo
miso wrote: Wed Apr 02, 2025 5:53 pm
Just for clarification, with gadgets and windows, the windowtimer is the logical solution.
Managing a windowed application might be confusing at first for someone new. It needs some experimenting and testing (with failures) to get some understanding before it starts to work. Small examles included with pb should be the best to analyze first.
i appreciate your and everyone else's help. I am new to PB, but i spent the last 20 yrs as a medical research programmer. some of my programs are licensed by the NIH and used by retinal researchers around the world. and i AM completely new to 'windowed' application, every language i used before DELAY put a delay where it was written.
that's where i started, w/ PB examples, and wrote a lovely Sierpinsky triangle generator. what i'm trying trying to do is slow down the steps so people can see the process.
Re: delay not working as expected
Posted: Wed Apr 02, 2025 7:17 pm
by jacdelad
Well, in your first post, the delay is indeed where it's written. Drawing is done when StopDrawing is used. Also the message handling is not PB specific, this is nearly the same for every OS. You would need an extra CPU to redraw everything on screen after each change.
Re: delay not working as expected
Posted: Thu Apr 03, 2025 4:54 pm
by miso
@Solo
The delay works in PB as you expect. It is possible to use delay though, when you have unfinished processes left, like drawing. If you delay when draws are unfinished, you wont see the image.