Gtk3 Hiding a dialog before heavy computation begins (pyGtk)
up vote
0
down vote
favorite
My program (pyGtk 3 based) displays a custom built dialog which collects data for a heavy computation task (running least square optimizations).
I'm issuing (in that order):
- a call for my_dialog.hide()
- Starting a spinner widget (spinner.start() )
- Perform the optimization
- Stopping the spinner
- Displaying results
What actually happens is that the dialog stays displayed throughout the heavy computational task and only after it is complete, it is being hidden and results are displayed without seeing the spinner.
My guess is that the thread of the dialog is slower than the computational task kicks in.
How can I make sure the dialog closes before the computational task begins without having a performance hit?
(Or am I missing a point here - please enlighten me)
Thanks.
python gtk3 pygtk
add a comment |
up vote
0
down vote
favorite
My program (pyGtk 3 based) displays a custom built dialog which collects data for a heavy computation task (running least square optimizations).
I'm issuing (in that order):
- a call for my_dialog.hide()
- Starting a spinner widget (spinner.start() )
- Perform the optimization
- Stopping the spinner
- Displaying results
What actually happens is that the dialog stays displayed throughout the heavy computational task and only after it is complete, it is being hidden and results are displayed without seeing the spinner.
My guess is that the thread of the dialog is slower than the computational task kicks in.
How can I make sure the dialog closes before the computational task begins without having a performance hit?
(Or am I missing a point here - please enlighten me)
Thanks.
python gtk3 pygtk
If you are using Gtk3, you are not using Pygtk. Pygtk is Gtk2. Please update your question.
– theGtknerd
Nov 11 at 17:12
You need to allow the main loop to regain control. See my post here. Or maybe I should say, you need to force Gtk to do it's rendering before you do your main computation.
– theGtknerd
Nov 11 at 17:19
Post a minimal example
– gianmt
Nov 12 at 7:13
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
My program (pyGtk 3 based) displays a custom built dialog which collects data for a heavy computation task (running least square optimizations).
I'm issuing (in that order):
- a call for my_dialog.hide()
- Starting a spinner widget (spinner.start() )
- Perform the optimization
- Stopping the spinner
- Displaying results
What actually happens is that the dialog stays displayed throughout the heavy computational task and only after it is complete, it is being hidden and results are displayed without seeing the spinner.
My guess is that the thread of the dialog is slower than the computational task kicks in.
How can I make sure the dialog closes before the computational task begins without having a performance hit?
(Or am I missing a point here - please enlighten me)
Thanks.
python gtk3 pygtk
My program (pyGtk 3 based) displays a custom built dialog which collects data for a heavy computation task (running least square optimizations).
I'm issuing (in that order):
- a call for my_dialog.hide()
- Starting a spinner widget (spinner.start() )
- Perform the optimization
- Stopping the spinner
- Displaying results
What actually happens is that the dialog stays displayed throughout the heavy computational task and only after it is complete, it is being hidden and results are displayed without seeing the spinner.
My guess is that the thread of the dialog is slower than the computational task kicks in.
How can I make sure the dialog closes before the computational task begins without having a performance hit?
(Or am I missing a point here - please enlighten me)
Thanks.
python gtk3 pygtk
python gtk3 pygtk
asked Nov 11 at 1:57
Ben Shomer
111
111
If you are using Gtk3, you are not using Pygtk. Pygtk is Gtk2. Please update your question.
– theGtknerd
Nov 11 at 17:12
You need to allow the main loop to regain control. See my post here. Or maybe I should say, you need to force Gtk to do it's rendering before you do your main computation.
– theGtknerd
Nov 11 at 17:19
Post a minimal example
– gianmt
Nov 12 at 7:13
add a comment |
If you are using Gtk3, you are not using Pygtk. Pygtk is Gtk2. Please update your question.
– theGtknerd
Nov 11 at 17:12
You need to allow the main loop to regain control. See my post here. Or maybe I should say, you need to force Gtk to do it's rendering before you do your main computation.
– theGtknerd
Nov 11 at 17:19
Post a minimal example
– gianmt
Nov 12 at 7:13
If you are using Gtk3, you are not using Pygtk. Pygtk is Gtk2. Please update your question.
– theGtknerd
Nov 11 at 17:12
If you are using Gtk3, you are not using Pygtk. Pygtk is Gtk2. Please update your question.
– theGtknerd
Nov 11 at 17:12
You need to allow the main loop to regain control. See my post here. Or maybe I should say, you need to force Gtk to do it's rendering before you do your main computation.
– theGtknerd
Nov 11 at 17:19
You need to allow the main loop to regain control. See my post here. Or maybe I should say, you need to force Gtk to do it's rendering before you do your main computation.
– theGtknerd
Nov 11 at 17:19
Post a minimal example
– gianmt
Nov 12 at 7:13
Post a minimal example
– gianmt
Nov 12 at 7:13
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245195%2fgtk3-hiding-a-dialog-before-heavy-computation-begins-pygtk%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If you are using Gtk3, you are not using Pygtk. Pygtk is Gtk2. Please update your question.
– theGtknerd
Nov 11 at 17:12
You need to allow the main loop to regain control. See my post here. Or maybe I should say, you need to force Gtk to do it's rendering before you do your main computation.
– theGtknerd
Nov 11 at 17:19
Post a minimal example
– gianmt
Nov 12 at 7:13