Re: Programmatically resizing an NSWindow based on window contents
Re: Programmatically resizing an NSWindow based on window contents
- Subject: Re: Programmatically resizing an NSWindow based on window contents
- From: Mike Abdullah <email@hidden>
- Date: Thu, 11 May 2006 13:08:00 +0100
Well, yes you could call [myTableView window] but that seems a little
unnecessary. Why not just add an outlet to your controller to the
window itself? But either way, it's up to you.
Yes, you want setFrame:display: or setFrame:display:animate depending
on what you need. There is not (as far as I am aware) a way of
making your window autosize based on the controls. I'd have thought
a better approach would be to make your tableview autosize with the
window, and then only adjust the size of the window yourself.
Mike.
On 11 May 2006, at 10:44AM, Greg Hurrell wrote:
I have an NSWindow which contains an NSTableView among other things.
I have set the table view up so that it grows and shrinks as items
are added to or removed from it; I want the view to resize rather
than use scroll bars.
The containing window needs to grow and shrink according to the
size of the table view.
What's the best way to do this?
I know I can get a reference to the window with [theTableView
window] and I can send it a -setFrame: message to do the resize,
but is the best way to do it? It seems very easy in Cocoa to have
subviews automatically resize whenever their superview resizes, but
I don't know if there's a way to achieve the same thing
automatically in the opposite direction (ie. a superview or in this
case a window resizing when a subview resizes).
Any tips? Thanks in advance.
Cheers,
Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden