http://qs1969.pair.com?node_id=72286


in reply to Tk on Win32

I tried running it on ActiveState build 618, and got the same results as you-nothing. So I decided to try it from the command line with -w for warnings, and got:

C:\WINDOWS\Desktop> perl -w tk1.pl
Useless use of a constant in void context at tk1.pl line 5.
Use of uninitialized value in concatenation (.) at C:/Perl/site/lib/Tk.pm line 350.
Use of uninitialized value in concatenation (.) at C:/Perl/site/lib/Tk.pm line 350.

Line 5 was the line you have as "Mainloop;" -when I changed this to "MainLoop();", it worked for me. Trying "-w" gave only:

C:\WINDOWS\Desktop> perl -w tk1.pl
Use of uninitialized value in concatenation (.) at C:/Perl/site/lib/Tk.pm line 350.
Use of uninitialized value in concatenation (.) at C:/Perl/site/lib/Tk.pm line 350.

I did get the button you intended, then.

Replies are listed 'Best First'.
Re: Re: Tk on Win32
by Chmrr (Vicar) on Apr 13, 2001 at 06:55 UTC

    A side note -- those warnings of undefined values are Tk looking for a HOME environment variable. Either go in and tweak the source on those lines to make it happy, or set the HOME variable yourself.

     
    perl -e 'print "I love $^X$\"$]!$/"#$&V"+@( NO CARRIER'

      Here's my win95/winME "tweak" (i copy/pasted the whole subroutine that i munged). PS if you don't have multiple logins under win95/ME just change the else{$Home=... to $Home="C:/My Documents", on NT/2000 i'm not to sure...havn't messed with pTK on my NT box yet.

      sub TranslateFileName { local $_ = shift; unless (defined $Home) { unless ($^O eq 'MSWin32'){ $Home = $ENV{'HOME'} || ($ENV{'HOMEDRIVE'}.$ENV{'HOMEPATH'}); } else { $Home = "c:/windows/profiles/" . getlogin() . "/My Documents +"; } $Home =~ s#\\#/#g; $Home .= '/' unless $Home =~ m#/$#; } s#~/#$Home#g; # warn $_; return $_; }

      _________________
      madams@scc.net
      (__) (\/) /-------\/ / | 666 || * ||----||