Re: pass vars to sub via TK/Button

From: Laurent Coudeur (Laurent_Coudeur_at_lionbridge.com)
Date: 12/15/03


Date: Mon, 15 Dec 2003 13:24:08 +0000

not to sure what your problem is so

Here is How I get the variables back

sub test{
my $type=$_[0]; #$rb_val
my $number=$_[2]; #$bonobo
my $path1=$_[1]; #$oracleid
 

(these are string but I use the same process)

Laurent coudeur

Oliver Schaedlich <just_oliver@gmx.net>
15/12/2003 12:41
Please respond to Oliver Schaedlich

 
        To: beginners@perl.org
        cc:
        Subject: Re: pass vars to sub via TK/Button

Greetings,

15.12.2003, Laurent_Coudeur@lionbridge.com wrote:

>$mw->>Button (-text=>"run",
> -command=> sub {test($rb_val,$bonobo,$oracleid)})
> ->place(-x=>320,-y=>>250 ,-width=>75);

thanks for your reply.

I tried to adapt to your example:

$main->Button
    ( -text => 'Add',
      -command => sub { add_item($var1, $var2) }
    ) -> pack;

but the output &add_item delivers looks more like hash references
than the content of aforementioned variables:
 
Added Tk::Entry=HASH(0x1c1956c) Tk::Entry=HASH(0x1c1e3a8)

Is it possible to pass simple variables via Entry/Button in the
first place, and if, how?

Best regards,
oliver.

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>