in reply to creating simple GUI

MainLoop doesn't exit until you close the top level window widget. However the code that is executed from MainLoop can call $main->update (); to get the GUI refreshed. That is more likely what you want to do in any case if you are reporting progress.


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^2: creating simple GUI
by Anonymous Monk on Oct 31, 2005 at 03:47 UTC
    Thnx for the reply GrandFather.... suppose I have this in my code:
    use Tk; my $main=new MainWindow; $main->title("Test window"); <I print a message "msg" in the window at this line>; MainLoop;
    Now how do I add another message to the window.. ? My requirement is.. I should update the window after the MainLoop statement. Just let me know how exactly to use UPDATE()??

      I don't know how you show your message, but the code below updates the title bar of the main window to "show progress"

      use warnings; use strict; use Tk; my $main= MainWindow->new (-title => "Test window"); $main->update (); sleep (2); $main->title ("Message"); $main->update (); sleep (2); $main->title ("Startup done"); MainLoop;

      Perl is Huffman encoded by design.