It is currently Wed Nov 20, 2019 8:35 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Need good "busy" notification
PostPosted: Tue Feb 03, 2015 3:26 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1213
Location: germany
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Need good "busy" notification
PostPosted: Tue Feb 03, 2015 3:46 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5855
Location: Wales, UK
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Need good "busy" notification
PostPosted: Tue Feb 03, 2015 4:47 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1593
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!

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Mon Feb 16, 2015 11:30 pm, edited 6 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Need good "busy" notification
PostPosted: Tue Feb 03, 2015 5:07 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1213
Location: germany
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Need good "busy" notification
PostPosted: Tue Feb 03, 2015 7:10 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 8:26 am
Posts: 2936
Location: Planet Earth
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Need good "busy" notification
PostPosted: Tue Feb 03, 2015 7:40 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue May 28, 2013 10:51 pm
Posts: 539
Location: Europe
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).
This has been settled with BindEvent()/PostEvent() functions successfully on all platforms.

_________________
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: Need good "busy" notification
PostPosted: Thu Feb 05, 2015 8:57 am 
Offline
Addict
Addict
User avatar

Joined: Wed Apr 30, 2003 8:15 am
Posts: 989
Location: Germany
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

_________________
"Daddy, I'll run faster, then it is not so far..."


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye