Update 2019-02-26: disregard my hypothesis below; I've since figured out what the issue was and addressed it in Tcl::pTk 0.95. See my newer reply.

Howdy, I was recently added as a co-maintainer of Tcl::pTk, so I wish I had come across this question earlier.

Indeed this sounds like part of the program is trying to use Tk but Tcl::pTk::TkHijack isn't loaded. Having Tcl::pTk installed does not make Perl/Tk programs automatically use it. To summarize what's documented, using Tcl::pTk with an existing program requires (from most to least effort) either:

  1. substituting all mentions of Tk with Tcl::pTk, i.e. use Tk; with use Tcl::pTk;, any Tk::package or Tk->thing with Tcl::pTk::package or Tcl::pTk->thing, etc.;
  2. putting use Tcl::pTk::TkHijack; (BEFORE any existing use Tk;) at the top of the program's main script;
  3. running the program's script using the -MTcl::pTk::TkHijack command-line parameter, i.e. perl -MTcl::pTk::TkHijack my_tk_program.pl.

I find the command line parameter approach the easiest for testing an entire program without changing any code; that way I can still run it with Perl/Tk for comparison or when something breaks under Tcl::pTk. The use Tcl::pTk::TkHijack; approach has the same effect, and just that line will need to be commented out to go back to Perl/Tk. Then, for programs "ready" to be run only with Tcl::pTk (i.e. Tcl::pTk doesn't break for your program) and you don't want to use Perl/Tk anymore, then the first approach might work better.

PS: I put out a new version of Tcl::pTk recently (0.93), though there isn't any changes that would affect this findINC issue. I also added Tcl::pTk to MacPorts, which uses Tcl/Tk 8.6.8. Note that macOS comes with an older version of Tcl/Tk (8.5.9 in macOS 10.13); some improvements for macOS aqua have since been added in e.g. 8.6.8.


In reply to Re^4: Tcl::pTk Can't locate object method "findINC" via package "Tk" by chrstphrchvz
in thread Tcl::pTk Can't locate object method "findINC" via package "Tk" by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.