• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Programmatically resizing an NSWindow based on window contents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Programmatically resizing an NSWindow based on window contents
      • From: Greg Hurrell <email@hidden>
References: 
 >Programmatically resizing an NSWindow based on window contents (From: Greg Hurrell <email@hidden>)

  • Prev by Date: Re: Subviews becoming blurry or "chopped up"
  • Next by Date: Re: Subviews becoming blurry or "chopped up"
  • Previous by thread: Programmatically resizing an NSWindow based on window contents
  • Next by thread: Re: Programmatically resizing an NSWindow based on window contents
  • Index(es):
    • Date
    • Thread