• 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: Making an NSWindow Resizable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making an NSWindow Resizable


  • Subject: Re: Making an NSWindow Resizable
  • From: Daniel Todd Currie <email@hidden>
  • Date: Wed, 17 Mar 2004 15:47:43 -0800

Yes, I just tried this last night, but it didn't work. My lamentable foray into the world of Carbon produced some rather odd results...

ChangeWindowAttributes() as you describe returned noErr, GetWindowClass() gives me kDocumentWindowClass, and GetWindowAttribute confirmed that kWindowResizableAttribute had been set.

However, the window never became resizable. I couldn't begin to guess why, but it would seem that there are attributes of NSWindow that Carbon can't touch.


On 2004 Mar 17, at 12:14, Kevin Ballard wrote:

I haven't ever actually *tried* this, but couldn't you use Carbon and do

ChangeWindowAttributes([myWindow windowRef], kWindowResizableAttribute, kWindowNoAttributes);

On Mar 17, 2004, at 4:42 AM, Shaun Wexler wrote:

On Mar 17, 2004, at 12:25 AM, Daniel Todd Currie wrote:

Is there any way to programmatically make an NSWindow resizable, without re-initializing it? It would seem what is missing from the NSWindow API, is a -setStyleMask: method.

NSWindows are complex beasts, eh? There are two easy ways you can accomplish what it is I think you're asking: (1) create resizable windows, and use the NSWindow delegate method -windowWillResize:toSize: to constrain the frame so the user is unable to resize it when appropriate, or (2) simply create a new resizable window with the same frame, [newWindow setContentView:[oldWindow contentView]], then close the old window. YMMV. ;)

--
Kevin Ballard
email@hidden
http://www.tildesoft.com
http://kevin.sb.org
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Making an NSWindow Resizable
      • From: Eric Schlegel <email@hidden>
References: 
 >Making an NSWindow Resizable (From: Daniel Todd Currie <email@hidden>)
 >Re: Making an NSWindow Resizable (From: Shaun Wexler <email@hidden>)
 >Re: Making an NSWindow Resizable (From: Kevin Ballard <email@hidden>)

  • Prev by Date: Re: [ANN] Notification Watcher preview
  • Next by Date: Re: Making an NSWindow Resizable
  • Previous by thread: Re: Making an NSWindow Resizable
  • Next by thread: Re: Making an NSWindow Resizable
  • Index(es):
    • Date
    • Thread