Hello Perlmonks,

I would like to have a resizable listbox in Tkx, but I cannot get it working.
The problem is that the button resizes, not the listbox. If I remove the button, the listbox resizes.
What needs to be done to resize the listbox in the vertical direction?
//careful configure was the answer//
Thank you all
#!/opt/ActivePerl-5.10/bin/perl use Tkx; $Tkx::TRACE = 64; Tkx::package_require('tile'); my $mw = Tkx::widget->new("."); my $f = $mw->new_ttk__labelframe( -text => "frame", -labelanchor => 'nw' ); my $b = $f->new_ttk__button( -text => "button", ); my $l = $f->new_tk__listbox( -height => 5, -width => 20 ); my $lv = $f->new_ttk__scrollbar( -command => [ $l, "yview" ], -orient => "vertical" ); my $lh = $f->new_ttk__scrollbar( -command => [ $l, "xview" ], -orient => "horizontal" ); $l->configure( -yscrollcommand => [ $lv, "set" ] ); $l->configure( -xscrollcommand => [ $lh, "set" ] ); $f->g_grid( -row => 0, -column => 0, -rowspan => 2, -columnspan => 2, -sticky => 'nsew' ); $f->g_grid_columnconfigure( 0, -weight => 1 ); $f->g_grid_rowconfigure( 1, -weight => 1 ); $b->g_grid( -row => 0, -column => 0, -sticky => 'ew' ); $b->g_grid_columnconfigure( 0, -weight => 1 ); $l->g_grid( -row => 1, -column => 0, -sticky => 'nsew' ); $l->g_grid_columnconfigure( 0, -weight => 1 ); $l->g_grid_rowconfigure( 1, -weight => 1 ); $lv->g_grid( -row => 1, -column => 1, -sticky => 'ns' ); $lv->g_grid_rowconfigure( 1, -weight => 1 ); $lh->g_grid( -row => 2, -column => 0, -sticky => 'ew' ); $mw->g_grid_columnconfigure( 0, -weight => 1, -minsize => 20 ); $mw->g_grid_rowconfigure( 0, -weight => 1, -minsize => 20 ); for (my $i=0; $i<10; $i++) { $l->insert("end", "$i: this is a very long line $i of 10"); } Tkx::MainLoop();

In reply to resizable listbox in Tkx? [solved] by momo33

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.