peterbrittain / asciimatics

A cross platform package to do curses-like operations, plus higher level APIs and widgets to create text UIs and ASCII art animations
Apache License 2.0
3.64k stars 238 forks source link

Change height of label #193

Closed kirtansakariya closed 5 years ago

kirtansakariya commented 5 years ago

I made a Label and added it to a screen. Is it possible for me to change the height of the Label? I start with a height of 30, but want to change it to 20 later on. I've been trying to mess with reassigning the _required_height property of the Label class but that doesn't do anything. Do you have any suggestions?

peterbrittain commented 5 years ago

Well, there is no official API for this. You could change the calculated height (_h) on the Label, but that will just change the Label in isolation. All the other Widgets will simply stay in their current location until the Layout that controls them tells them to move/resize.

I suppose you could change the required height (as you are already doing, even though it is a private property) and then call Frame.fix() to rearrange all the Widgets.

kirtansakariya commented 5 years ago

Hi, thanks. That seems to be working.