in reply to Re^3: Difficulty with Curses
in thread Difficulty with Curses
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
|
|---|