Re: Fontsize vs. layouts and windowsizes
James Harr <[email protected]> Tue, 27 Jul 2004 07:47:09 -0500
| Newsgroups | gmane.comp.graphics.y.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sunday 25 July 2004 5:45 am, Kimmo Sundqvist wrote: > Two possible solutions include, first, creating the window with enough size > to have the whole label visible, not of course exceeding screen boundaries. > Another is to have the label wrapped to multiple lines. Maybe a flag to > indicate if wrapping is allowed. Y has this feature built in in a sense. It's not one of the options you're talking about, but it should work. When Y's windows resize, a request goes down the widget tree to request the minimum size. Each widget adds up all the child widgets minimum sizes (or if this widget has some sort of border, it's the widgets responsibility for adding the propper amount for borders/whatnot. So if you increase the font in a label, the minimum size will go up for the label, the gridlayout widget it happens to be in will detect this and add it into the minimum size accordingly. IIRC Y also does this going down the tree when it gets the final size. The window tells the widget it has the size it's being given (which will of course be over the minimum size), and its that widgets responsibility to split it up and send sizes down to its cildren. At least that's how I understand it. As far as a wrapping flag, this should be implemented into any modern widget set anyway. -- James Harr <[email protected]> http://www.grickle.org/