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

Of course, now I've got to work out how to use it... :)

be sure to look at few examples

As a good technique, you can mix pure-Tcl/Tk to create GUI and use perl/Tk syntax during the program for managing it.

Replies are listed 'Best First'.
Re^10: Tk:Photo -data with binary data?
by BrowserUk (Patriarch) on Dec 03, 2006 at 09:05 UTC

    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.
      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.