Drop the () after Text and just see. I'm sorry, but it works fine for
me :(
Cheers!
Aaron :)
Sundar Raman wrote:
>
> put returned values from any controls in an "external" context (don't know the
> jargon any better, sorry :( ), as below:
> print "Hello, ", $textField->Text(), ", how are you?\n";
> Otherwise perl seems to return the value of the reference (ie, it does not call
> the method within the reference).
>
> Actually, I'm not even sure that you can call a method inside a quoted string!
> i mean, the result's that you get when you put all of the above into a string
> indicates that perl only evaluates the '$textField' portion, and provides the
> '->Text' piece unaltered.
>
> Sorry this is a half-ass explanation, but i'd like to hear something more
> definitive from those that have a better understanding of perl's interpretation
> in different contexts.
>
> HTH.
>
> "Jeremy K. Truax" <[EMAIL PROTECTED]> on 02/14/99 06:05:40 PM
>
> Please respond to [EMAIL PROTECTED]
>
> To: [EMAIL PROTECTED]
> cc: (Sundar Raman/MW/US/3Com)
> Subject: Re: [perl-win32-gui] Working with Values....HELP!
>
> I tried that and it doesn't seem to work. It prints "$textField->Text" as:
>
> Win32::GUI::DialogBox=HASH(0x650b2c)->Text
>
> Aaron Dalton wrote:
>
> > Use the Text property...like so:
> >
> > my $textField = $window->AddTextField(
> > -name => 'password',
> > -left => 3,
> > -top => 5,
> > );
> >
> > if ($textField->Text eq $storedPassword)
> > {}
> >
> > "Jeremy K. Truax" wrote:
> > >
> > > Ok I'm fairly new to Perl and its Win32 Module. I am trying to do
> > > something simple like get a value off of the input from the user. So I
> > > made a textfield in which they type in say their name....then I cannot
> > > get the value to the point where I can actually use it.
> > >
> > > For example:
> > >
> > > # here the dialog box object is created
> > >
> > > $myDialogBox = new Win32::GUI::DialogBox(
> > > -name => "DialogBox",
> > > -title => "DialogBox",
> > > -top => 150,
> > > -left => 170,
> > > -width => 300,
> > > -height => 150,
> > > -visible => 1);
> > >
> > > # here I add the text field to type into
> > >
> > > $myDialogBox->AddTextfield(
> > > -name => "TextField",
> > > -password => 0,
> > > -top => 40,
> > > -left => 70,
> > > -width => 90,
> > > -height => 20,
> > > -visible => 1);
> > >
> > > # here is the button which they click when done typing
> > >
> > > $myDialogBox->AddButton(
> > > -name => "MyButton",
> > > -text => "OK",
> > > -top => 60,
> > > -left => 70,
> > > -visible => 1);
> > >
> > > # and here is what happens when they do click the button.
> > >
> > > sub MyButton_Click {
> > > print "Hello $myDialogBox::TextField\n";
> > > }
> > >
> > > the last part is what I'm having trouble with. $myDialogBox::TextField
> > > doesn't seem the correct way to express the value of the text field.
> > > What do I use for this?
> > > In JavaScript the value is expressed like:
> > > "myDialogBox.TextField.value". But I don't know how to do that here.
> > >
> > > Please, let me know if you can help me....thanks.
> > >
> > > --
> > > Jeremy K. Truax
> > > [EMAIL PROTECTED]
> > > http://start.at/trupoetry
> > > =========================
> > > TruPoet's Romantic Love Poetry Yahoo! Club
> > > http://clubs.yahoo.com/clubs/trupoetsromanticlovepoetry
> > > ----------------------------
> > > A belief is just an idea a person possesses; it's an idea that possesses
> > > a person.
> >
> > --
> > -----BEGIN GEEK CODE BLOCK-----
> > Version: 3.1
> > GCS/IT d+ s+:+>: a->? C+++ ULC>+++ P++++$ L>+++ E-
> > W++$ N++(+) o>+ K++ w-- O@ M-- V PS-- PE++ Y+ PGP+
> > t+ 5+++ X+(++) R tv+ b+++ DI++(+++) D++ G e>+++
> > h+>---- r y-
> > ------END GEEK CODE BLOCK------
>
> --
> Jeremy K. Truax
> [EMAIL PROTECTED]
> http://start.at/trupoetry
> =========================
> TruPoet's Romantic Love Poetry Yahoo! Club
> http://clubs.yahoo.com/clubs/trupoetsromanticlovepoetry
> ----------------------------
> A belief is just an idea a person possesses; it's an idea that possesses a
> person.
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d+ s+:+>: a->? C+++ ULC>+++ P++++$ L>+++ E-
W++$ N++(+) o>+ K++ w-- O@ M-- V PS-- PE++ Y+ PGP+
t+ 5+++ X+(++) R tv+ b+++ DI++(+++) D++ G e>+++
h+>---- r y-
------END GEEK CODE BLOCK------