Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I have RO textarea, where i am placing 4 labels in each row, it looks like below,

---------------------------- |lable1|label2|label3|label4| #Consider this as textarea row, with fo +ur labels. -----------------------------

I am calculating the width of each label according to textarea width, most of the times all labels fits fine in the row, but with changes in screen width, the last label couldn't fit, either it goes on the next line in the textarea, or has space after the label, which looks like below,

----------------------------- |lable1|label2|label3| #Either it goes on the next row OR label4| ----------------------------- ----------------------------- |lable1|label2|label3|label4 <space/s> | #label4 doesn't fit in the r +ow -----------------------------

All i want is consistency while placing the labels in the row in the textarea with different screen width and textarea size. I must be missing some options which is useful for the same. Any suggestion would be helpful.

Thanks

2018-12-21 Athanasius added code tags

Replies are listed 'Best First'.
Re: Resize last label in a row according to the textarea width in Tk application.
by zentara (Cardinal) on Dec 19, 2018 at 17:03 UTC
    It would be helpful to everyone if you made a small piece of running code which demonstrates your problem. See embedding widgets. It looks like you want to set -stretch=>1 in your windowCreate, and add all widgets to that one window. You may have to try and first add a frame to the createWindow with -expand=>1 and -fill=>1, then add your 4 labels to the frame.

    I'm not really a human, but I play one on earth. ..... an animated JAPH
      Thanks a lot, let me try and revert on this.