Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hello,

I'm forced to use Tkx (ActivePerl). I can't move to Tk neither upload any module. The firewall of the company prevent any upload.

I'm looking for a way to change the size of the columns in a table (new_table).
I need to fit the size of :

    The column 1 to 2
    The column 2 to 10
    The column 3 to 5
    The column 4 to 5

but the 4 columns are always with the same size !

here is a skeleton of a script

#!/usr/bin/perl -- use strict; use warnings; use Tkx; Tkx::package_require("Tktable"); my $mw = Tkx::widget->new("."); my %hash = ( # data to display for example '1,0' => 'Vertical', '2,0' => 'Lng', '3,0' => 'Lateral', '0,1' => 'Expected shifts (A)', '0,2' => 'Shifts based on img alignment (B)', '0,3' => '|A-B|', ); my $t = $mw->new_table ( -rows => 4, -cols => 4, -cache => 1, -variable => \%hash, ); $t->g_grid(-column => 0, -row => 0, -sticky => "news"); # what i try but did'nt work... $t->g_grid_columnconfigure(0, -weight => 2); $t->g_grid_columnconfigure(1, -weight => 10); $t->g_grid_columnconfigure(2, -weight => 5); $t->g_grid_columnconfigure(3, -weight => 5); Tkx::MainLoop();

any help is granted ;-)

best regards
x-l'ours (a frenchy)


In reply to Tkx - new_table - how to resize columns ? by x-lours

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2021-10-26 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (90 votes). Check out past polls.

    Notices?