Re: bind callbacks with arguments

Ala Qumsieh <[email protected]>
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
--- [email protected] wrote:

> Sorry to beat this to death, but I do have a
> solution to resizing 
> widgets by using GeometryRequest. Right now a
> fundamental problem has 
> cropped up with the callback in the bind definition.
>  For some reason 
> when I shift the parameters to the variable $parm,
> $parm becomes the 
> HASH for the actual Text widget and not the value 0
> or 1 as I believe I 
> have defined it.  Please run this scripts and double
> click one of the 
> text widgets and review the print output.  I really
> dont know how this 
> is possible.  

It is a by-product of how Perl/Tk glue logic evaluates
callbacks. In this case, there are two arguments
passed to resize:

   $tw (or $bw), 0 (or 1)

one fix:

> sub resize () {
>         my $parm=shift;

  my $parm = pop;

--Ala



	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.