TkTable -- setting column widths

Discussion in 'Ruby' started by Joe Van Dyk, May 10, 2005.

  1. Joe Van Dyk

    Joe Van Dyk Guest

    Is it possible to set an individual column in a TkTable to be a
    different width than the default?

    I'm looking at http://tcl.activestate.com/community/hobbs/tcl/. It
    looks like I should be able to do something like

    @table.tag_col('WideCol', 2)
    @table.width('WideCol', 20)

    Which would tag the second column with 'WideCol' and then set all
    columns that are tagged with 'WideCol' to width 20. But #width() just
    wants one argument, although the tcl docs look like it can support
    more.

    Thanks,
    Joe
     
    Joe Van Dyk, May 10, 2005
    #1
    1. Advertisements

  2. Joe Van Dyk

    Joe Van Dyk Guest

    On 5/10/05, Joe Van Dyk <> wrote:
    > Is it possible to set an individual column in a TkTable to be a
    > different width than the default?
    >=20
    > I'm looking at http://tcl.activestate.com/community/hobbs/tcl/. It
    > looks like I should be able to do something like
    >=20
    > @table.tag_col('WideCol', 2)
    > @table.width('WideCol', 20)
    >=20
    > Which would tag the second column with 'WideCol' and then set all
    > columns that are tagged with 'WideCol' to width 20. But #width() just
    > wants one argument, although the tcl docs look like it can support
    > more.


    Actually, what I'd really like to have is the ability for each TkTable
    columns to stretch out to fit their biggest member.
     
    Joe Van Dyk, May 10, 2005
    #2
    1. Advertisements

  3. Joe Van Dyk

    Joe Van Dyk Guest

    On 5/10/05, Joe Van Dyk <> wrote:
    > Is it possible to set an individual column in a TkTable to be a
    > different width than the default?
    >=20
    > I'm looking at http://tcl.activestate.com/community/hobbs/tcl/. It
    > looks like I should be able to do something like
    >=20
    > @table.tag_col('WideCol', 2)
    > @table.width('WideCol', 20)
    >=20
    > Which would tag the second column with 'WideCol' and then set all
    > columns that are tagged with 'WideCol' to width 20. But #width() just
    > wants one argument, although the tcl docs look like it can support
    > more.


    Ah, just figured it out.

    @table.set_width([1, 18], [3, 18], [0, 4])

    Will set column 1 to width 18, column 3 to width 18, and column 0 to width =
    4.
     
    Joe Van Dyk, May 10, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    More Elegant Column Widths in ASP:Table Objects?

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, May 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    651
    Jason DeFontes
    May 14, 2004
  2. sck10

    Data Grid Column Widths

    sck10, Nov 8, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    8,142
    Steven Cheng[MSFT]
    Nov 15, 2004
  3. wh1974
    Replies:
    1
    Views:
    1,754
    =?Utf-8?B?RmVybmFuZG8gSHVudGg=?=
    Jan 11, 2005
  4. =?Utf-8?B?RWxtZXI=?=

    Datagrid column widths in edit mode

    =?Utf-8?B?RWxtZXI=?=, Apr 8, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,672
    =?Utf-8?B?RWxtZXI=?=
    Apr 19, 2005
  5. Rachel Devons

    Setting column widths in DataList?

    Rachel Devons, Jun 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,149
    Eliyahu Goldin
    Jun 19, 2005
  6. =?Utf-8?B?U3RldmUgQnVnZGVu?=

    Setting GridVIew column widths at runtime

    =?Utf-8?B?U3RldmUgQnVnZGVu?=, Mar 6, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    18,771
    =?Utf-8?B?U3RldmUgQnVnZGVu?=
    Mar 7, 2006
  7. Gerhard Rapp

    Adjust column widths of JTable

    Gerhard Rapp, Jul 18, 2003, in forum: Java
    Replies:
    0
    Views:
    2,381
    Gerhard Rapp
    Jul 18, 2003
  8. Greg Smith

    Setting column widths in a GridView

    Greg Smith, Sep 28, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    800
    Greg Smith
    Sep 28, 2006
Loading...