Fellow Monks,
I'm still working on some perl-gtk programm and have come thru many of the problems with the standard perl-gtk tutorial and the source code of CSCMail.

Right now I got two questions burning:

  1. What other useful ressources are there to get knowledge from (like good programms' source or API description (not the PDF file from the GtkPerl website)
  2. (This is my main question)
    When I'm in the main loop of Gtk I can't do anything else.
At least I don't know any way to do anything there.
I figured out how to (e.g.) update a label showing the time from other sourcecode as:
while (1) { while (Gtk->events_pending) { Gtk->main_iteration; } $time = strftime("%H:%M:%S",localtime()); $time_label->set($time); }
But this uses up all the CPU time available. An additional
sleep(1)
within the while()-loop makes the whole programm respond very slowly.

So, since I need not only to update the time label but also have to check a file for a change since my last visit (and maybe I'll have to add more actions later)
I ask you, my Fellow Monks:

What else can I do??

Regards Stefan K

Edited 2001-04-09 by mirod: added </ol> tag


In reply to Actions During Main Gtk Loop by stefan k

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.