Code: Select all
Macro FlushWindowEvents()
While WindowEvent() : Wend
EndMacro

c ya,
nco2k
But you need a command like this for example if you do a complicated calculationfreak wrote:Dropping all user events is a bad practise. We won't encourage that with a library command
Code: Select all
OpenWindow(...)
...
FlushWindowEvents()
Repeat
WinEvent = WaitWindowEvent()
...
Until WinEvent = #PB_Event_CloseWindow
If your user interface has even a single way of user interaction, you should not just ignore the events but process them using WindowEvent().milan1612 wrote:But you need a command like this for example if you do a complicated calculation
that takes a lot of time and you don't want to use threads.
Otherwise it'll freeze up you user interface...
well, maybe you should remove commands like DeleteFile(), DeleteDirectory() etc.freak wrote:If you add a command that that encourages misuse, people will do just that.
These are 2 different events (item change and click). You can use EventType() to pick the right one.PB wrote:> Dropping all user events is a bad practise
But sometimes it's needed. For example: clicking an item in a ListIconGadget
returns two events. My app needs to drop everything after the first event or
my code will act twice, as if the user clicked the item twice, when he didn't.
Yes, this is planned. Not for a specific version yet though.PB wrote:@Freak: Could you at least please do this request:
http://www.purebasic.fr/english/viewtopic.php?t=28930
So we can add our own Macros in a Residents file and have them autocomplete
and autocapitalize? It would then be easy for us to add our own commands.
Either that, or 'KillTopic'Kaeru Gaman wrote: so, facit of this topic: we should remove KillThread()![]()