in reply to Dynamic Subroutines?
ItemClick(ITEM) Sent when the user selects an item in the ListView; ITEM specifies the zero-based index of the selected item.
so in order to get the desired results I have to create a subroutine for every item in my ListView. When I code it up statically it works.
However when I use :sub ResultView_ItemClick(2) { $Display->results->Text(${$List{2}}{message}); }
when I am building my list whenever I click on an element I generate an error. When I run the code it seems that the GUI::Dialog reconizes that I created the subs but it throws an error "Undefined subroutine &main::ResultView_ItemClick"my $code = "sub ResultView_ItemClick($count) { $Display->results->Text +(${$List{$count}}{message});}"; eval $code;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Dynamic Subroutines?
by suaveant (Parson) on Mar 30, 2001 at 21:46 UTC |