in reply to Re: Problem with Tk::Repeat
in thread Problem with Tk::Repeat

Thank you all for helping me this is a better way
but one question :
how can I make the listbox bigger? because they are to small right now

thanks

Replies are listed 'Best First'.
Re^3: Problem with Tk::Repeat
by TGI (Parson) on May 06, 2008 at 23:49 UTC

    You can adjust the size of the listbox by configuring its -height and -width.

    You can also allow the geometry manager to control a widget's size. For pack, you set -fill and -expand options when you pack the widget. For grid, you set the -sticky option to cause the widget to grow to fill the grid cell. You can also use gridRowconfigure and gridColumnconfigure with the -weight option to make a row/column expand as a window is resized.

    Here's a snippet you can paste in to replace line 38 of the code above:

    $box1->grid( $box2, -sticky => 'ns' ); $mw->gridRowconfigure(2, -weight => 1 );

    It's worth the time to really dig into and understand the pack and grid geometry managers. I've played with the other managers, but have never needed anything else for a real project.


    TGI says moo

Re^3: Problem with Tk::Repeat
by zentara (Cardinal) on May 07, 2008 at 13:56 UTC
    Thats why pack is the preferred geometry manager. You can use
    my $lb=$mw->Scrolled('Listbox')->pack(-fill=>'both', -expand=>1);
    and the listbox will grow in size to fill as much space as it can. It will auto-adjust size too, if you resize the window.

    Learning to use pack is definitely worth the time..... it takes a Saturday afternoon of time to get used to it's behavior, but it saves time and headaches in the long run. Grid has a more complex method called "weight".... but I always use pack.


    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      I kinda understand the line but where should I put it in my program ??
        I hace try both Ideas on making the listbox bigger but just can't do it can someone explain way?