Here is my dilemma: I have a log parser with a pygtk window. After the user opens a file via the dialog, I have a progress bar showing them approximately when the open will be complete (as it can be a lengthy process). I recently added an option to allow the user to specify a file via the command line.
My problem is, since I have to load the file before calling gtk.main(). Thus, the window and, more importantly, the progress bar are not displayed until after this lengthy load completes, giving the user no indication.
So, I am hoping there is a way to execute a function after calling gtk.main(), or somebody has an alternative approach. Thanks
Rather than beginning the process from the command line as soon as you parse the command line arguments, simply pass the command line argument to your application class (or store in a variable) and process it AFTER you've entered gtk.main. That way you can setup your GUI first. Before beginning the process, and every time you increment the progress bar, make sure you let Gtk catch up using something like:
while Gtk.events_pending():
Gtk.main_iteration()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With