Hello,
I have several actions that need processing of 2 and more seconds. I can't continue the main loop but I need some "busy" notification (best animated).
I considered changing the cursor-icon, but especially for Windows it needs to get refreshed in a loop and there is also a lack of good cross platform functionality. BTW, would be nice to have a SetWindowCursor() function in PureBasic.
I considered a thread, but updating any GUI thing is no good idea in PureBasic (see several forum entries about incompatibility between threads and GUI).
Any other idea for some kind of "busy" notifier?
Kukulkan
Need good "busy" notification
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Need good "busy" notification
If Windows only, you could run the Windows busy animation. If x-platform, then why not make your own animation?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Need good "busy" notification
Hi Kukulkan,
This may be a PureBasic no-no, but I'll leave that for you to decide
- OpenWindow "can only" be called from the main thread (function: DisableDebugger)
Services, Stuff, and Shellhook
- Stuff/WindowStuff/TimerStuff
-- splash.pb
--- processing.gif
Cheers!
This may be a PureBasic no-no, but I'll leave that for you to decide

- OpenWindow "can only" be called from the main thread (function: DisableDebugger)
Services, Stuff, and Shellhook
- Stuff/WindowStuff/TimerStuff
-- splash.pb
--- processing.gif
Cheers!
Last edited by JHPJHP on Mon Feb 16, 2015 11:30 pm, edited 6 times in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Need good "busy" notification
Hello,
Thanks for your answers!
@IdeasVacuum: I need a cross platform solution.
@JHPJHP: This is making a window from inside a thread that contains a web-gadget that contains an animated gif. No bad idea. The only concern I have are possible issues if a thread is doing GUI... I will test it.
Kukulkan
Thanks for your answers!
@IdeasVacuum: I need a cross platform solution.
@JHPJHP: This is making a window from inside a thread that contains a web-gadget that contains an animated gif. No bad idea. The only concern I have are possible issues if a thread is doing GUI... I will test it.
Kukulkan
Re: Need good "busy" notification
The main GUI thread should always run without bigger interruption times.
Put your processing stuff into threads and send update/state-messages to the GUI thread using PostEvent.
Put your processing stuff into threads and send update/state-messages to the GUI thread using PostEvent.
Re: Need good "busy" notification
This has been settled with BindEvent()/PostEvent() functions successfully on all platforms.Kukulkan wrote:I considered a thread, but updating any GUI thing is no good idea in PureBasic (see several forum entries about incompatibility between threads and GUI).
Re: Need good "busy" notification
I do it like this:
1. open an hidden window, use a global datetime variable and
refresh the value within the mainloop with date().
2. create a thread that checks the value and if the difference
is higher than 3 seconds, unhide the window und play an anim.
You can use Canvas and StartDrawing(), because its seperated
for every thread.
3. the user should can click on closewindow to avoid seeing
the busy window and one button, to cancel the current operation.
greets, dige
1. open an hidden window, use a global datetime variable and
refresh the value within the mainloop with date().
2. create a thread that checks the value and if the difference
is higher than 3 seconds, unhide the window und play an anim.
You can use Canvas and StartDrawing(), because its seperated
for every thread.
3. the user should can click on closewindow to avoid seeing
the busy window and one button, to cancel the current operation.
greets, dige
"Daddy, I'll run faster, then it is not so far..."