I don't completely follow what you're saying. Just that using ->insert will work with escaped braces, and that escaping in the list should work the same? In playing around, what's really weird is if I set something up with braces using the list at initialization, tkx will tell me about the unmatched brace and die. But if it happens during runtime, it just falls thorugh...

It's funny because that's how I had my original Tk using hlist with $hlist->add calls. I didn't think Tkx had a similiar interface...

Thanks. I'm going to use the ->insert.

# here's what I mean, I hacked your example # the trip button adds a third element, which gets dropped # silently. (and you can escape it, and see the escape... use Tkx; $Tkx::TRACE = 64; Tkx::package_require('tile'); my $mw = Tkx::widget->new("."); my $list; my @strings; $strings[0] = 'Hello, this should be ok'; $strings[1] = 'this too'; $list = &make_tcl_list(@strings); # example bug : new_tk__listbox ( $lb = $mw->new_listbox( -height => 5,-listvariable => \$list ) ) ->g_grid( -column => 0, -row => 0, -sticky => "nwes" ); ( $s = $mw->new_ttk__scrollbar( -command => [ $lb, "yview" ], -orient => "vertical" ) )->g_grid( -column => 1, -row => 0, -sticky => "ns" ); $lb->configure( -yscrollcommand => [ $s, "set" ] ); ( $mw->new_ttk__label( -text => "Status message here", -anchor => "w" ) )->g_grid( -column => 0, -row => 1, -sticky => "we" ); ( $mw->new_ttk__sizegrip )->g_grid( -column => 1, -row => 1, -sticky = +> "se" ); $mw->g_grid_columnconfigure( 0, -weight => 1 ); $mw->g_grid_rowconfigure( 0, -weight => 1 ); ## add a button to add an unbalanced brace (my $button = $mw->new_tk__button( -text=>"Trip", -anchor=>'w', -command=> sub { $strings[2] = 'watch this{'; $list=&make_tcl_list(@strings); } ))->g_grid( -column => 0, -row => 1, -sticky => "nwes" ); Tkx::MainLoop(); sub make_tcl_list{ my @LIST = @_; my $listx = ''; for my $i (@LIST) { $listx = $listx . ' {' . $i . '}'; } return $listx; }

In reply to Re^2: TCL list via TKx by gallagher118
in thread TCL list via TKx by gallagher118

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.