tags:

views:

90

answers:

2

Before you ask, "Why are you using that old version of Perl?", it is out of my hands. I have to use the tools available to me for this project. My question is does anyone know if it is possible, and if so what the syntax looks like to use gridRowconfigure as follows:

$main_window->gridRowconfigure(1, -weight => 1, -minsize => 171, -pad => 0);

in, Perl 5.004, Tk 400. Thanks.

A: 

If that means Tk 4.0, I guess you can't. Grid was added in Tk 4.1.

If Grid is present, rowconfigure should be since it was there from the start. What problem/error do you get when you try what you wrote above?

Hugge
In Tk.pm it says $Tk::VERSION = '400.202'. I'm not sure what version that equates to. However, I know grid works because I've used it on several other small projects, gridrowconfigure is what the question is concerning. gridrowconfigure, from past experience, allows you control window and grid resize behavior.
Akers
+2  A: 

Since you are using Tk-400.202, it appears that 'perldoc Tk::grid' should tell you what you need to know. You will probably need to read some other documentation, but:

$master->gridRowconfigure(index?, -option=>value, ...?)

Query or set the row properties of the index row of the geometry master, $master. The valid options are -minsize, -weight and -pad. If one or more options are provided, then index may be given as a list of row indeces [sic] to which the configuration options will operate on. The -minsize option sets the minimum size, in screen units, that will be permitted for this row. The -weight option (an integer value) sets the relative weight for apportioning any extra spaces among rows. A weight of zero (0) indicates the row will not deviate from its requested size. A row whose weight is two will grow at twice the rate as a row of weight one when extra space is allocated to the layout. The -uniform option, when a non-empty value is supplied, places the row in a uniform group with other rows that have the same value for -uniform. The space for rows belonging to a uniform group is allocated so that their sizes are always in strict proportion to their -weight values. See THE GRID ALGORITHM below for further details. The -pad option specifies the number of screen units that will be added to the largest window contained completely in that row when the grid geometry manager requests a size from the containing window. If only an option is specified, with no value, the current value of that option is returned. If only the master window and index is specified, all the current settings are returned in an list of "option-value" pairs.

As I noted in a comment to the question - this is antique software that should be upgraded.

Jonathan Leffler
For some reason on the machine I was working on 'perldoc Tk::grid' returned with 'no documentation for Tk::grid'. However, that gave me an idea of what to start searching for and I eventually found it in Widget.pm and from the documentation in the code was able to come up with:$main_window->Tk::grid('rowconfigure', 1, -weight => 1, -minsize => 171 );which worked out great. Thanks for the help!
Akers