My program allow user to open file, but this opening contains lot of processing and it takes some time. I would like to create and show small frame with gauge while program process data from file.
I wrote small class for gauge (using wxPython demo, it's great btw .)):
and then i tried to create this gauge before calling method which process data. But nothing appears. Then i realized that i need threads maybe and tried something like this: http://wiki.wxpython.org/LongRunningTasks (thread example) but i can't make it works.
So, is there some easy way to do this? Do i need threads? I will appreciate any help, because i'm in hurry.
Thank you in advice.
My program allow user to open file, but this opening contains lot of processing and it takes some time. I would like to create and show small frame with gauge while program process data from file.
I wrote small class for gauge (using wxPython demo, it's great btw .)):
and then i tried to create this gauge before calling method which process data. But nothing appears. Then i realized that i need threads maybe and tried something like this: LongRunningTasks - wxPyWiki (thread example) but i can't make it works.
So, is there some easy way to do this? Do i need threads? I will appreciate any help, because i'm in hurry.
Thank you in advice.
It makes use of wx.Process to first create and show the gauge, and execute the command, then the notify event it sends when the command is completed is handled to destroy the gauge...quite simple overall!
My program allow user to open file, but this opening contains lot of processing and it takes some time. I would like to create and show small frame with gauge while program process data from file.
I wrote small class for gauge (using wxPython demo, it's great btw .)):
So, is there some easy way to do this? Do i need threads?
Maybe. It depends on what your long running task is doing and whether it can be reorganized to be performed in small chunks of if it must be one contiguous process.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!