I now see how starting the tutorial with examples using literal path names like this makes things really confusing as the Tk widgets are really Tcl commands themselves and there is no easy mapping in the Tkx:: namespace to functions that use "." their name. When you in Tcl would say:

.app.date.day configure -values {1 2 3 ... 28}

then the literal translation into Tkx would be:

Tkx::.app.date.day_configure(-values => [1..28]);

but this does not work since you can't use "." in identifiers in Perl. One way to fix this is to quote the function name and write:

&{"Tkx::.app.date.day_configure"}(-values => [1..28]);

which will work, but is just beyond ugly.

The only sane way to work with widgets in Tkx is to create Tkx::widget objects, making you code:

my $day = $date->new_ttk__combox( -values => \@days, -textvariable => \$d, ); Tkx::grid($day, ....); @days = (1 .. 28); $day->configure(-values => \@days);

I'll try to add some text to the Tkx docs to make this clearer.


In reply to Re: Tkx - configure ttk::combobox by gisle
in thread Tkx - configure ttk::combobox by ussuriysk

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.