in reply to Re^9: Tk:Photo -data with binary data?
in thread Tk:Photo -data with binary data?

I spoke to soon.

I feel like that little kid at Christmas that just unwrapped a huge present and discovered that he'd got the super wizz-bang, all singing and dancing, latest greatest supertoy. Ripped open the packaging. Labouriously followed the assembly instructions. Assembled all the pieces and stuck on all the decals. Digested the operations manual. Before dicovering that my huge, new, shiny, toy is destined to sit there--inert--because "No batteries supplied"!

Three days and nearly 100 MB of downloads later. I've read the wiki, the tcl tutorial, an online book and dog knows how many other links and references, and still, despite all the installations going cleanly, and all the tests having been passed, and the demo widgets working, Tcl/Tk does not.

Having solved myriad previous problems, I've given up on solving

Can't find a usable init.tcl in the following directories: c:/Perl/site/lib/auto/lib/tcl8.4 c:/perl/lib/tcl8.4 c:/lib/tcl8.4 c:/perl/library c:/library c:/tcl8.4.14/library

Which is unsurprising really given that none (not one. Not a single one!) of these directories actually exist. So why is it looking for in those directories for this file, which does exist in 3 other places that do exist? Where does this list come from?

A C:\tcl\lib\bwidget1.8\init.tcl A C:\tcl\lib\tcl8.4\init.tcl A C:\tcl\vtcl-1.6.0\lib\bwidget\init.tcl

So, try a different route. Maybe a pure tcl script will solve my problem? But this doesn't work either:

#!/usr/bin/wish set fdata [read [open "/test/colorcube.png"]] label .l1 -image [image create photo -format png -data $fdata] pack .l1

complaining that "Image format png is not supported" despite that demos/Img/demo.tcl clearly shows it is.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^11: Tk:Photo -data with binary data?
by vkon (Curate) on Jun 07, 2007 at 22:17 UTC
    sorry for really long delay,
    you gave up, or may be I can help you with Tcl/Tk?
    BTW you'll certainly get help on related mailing list, tcltk at perl.org
    Have a nice day!

      Since I never got around to removing tcl, I grabbed Tcl/Tk v0.97 and attempted to install it. The build went clean, but it fails the tests for the same reason as above: it is looking in all the wrong places for init.tcl. Here is a typical failure message:

      t\after.........Can't find a usable init.tcl in the following director +ies: C:/Perl/site/lib/auto/lib/tcl8.4 C:/Perl/lib/tcl8.4 C:/lib/tcl8.4 C:/Perl/library C:/library C:/tcl8.4.14/library

      And here is a list of places where an init.tcl currently exists on my system:

      C:\>attrib /s init.tcl A C:\erl5.4.4\lib\gs-1.5.4\priv\tcl\lib\tcl8.3\init.tcl A C:\Mozart\platform\win32-i486\wish\tcl\init.tcl A *C:\Perl\site\lib\auto\Tcl\init.tcl A C:\ruby\lib\tcl8.3\init.tcl A C:\Tcl\lib\bwidget1.8\init.tcl A C:\Tcl\lib\tcl8.4\init.tcl A C:\Tcl\vtcl-1.6.0\lib\bwidget\init.tcl

      The one I've asterixed (*) above looks to be where it should be looking? If there is some simple way of pursuading it to look there that I have missed, please enlighten me.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        I afraid - you need to remove asterixed file...
        or more precisely, are there more tcl files there? may be you need to remove that Tcl/Tk?

        I am not happy with init.tcl searching algorithm either, and it seems to fall into wrong way in your particular case

        init.tcl is searched relative to tcl84.dll, which is loaded when Tcl.dll loaded, so, you should find right exact Tcl/Tk installation first

        BTW ActivePerl 5.8.8+ comes with Tcl/Tk correctly bundled, there's some magic file tkkit.dll within it.
        This is another approach, but you must be careful to not mix different installations.

        returning to your 1/2 year ago attempt on pure tcl/tk attempt - "Image format png is not supported" - you just need

        package require Img
        or in Tcl::Tk style -
        $int->packageRequire('Img');

        ... and don't hesitate using support list tcltk at perl.org

        Best regards,
        vkon