Hello ,
I want to implement a subroutine which return caller's text value (caller
maybe a Label control, Button control...etc)
the following is the code :
$W1->AddLabel(
-name => "Label1",
-text => "label 1",
-notify => 1,
-font => $font,
-pos => [ 50, 50 ],
-onClick =>\&show_text,
);
$W1->AddLabel(
-name => "Label2",
-text => "label2",
-notify => 1,
-font => $font,
-pos => [ 50, 50 ],
-onClick =>\&show_text,
);
$W1->AddButton(
-name => "Button1",
-text => "button1",
-notify => 1,
-font => $font,
-pos => [ 50, 50 ],
-onClick =>\&show_text,
);
sub show_text {
#print the caller object's text value. Print "button1" if Button1 is
clicked, "label 1" if Label1 is clicked..etc
}
How should I implement the show_text subroutine?
thanks for any reply
--
View this message in context: http://www.nabble.com/return-the-text-of-an-object-tf4625127.html#a13208401
Sent from the perl-win32-gui-users mailing list archive at Nabble.com.
|