[EMAIL PROTECTED] wrote:
>Hello all,
>
>I have a textfield on my window.   I am trying to use the Change event 
>to capture the character that is being entered.     Here's the snippet:
>
>sub txtStatus_Change {
>     print "$_";
>}
>
>When I enter a character in the textfield, nothing is being displayed 
>in the DOS window.     What am I doing wrong?    

the Change event passes no input to the sub (and anyway it would not be
passed in $_, @_ is used for that...).
you can't grab the single character being entered, only the changed
whole text:

sub txtStatus_Change {
    print $Window->txtStatus->Text();
}

>What I want to do, eventually, is that when a user enters a character 
>I want to automatically change that letter to uppercase.

create your Textfield with the: -uppercase => 1 option (introduced in 
build 340, not yet documented, sorry :-).
these are the undocumented option for Textfields (and RichEdits):
    -uppercase => 0/1
    -lowercase => 0/1
    -number => 0/1         # textfield accepts only digits
    -autohscroll => 0/1
    -autovscroll => 0/1

__END__
# Aldo Calpini
print sort {$_{$a} cmp $_{$b}} values %{{split undef, 
"xritajbugne fahokem csuctawer jhdtlrnpqloevkshpr"}};




Reply via email to