Methods


MO_minSize
Returns the minimum size for a view.
MO_setMinSize:
Sets the minimum size for a view.
MO_maxSize
Returns the maximum size for a view.
MO_setMaxSize:
Sets the maximum size for a view.
MO_takesMinSizeFromClipView
Returns whether the minimum size of the view should be the bounds size of the clip view it is in.
MO_setTakesMinSizeFromClipView:
Sets whether the minimum size of the view should be the bounds size of the clip view it is in.
MO_sizeConstraintsDidChange
This method is called whenever the min or max size contraints on a view may have changed.

MO_maxSize

Returns the maximum size for a view.
- ( NSSize ) MO_maxSize;

This method returns the maximum size of a view. If MO_setMaxSize: has been previously called, this returns the size that was set with that method. Otherwise, this returns the size {MAXFLOAT, MAXFLOAT}.

method result
The maximum size of the receiver.

MO_minSize

Returns the minimum size for a view.
- ( NSSize ) MO_minSize;

This method returns the minimum size of a view. If MO_takesMinSizeFromClipView is YES and the view is currently the direct subview of an NSClipView, then this method returns the current bounds size of the clip view. If MO_setMinSize: has been previously called, this returns the size that was set with that method. Otherwise, this returns the size {0.0, 0.0}.

method result
The minimum size of the receiver.

MO_setMaxSize:

Sets the maximum size for a view.
- ( void ) MO_setMaxSize:
        (NSSize ) maxSize;

This method sets the maximum size of a view.

Parameter Descriptions
maxSize
The maximum size to be used for the receiver.

MO_setMinSize:

Sets the minimum size for a view.
- ( void ) MO_setMinSize:
        (NSSize ) minSize;

This method sets the minimum size of a view. If MO_takesMinSizeFromClipView is YES and the view is currently the direct subview of an NSClipView, then the size set with this method will have no effect and the minimum size will instead be the size of the clip view's bounds rectangle.

Parameter Descriptions
minSize
The minimum size to be used for the receiver.

MO_setTakesMinSizeFromClipView:

Sets whether the minimum size of the view should be the bounds size of the clip view it is in.
- ( void ) MO_setTakesMinSizeFromClipView:
        (BOOL ) flag;

This method sets whether the minimum size of the view should be the bounds size of the clip view it is in. If set to YES and the view is a direct subview of an NSClipView then MO_minSize will return the bounds size of the clip view. This setting has no effect when the receiver is not a subview of an NSClipView.

This method is often called from an NSView subclass' -initWithFrame: override. For example MOViewListView does this since it generally expects to live inside an NSClipView. Views that use this feature are encouraged to have a -sizeToFit method. When the clipview's size changes and the minimum size of the view is updated, if the view implemented -sizeToFit, it will be called. This allows the view to shrink itself if its minSize just got smaller and it was bigger than it might naturally want to be, for example.

Parameter Descriptions
flag
YES if the view's minimum size should be the bounds size of its clip view, NO if not.

MO_sizeConstraintsDidChange

This method is called whenever the min or max size contraints on a view may have changed.
- ( void ) MO_sizeConstraintsDidChange;

This method is called whenever the min or max size contraints on a view may have changed. You should never call it directly, but you may wish to override it. A common override of this method would invoke -sizeToFit to make sure the view is as close to its natural size as possible given the new contraints. The default implementation does nothing.


MO_takesMinSizeFromClipView

Returns whether the minimum size of the view should be the bounds size of the clip view it is in.
- ( BOOL ) MO_takesMinSizeFromClipView;

This method returns whether the minimum size of the view should be the bounds size of the clip view it is in. If this is YES and the view is a direct subview of an NSClipView then MO_minSize will return the bounds size of the clip view. This setting has no effect when the receiver is not a subview of an NSClipView.

method result
YES if the view's minimum size should be the bounds size of its clip view, NO if not.

(Last Updated 3/20/2005)