?!?! I must not be expressing myself well.

These examples are all good... but a basic point is being missed. In these examples, the AddItem sub{} is controlling when the 'Working' message window is to be destroyed. The real problem is that the... 'activity'... that's going on that needs to be monitored is running *outside* of the context of the current process. This means the 'mainline' Perl/Tk program doesn't know when the 'activity' is terminated.

As I understand it, when MainLoop is called, everything is basically 'sitting still' until (in this case) a 'button press event' happens. When that event comes from the 'Pop It!' button, the AddItem sub{} is called, which creates a new window that shows a 'Working' message. Effectively at the same time, a new process is spawned... and everything in the current process goes back to 'sleep', until another event occurs.

The 'full and complete' way to do what I want would be to use Win32::Process::Create(...$cmd...) and set-up something with signals... and when the spawned process terminates, if would issue a signal to its parent process -- that would be the 'event' that is trapped and the 'Working' message window would be destroyed.

...but I'm trying to shortcut all that work somehow (I don't even know if such a thing is possible, although I would expect it would be)... and I'm not sure how to do it. In 'normal' (non-event-driven programming), simply including 'system($cmd)' in the code would mean the main program would pause, the system() task would complete and control would be returned to the main program again... but this doesn't happen here.

Perhaps the simplest way is to forget about spawning another process and just include the code from the command -line version I have into the Tk version -- Ugh. More maintenance dramas...

John


In reply to Re^2: How to PopUp a 'Status' window in Perl/Tk by ozboomer
in thread How to PopUp a 'Status' window in Perl/Tk by ozboomer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.