Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Want Tk to fully display 4x6 widget w/ grid instead of collapsing it

by Rich36 (Chaplain)
on Oct 24, 2002 at 21:45 UTC ( #207859=note: print w/replies, xml ) Need Help??


in reply to Want Tk to fully display 4x6 widget w/ grid instead of collapsing it

Have you tried explicitly setting the -width and -height properties of the widgets? If the widgets are of a consistent size, then that should do the trick.


«Rich36»

Replies are listed 'Best First'.
Re: Want Tk to fully display 4x6 widget w/ grid instead of collapsing it
by ff (Hermit) on Oct 25, 2002 at 03:06 UTC
    Unfortunately, (or fortunately :-) the widgets are not of consistent size and so -width does not look like it will be useful within -grid. (One other twist is that I have 'styles' of layout, such that the button's appearance varies from style to style.)

    I do see that in configuring button $Output_b (and to handle multiple styles) I can do:

    -height => $style eq 'workstation' ? 6 : 3, # style eq something else...

    but now every other button on the same row as $Output_b has a minimum height of 3 text-rows (oops) and instead of fooling around with $Output_b's options I want to target all my adjustments within the -grid sections. I suppose I could throw in extra button configures as necessary within my -grid/style statement blocks, but ideally I shouldn't be distracted with altering other buttons as I configure the $Output_b button.

    Instead I have gone ahead with configuring dummy cells (blank Label widgits) within the 'style' that needs it, i.e.:

    my $cell_of_spaces = ' ' x 12; ## I've already set up the $Option_b button and am in the ## midst of configuring a "workstation" style/layout $Output_b->grid( -column => 5, -row => 9, -columnspan => 4, -rowspan => 6, -sticky => 'nsew', ); my $space_cell_col = 9; # column 9 already acted as a separator between two big # buttons, so no problem putting blank Labels here. foreach my $space_cell_row (9 .. 14) { build_blank_cell( $tl, $cell_of_spaces, $space_cell_col, $space_cell_row, ); } # Now that there are cells on each row between 9 and 14, # the $Output_b button's rowspan option takes full effect. sub build_blank_cell { my ( $tl, $cell_of_spaces, $space_cell_col, $space_cell_row ) = @_; my $new_label_widget_l = $tl->Label( -textvariable => \$cell_of_spaces, )->grid( -column => $space_cell_col, -row => $space_cell_row, -sticky => 'nsew', ); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://207859]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2021-04-12 05:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?