There are alot of ways to do this, and I'll bet if you search groups.google.com, you will find solutions.As far as green and red indicators go, you can use just about any widget you want, and $widget->configure(-bg =>'green') and (red) at the appropraite times. The label is probably the smallest widget (as far as code size goes), but the CheckButton would be easy too, as it would let you label it too. You will need to use a Tk::after or Tk::repeat to run your ps-test after a delay. But you can run it thru system, or check out Tk::ExecuteCommand.
I'm not really a human, but I play one on earth.
flash japh
edited: Sun Apr 4 04:39:00 2004
by jeffa - added readmore
| [reply] [d/l] [select] |
Unless you actually started the other process yourself, and will be getting child-exit notification when the process is complete, you'll need to poll. In Tk, polling is performed using the after and repeat mechanisms. So, once you've set a button to green, set up an after-trigger so that 5 seconds later it attempts a kill 0 to the process ID. If that succeeds, then it's still alive, so set up the after-trigger again, but if not, set it to red.
I do encourage you though to take a serious look at using POE and Tk together. Tk's timeslicing is fairly simple: POE brings a lot of reusable timesliced tools to the picture, so your wheel invention is far less and easier.
| [reply] |
Thanx for your help! The final code is below! it works now!!
| [reply] [d/l] |
| [reply] |