I want spinners to update without a WaitWindowEvent()

Everything else that doesn't fall into one of the other PB categories.
halo
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Jan 26, 2004 2:49 am

I want spinners to update without a WaitWindowEvent()

Post by halo »

I am using PureBasic to create a windows interface on a Blitz3D window.

I use my own WaitEvent() routine, which cycles through and calls a PureBasic WaitEvent() command each loop. I have a special spin gadget that can be edited by typing the text, or pressing the buttons. My problem is that PureBasic does not update the gadget without a WaitWindowEvent() command. I cannot use WaitWindowEvent() because other events that only my routine detects will be stalled.

How can I force PureBasic to update the spingadget so that I can get a "typing text" event (#257) or a gadget event when the spingadget buttons are pressed?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

use normal window event plus sleep / delay?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

halo,

You're loop probably isn't leaving any time for the custom control to update itself. YOu can get around this by adding a delay() to you're loop.

It is usually best to implement more sophisticated event handling using a window callback.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

have you tried UpdateWindow_(Windowhandle) or InvalidateRect_(GadgetID(GadgetNr),0,1) :?:
halo
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Jan 26, 2004 2:49 am

Post by halo »

I added a delay commend right before the waitevent, and it worked.

Thanks!
swan
Enthusiast
Enthusiast
Posts: 227
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Post by swan »

I've used Delay() in the past as well, but I've wondered what would be the most efficient delay value. Have used Delay(10) and seems to be fine, but I'm curious of any comments on this.

SWAN ...
Post Reply