[Y-devel] Widget size negotiation

Brent Gulanowski brentg at magma.ca
Wed Feb 25 19:44:11 GMT 2004


On Feb 24, 2004, at 10:04 PM, Lincoln Quirk wrote:

> On Tue, 2004-02-24 at 21:29, Thomas wrote:
>> On Tuesday 24 February 2004 08:29, Lincoln Quirk wrote:
>>> Within each level of widget containment there should probably be an
>>> automatic sizing method with propagation. This way, you can resize
>>> windows, and everything inside the window will behave optimally in 
>>> terms
>>> of the sizes.
>>
>> In my opinion, you should be able to choose whether you want this 
>> behavior or
>> not.  This is already implemented to a certain extent in GridLayout, 
>> and I
>> like this method.  If you want your window to resize widgets, use a 
>> layout
>> that resizes, if not (for whatever reason) you can use something like 
>> a Panel
>> which would just let you place objects at locations and specify their 
>> size
>> statically.
>
> Agreed. I would make this the implementation in some layout widget
> (NegotiatingGridLayout? something like that) -- not all of them, 
> because
> there are certainly times when you don't want that behavior. I was
> unclear and I realized it after I sent the post -- that this isn't
> something I would expect everybody to use, but it is a common and 
> useful
> mechanism.

In Cocoa, each widget (view subclass) has properties which define 
whether its (rectangular) boundary edges respond to changes in the 
positions of its neighbours and immediate parent view. There are two 
properties for each edge, one for positioning (which affects if the 
whole widget moves) and one for sizing (which determines if the widget 
shrinks or stretches). Usually one does not set both to be active, 
because then the widget behaves erratically. The idea is that the user 
can resize the window, or drag divider bars, and the way widgets 
respond to that can be set programatically or graphically in Interface 
Builder. It's fairly orthogonal, but not completely, and can get 
confusing if you aren't careful (and have lots of layers of widgets) so 
having a graphical editor for interfaces is a godsend when working them 
out.

--
Brent Gulanowski                                brentg at magma.ca
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2359 bytes
Desc: not available
Url : https://www.y-windows.org/pipermail/y-devel/attachments/20040225/6e3c350e/smime.bin


More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved