Re: How to allow ScrolledWindow to grow?



On Mon, Jul 24, 2006 at 11:49:13AM +0700, elifant wrote:
> I have Window with TextView inside ScrolledWindow.
> There is maximum size window can have.
> 
> If text is short and TextView is small, I wan't ScrolledWindow and 
> Window become as small as possible.
> If text is large, I want ScrolledWindow and Window grow up till limit 
> and only when limit is reached for some direction, scrollbar appears.
> 
> How can I do this?

If the user should be able to shrink the window even before
it reaches the target size (which is a good thing), probably
only by recalculating size of the window and resizing it
manually in response of the textview's size requests.  Once
the user sets the size excpliticly, it should stop setting
it itself, so you need to detect this situation.
Unfortunately I don't know a 100% method for this, what more
or less works is checking for "size-allocate"s that are not
preceded with size requests and are not self-induced by the
mechanism above.

If you don't care, enabling the scrollbars only when the
window reaches the target size should suffice.

Yeti


--
Anonyms eat their boogers.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]