Hello all,
I have a dialog.
One of the buttons should launch an algorithm that takes time, so I want to display a progress bar.
There are many buttons on the dialog, and pressing them would interfere, so I do not want the user to be able to press any button during this process/algorithm. For this reason, I thought that the progress bar should be modal.
1) Is there a code example for what I need to implement ? Anything close to what I need to implement ?
2) Any advice on what is the best way to implement this ?
Thanks
zmau
example for modal progress bar
-
- Super wx Problem Solver
- Posts: 469
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: example for modal progress bar
It sounds like what you want is the wxProgressDialog class. There is a short example this page and larger example in the dialogs sample.
Re: example for modal progress bar
Thanks
1) Where is "dialogs sample" ? I think I need the "larger example".
2) I forgot to mention that the algorithm takes place in a different thread, so the short example is not good enough.
Thanks
zmau
1) Where is "dialogs sample" ? I think I need the "larger example".
2) I forgot to mention that the algorithm takes place in a different thread, so the short example is not good enough.
Thanks
zmau
Re: example for modal progress bar
Check the "threads" sample. It's in <wxdir>/samples/thread/
Use the source, Luke!
-
- Super wx Problem Solver
- Posts: 469
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: example for modal progress bar
The dialogs sample is in the samples folder that comes with the wxWidgets library - specifically in the folder <WXROOT>/samples/dialogs. If you're using a separate worker thread, it's very important that you never call gui methods from the secondary thread. So you'll have to update the progress dialog using wxThread event if your using the wxWidgets threading API.