Prima::Edit and a delayed loop

From: lanas <lanas_at_securenet.net>
Date: Sat, 12 Nov 2005 11:00:18 -0500
To: prima_at_prima.eu.org

Hello,

  I'm detecting the presence of a IDE USB hard drive. To do that I
enter a loop that will, for 10 seconds maximum, do some grepping on
dmesg to see if the right device appears and if so, what device name it
has.

  So, just before entering this function (loop), I send a message to
Prima::Edit to tell the user that scanning has begun. At the end of
the scan, the name of device is shown or "Not found".

  Thing is, the first message only gets to the user with the result
message at the end of the loop.

  The loop containes a 1-second pause between each iteration (sleep 1).

  In short, just doing the following will delay the appearance of a
message in Prima::Edit:

    $form->MsgGroup->MessageBox->insert_text("Hello\n");
    $form->MsgGroup->MessageBox->cursor_down;
    sleep 3;

  Is there a way to circumvent this ? Should a sleep-loop contain some
kind of 'yield' instruction to give time to Prima::Edit to show the
first string ? Or does Prima gives a similar function like sleep that
could be used to delay a loop ?

Best reagrds,

Al
Received on Sat 12 Nov 2005 - 16:59:30 CET

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:06 CET