in reply to Get a Tk Button to align left in a frame

Thanks! That's working for my main application.

Now, when I try your suggestion of using a background color to see this better, I get strange results. When the -fill => 'x' is "on", I get the purple background, as in

my $fA = $mw->Frame( -background => 'purple', )->pack( -side => 'bottom', -fill => 'x', );

But when -fill => 'x' is disabled, as in

my $fA = $mw->Frame( -background => 'purple', )->pack( -side => 'bottom', #-fill => 'x', );

there's not a trace of purple. Is that because the frame is only as big as the button unless you manipulate it via something like -fill?

Replies are listed 'Best First'.
Re^2: Get a Tk Button to align left in a frame
by shmem (Chancellor) on May 07, 2007 at 06:53 UTC
    Is that because the frame is only as big as the button unless you manipulate it via something like -fill?
    Yes. You can see that effect if you also set -highlightbackground and -highlightthickness:
    my $fA = $mw->Frame( -background => 'purple', -highlightbackground => 'maroon', -highlightthickness => '1', )->pack( -side => 'bottom', #-fill => 'x', );

    You will see a maroon border around the button - but that's the border of the frame. If you cycle the elements of that window with <Tab>, you will see that the black line around the button is 2 pixels thick - that is because the frame and the button are highlighted, visible if you add a -highlightcolor to your frame, of if you let it fill in x direction.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}