in reply to Difficulty with Curses

i have updated the starting post to include a runable code as well

Replies are listed 'Best First'.
Re^2: Difficulty with Curses
by stefbv (Priest) on Mar 01, 2011 at 12:29 UTC

    It works, just add a name for the label and call 'draw' on it:

    my $lbl = $w{2}->add( undef, 'Label', -y => -5, -text => "The email you entered is $EMAIL\n" ); $lbl->draw;

    Regards, Stefan

      thanks stefan but one of the problem still persists
      its just that when i change it from perl247@assassin.com to perl@assassin.com it would display something like:
      perl@assassin.com.com

        That happens when the new string is shorter than the old one, and is not entirely overwritten. There is, probably, a way to clear only that part of the screen before updating the label or padding the new string with spaces, but a better approach in my opinion is to use an TextEntry widget with 'readonly' and not 'focusable' attributes instead of a Label:

        ########################## ##### OPTIONS PAGE ##### ########################## my $EMAIL; $w{2}->add( undef, 'Label', -y => -10, -text => "Please add email address here below in the event that the results wil +l be mailed to you(Optional)\n" ); my $temp; my $ent1; $w{2}->add( undef, 'Buttonbox', -y => -7, -buttons => [ { -label => " [EMAIL] ", -value => 1, -onpress => sub { my $cui = shift()->root; $EMAIL = $cui->question("PLEASE ENTER EMAIL:"); if ($EMAIL) { $ent1->text("Address: $EMAIL"); } else { $cui->dialog("Question cancelled."); } }, }, ], ); $ent1 = $w{2}->add( "ent1", "TextEntry", -y => -5, -width => 100, -readonly => 1, -focusable => 0, );

        Regards, Stefan