develooper Front page | perl.tcltk | Postings from September 2011

Re: dateentry and calendar widgets

Thread Previous | Thread Next
From:
Jeff Hobbs
Date:
September 28, 2011 13:59
Subject:
Re: dateentry and calendar widgets
Message ID:
4E838A3D.1090301@activestate.com
On 28/09/2011 1:16 PM, gary sachs wrote:
> Trying to use the dateentry widget...
>
>      Tkx::package_require("widget::dateentry");<<<<<  line 710
...
> If I try and execute I get the following error...
>
> can't read "argv0": no such variable at c:\qa\tobserver.pl line 710.
>
> I looked fro the dateentry widget and do see v0.93 in the tkkit.dll.
>
> If I comment out line 710, then all runs just fine.

Interesting - it seems that embedding into the Perl environment causes 
Tcl to skip the init parts that would otherwise set ::argv0 (Perl 
$ARGV[0]).  The dateentry.tcl script has some test code at the end that 
checks to see if you are running itself as the main script to show some 
demo usage.

I would say the best work-around is to do

Tkx::set('::argv0', $ARGV[0] || ""); # work-around for dateentry usage 
of argv0

and that should get around it without effecting real operation.  I'll 
fix up dateentry.tcl so that in the future it will do it's own var 
existence check of argv0 for such embedded use cases.

Regards,

Jeff

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About