in reply to Re^2: Difficulty with Curses
in thread Difficulty with Curses

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

Replies are listed 'Best First'.
Re^4: Difficulty with Curses
by stefbv (Priest) on Mar 07, 2011 at 10:04 UTC

    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