I would like to bind 4 NSTextFields with each of the 4 values of a NSRect
mViewFrame. So when I change a value, my view resizes automatically.
I am already able to bind the 4 float values, one by one, origins and size,
but this way I have to add 4 redundant float values and write 8 methods (4
set and 4 get) in order to go from/to the float values to the NSRect value.
For example:

- (void)setMHeight:(float)value
{
    mViewFrame.size.height = mHeight = value;
}

- (float)mHeight
{
    return mViewFrame.size.height;
}

I presume that binding should make me save time and glue code, so I think
that there should be a faster way to bind an NSRect and have at least one
method defined as

- (void)setMViewFrame:(NSRect)frame
{
    mViewFrame.size.height = frame;
    [self setNeedsDisplay:YES];
}

Any Suggestion? If there is a way, what should I set on the IB exactly?

Best Regards
-- 
LL


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to