Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IB3 plugin for custom view, how to forbid resizing in one direction?



On 27-May-08, at 1:30 PM, Sean McBride wrote:

On 5/27/08 12:59 PM, Brandon Walkin said:

You'll need to implement -(NSSize)ibMaximumSize in your view's
integration class and return the height of your view and an
arbitrarily large width (like 100000). Then you'll get the IB behavior
you were talking about.

I had tried ibMinimunSize but found that it did not have any effect, so
I figured I was at a dead end. It seems in fact that one must implement
_both_ ibMinimunSize and ibMaximunSize. Thanks for this hint. So if I do:


- (NSSize)ibMinimumSize
{
   return NSMakeSize (21, 21);
}

- (NSSize)ibMaximumSize
{
   return NSMakeSize (CGFLOAT_MAX, 21);
}

Then IB does indeed stop me from changing the height, but it still lets
me make the width less than 21. Why?

I haven't been able to use these methods to get IB to stop a vertical or horizontal resize at a particular point. I don't think IB supports that behavior at the moment.


You'll notice that there are no standard controls that behave in this way. Interface Builder allows the user to resize controls to a non- useful size if the particular axis is resizable (for instance, a slider can be resized to a width of 5 points – not very helpful). There's probably a good reason for this (since the IB plugin architecture is fairly well thought out), but I'm not aware of what that is.

Brandon _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >IB3 plugin for custom view, how to forbid resizing in one direction? (From: "Sean McBride" <email@hidden>)
 >Re: IB3 plugin for custom view, how to forbid resizing in one direction? (From: Brandon Walkin <email@hidden>)
 >Re: IB3 plugin for custom view, how to forbid resizing in one direction? (From: "Sean McBride" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.