!? NSView Question

whitesaint

cocoa love
Can an NSView's frame and bounds be set as it runs? So far it seems like this is impossible. :(

-whitesaint
 
Try adding a custom view object to a window in IB, get info on the view, and click the size tab. There you can have the NSView resize in response to the way the window is moving. There's just one case of where an NSView's frame size can be changed on the fly. You should be able to call [NSView setFrame:NSRect] and then send it a setNeedsDisplay:Yes message (this maybe unnecessary). Or am I misunderstanding your question?

F-bacher
 
Thanks for the reply Ghoser777, but i was looking for a more programatical way to do it. I realize that it can be set in IB, but i would like to find a way, that when the user simply clicks a button and sends an (IBAction) to the target, [setFrame] method doesn't work. Can anyone confirm this? Thanks.

-whitesaint
 
This is a good question. Something I've been wondering too. I think the reason we don't understand how to do this is because we don't understand how to have a controller object (the object that responds to IBActions) send a message to an NSView.

I haven't tried this, but maybe you could connect the MenuItem/Button to an action that is added to the NSView in IB. I don't know if you can do this though because I'm at work typing this on a PeeCee.
 
omg thank you so much ghoser! it worked! thank you :) :) :)

-whitesaint

AIM -whitesaint

If yo uever got a problem with anything just ask ill be more than happy to help :).
 
Back
Top