delay not working as expected

Just starting out? Need help? Post your questions and find answers here.
miso
Enthusiast
Enthusiast
Posts: 410
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: delay not working as expected

Post by miso »

Right, I forgot to add a delay(1). Fixed the code with waitwindowevent(1).
solo
New User
New User
Posts: 7
Joined: Tue Apr 01, 2025 3:50 pm

Re: delay not working as expected

Post 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.
miso
Enthusiast
Enthusiast
Posts: 410
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: delay not working as expected

Post 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.
Last edited by miso on Wed Apr 02, 2025 5:35 pm, edited 1 time in total.
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: delay not working as expected

Post by HeX0R »

I like this most in this weird thread :mrgreen: :
Marc56us wrote: Wed Apr 02, 2025 7:57 am

Code: Select all

Until WaitWindowEvent = #PB_Event_CloseWindow 
User avatar
jacdelad
Addict
Addict
Posts: 1992
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: delay not working as expected

Post 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.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: delay not working as expected

Post by Marc56us »

HeX0R wrote: Wed Apr 02, 2025 5:27 pm I like this most in this weird thread :mrgreen: :
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 ! :mrgreen:
miso
Enthusiast
Enthusiast
Posts: 410
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: delay not working as expected

Post 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.
Last edited by miso on Wed Apr 02, 2025 6:38 pm, edited 1 time in total.
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: delay not working as expected

Post by Mindphazer »

Are you sure this guy, "solo" is real, made of flesh and blood ?
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
miso
Enthusiast
Enthusiast
Posts: 410
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: delay not working as expected

Post by miso »

97.7341865% percent sure. Or I'm an April's Fool, I take it :)
solo
New User
New User
Posts: 7
Joined: Tue Apr 01, 2025 3:50 pm

Re: delay not working as expected

Post 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.
User avatar
jacdelad
Addict
Addict
Posts: 1992
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: delay not working as expected

Post 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.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
miso
Enthusiast
Enthusiast
Posts: 410
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: delay not working as expected

Post 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.
Post Reply