****

How to adjust size of widgets like frame,label,text inside a window with resizing of the window in tcl tk GUI

Hi,

I am new in tcl\tk and I am developing a UI using it. The UI window has a frame that has dynamic number of labels and text widgets filled according to the number of columns in a table. There is an entry widget for each column, data typed in it by user populates each column in the table.

However the problem I am facing is that , I cannot find a way to make the size and position of the widgets inside the frame in the window adjust themselves according to the size of the window. That is if the user enlarges the window by dragging and enlarging its size the widgets inside the window should also increase in size and adjust their positions according to the window size. Vice versa if the window size id decreased. Something like bootstrap in HTML, CSS.

Can anyone please give me any idea?? I have been searching the internet high and low but did not find anything useful. Any help is greatly appreciated. Thanks!


Siqsuruq - 2017-09-08 21:46:26

For example first entry will be small, and second one will fill x horizontally:

package require Tk
pack [ttk::entry .e]
pack [ttk::entry .e1] -fill x