Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8324461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:04:57+00:00 2026-06-09T00:04:57+00:00

I have a window with widgets inside it. When I re-size the window manually,

  • 0

I have a window with widgets inside it. When I re-size the window manually, the widgets will scale them self when the height is reduced, but not when the width is changed or when the height is enlarged beyond the initial height. How do I make the widgets to be stack to the borders of the window?

The code for the creation of the window:

wm title $base "KitKite Sparam Viewer"
set frm_main      [frame  $base.main_frm]
pack $frm_main

grid [frame $frm_main.graph ] -row 1 -column 1
set g [sparam_graph_widget $frm_main.graph graph]

grid [set frm [frame $frm_main.frm]] -row 1 -column 2
#from and to frame
set from      [frame $frm.from -relief ridge -bd 2]
set from_lbl  [label $from.lbl -text "From:"]
set f_tbl_frm [frame $from.tbl_f]
set to        [frame $frm.to -relief ridge   -bd 2]
set to_lbl    [label $to.lbl   -text "To:"]
set t_tbl_frm [frame $to.tbl_t]

grid $from      -column 1 -row 1 -sticky nwe
grid $from_lbl  -row 1 -sticky nsew
grid $f_tbl_frm -row 2 -sticky nsew
grid $to        -column 2 -row 1 -sticky nwe
grid $to_lbl    -row 1 -sticky nsew
grid $t_tbl_frm -row 2 -sticky nsew

set from_t [sparam_table_widget $f_tbl_frm f_tbl]
set to_t   [sparam_table_widget $t_tbl_frm t_tbl]

set data        [frame $frm.data]
set data_lbl    [label $data.lbl -text "Choose data type to show"]
set isi         [checkbutton $data.cb_isi -variable cb(isi) -command [list __sp_data_changed isi $g] -text ISI       ]
set xt          [checkbutton $data.cb_xt  -variable cb(xt)  -command [list __sp_data_changed xt  $g] -text XT        ]
set ref         [checkbutton $data.cb_ref -variable cb(ref) -command [list __sp_data_changed ref $g] -text Reflection]
set conf_button [button $data.bt_conf -text "Configure connections" -command [list __sp_configure_datapath]]

grid $data        -column 1 -row 2 -columnspan 2 -sticky new
grid $data_lbl    -column 1 -row 1 -columnspan 2 -sticky nsew
grid $isi         -column 1 -row 2               -sticky nsw
grid $xt          -column 1 -row 3               -sticky nsw
grid $ref         -column 1 -row 4               -sticky nsw
grid $conf_button -column 2 -row 2 -rowspan 3    -sticky nsew

grid rowconfigure $frm 1 -weight 4 -uniform 1
grid rowconfigure $frm 2 -weight 1 -uniform 1
grid rowconfigure $frm_main 1 -weight 5 -uniform 1

$base is the name of the window created using toplevel
sparam_graph_widget and sparam_table_widget are procedures that create and place inside the frame given to them custom widgets of a graph and a table (accordingly)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:04:58+00:00Added an answer on June 9, 2026 at 12:04 am

    In order for at least one widget to expand to consume the space, you need to set at least one column to have a non-zero weight.

    grid columnconfigure $containerWidget $someWidgetOrIndex -weight 1
    

    Note that once you do that, that column preferentially deals with all the size changes in the horizontal direction. You can adjust this by setting multiple columns to have non-zero weights, and give different columns different weights (-weight 2 will receive twice as large changes as -weight 1).

    You might also need to adjust the options used to pack the outer frame. Debug by setting different frames to different colors so you can see what’s going on…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have trivial window: this.window = Ext.widget('window', { title: 'Find', closeAction: 'hide', width: 300,
I'm trying to use gtk.window.get_size(), but it always just returns the default width and
I have a Yahoo! Widgets Web object and I'd like to access elements inside
I have a simple Ext JS 4 form inside a window (MVC style app).
I try to make the background of my window transparent. But under widgets which
I have a few widgets in a main window. i want the user to
I have a main window with some widgets on it, each needs its own
I have a qt application, window with several child widgets that are Qt::Tool windows.
I have a certain window Widget. On it, I have a sub-widget- Let's call
I have window form in my WPF Application when I open new window from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.