Hi all!

I'm writing a Perl/Gtk program that basically works this way:

  • 1. The user clicks a "Get" button
  • 2. An external pogram is launched that (hopefully) writes a text file in /tmp
  • 3. The textfile is displayed in a textbox

    This is working perfectly. What I want to do now is to add a statusbar that says "Please select an option" when the program is launched and changes to "Please wait..." when the "Get" button is clicked. My current problem is that the "Please wait..." message isn't displayed until the wait is over. :-(

    Part of the code looks like:

    $statusbar = new Gtk::Statusbar(); $vbox->pack_start( $statusbar, $true, $true, 0 ); $statusbar->push( $context_id, "Please select an option" ); $statusbar->show();
    and the callback for the clicked button:
    sub GetButtonClicked { my $infostring = "Please wait..."; $statusbar->push( $context_id, $infostring); $statusbar->show(); ContactFromDevice(); LoadFileToText(); }
    Very grateful for some help.

    In reply to Statusbar in Perl/Gtk by ciryon

    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.