Usually you do not go to such a low level of programming when using Tcl::Tk.

Normally, you use perlTk syntax, while using *all* features of all requested package (Tix, or any other)

On the other side, looks like tie-ing hashes does not currently fully implemented. Probably because it is rarely needed to do such kind of mapping.

I assume this lacking method you found will be fixed within next version of Tcl module, meanwhile you can enter to Tcl::Var package (within Tcl.pm):

sub CLEAR { my $obj = shift; die "STORE Usage: objdata @{$obj} $#{$obj}, not 2 or 3 (@_)" unless @{$obj} == 2 || @{$obj} == 3; my ($interp, $varname, $flags) = @$obj; $interp->Eval("array set $varname {}"); }
But you'll probably need more hash methods afterwards (FIRSTKEY for example).

PS. Also all we keep in mind, that Tcl's array is not an array in Perl's terminology, its a hash.

Best regards,
Courage, the Cowardly Dog


In reply to Re: Tcl::Tk - Tie Hash to Tcl Array and assign hash by Courage
in thread Tcl::Tk - Tie Hash to Tcl Array and assign hash by Ardemus

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.