in reply to Tk grid in a Frame => freeze

Here is a working grid example
#!/usr/bin/perl -- use warnings; use strict; use Tk; my $mw = tkinit; my $topframe = $mw->Frame(-bg=>'yellow')->grid( -row => 2, -column => +2 ); $topframe->Button( -text => "But 0 0")->grid( -row => 0, -column => 0 +); $topframe->Button( -text => "But 1 1")->grid( -row => 1, -column => 1 +); my $other = $topframe->Frame(-bg=>'red')->grid( -row => 2, -column => +0 ); $other->Button( -text => "Oth 0 0")->grid( -row => 0, -column => 0 ); $other->Button( -text => "Oth 1 1")->grid( -row => 1, -column => 1 ); $other->Button( -text => "Oth 2 0")->grid( -row => 2, -column => 0 ); $mw->MainLoop;

Replies are listed 'Best First'.
Re^2: Tk grid in a Frame => freeze
by leonardo-vittorio (Initiate) on Jul 01, 2009 at 14:02 UTC
    hi Anonymous,
    thanks for Your example.
    In the mean time I found another atomic change to make my original code run without freeze:
    removing the frames label:
    ... my $fr = $mw->Frame; ...

    Using pack instead of grid the labelled frame works as expected. Is there any (documented) relationship between a frames label attribute and the used layout manager ?
      Hi,

      I don't know if it is documented. The Frames 'Label' gets packed itself and you can not use two managers for the same Widget.

      Christoph