What I am trying to do is use the events that are defined in Win32::Gui. In my script I query a list and dump them into a ListView. Once they are in the ListView I want to be able to click on an element in the ListView and have its detail display in a Textfield. In order to do this I need to use the follow event:
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.
sub ResultView_ItemClick(2) {
$Display->results->Text(${$List{2}}{message});
}
However when I use :
my $code = "sub ResultView_ItemClick($count) { $Display->results->Text
+(${$List{$count}}{message});}";
eval $code;
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"
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.