|
From: Kieren D. <Kie...@ha...> - 2008-12-09 16:40:04
|
Hi All
I have tried to use a combobox to do something, but I have had two
problems.
1. I don't know what events are triggered if I type into the text box.
It doesn't trigger obvious possibilities such as KeyUp, so I don't know
what to look for.
2. If I trigger the Change trigger, box->Text contains the previous
selection rather than the current one. How can I find
out what the user has selected this time?
I experienced this problem with ActiveState Perl 5.8.8 and Win32::GUI
version 1.0.6. The source I used is as below. Could someone please
suggest what I should do?
Thank you.
Kieron
-start-
my $x = Win32'GUI'Window->new('-size', [100, 100], '-pos', [0,0],
'-visible', 1);
my $y = $x->AddCombobox('-pos', [10, 10], '-size', [50, 200],
'-dropdown', 1);
$y->Add(1, 2);
$y->Select(0);
my $change = sub() {print $y->Text."\n"};
$y->Change('-onChange', $change);
$y->Change('-onKeyUp', $change);
Win32'GUI'Dialog;
-end-
|