PDA

View Full Version : Cocoa/Objective-C: Can I position controls programatically?




mpemburn
May 29, 2009, 07:47 AM
Hi,

I'm relatively new to Objective-C (several weeks) and, while a lot of things are starting to make sense, there's one thing that I can't seem to find any information on: How to position controls programatically. This is something I'm used to being able to do in the dozen other languages I've worked with over the years so it puzzles me that what I consider to be a basic facility missing from Objective-C. Probably means I'm looking at it the wrong way. Any help (except, "Why would you want to do that?") gratefully accepted.

Thanks in advance,

Mark



robbieduncan
May 29, 2009, 07:54 AM
Yes. Of course you can. Simply set the frame of the NSView (http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/nsview_Class/Reference/NSView.html#//apple_ref/occ/instm/NSView/frame). Simple.

mpemburn
May 29, 2009, 08:21 AM
Great! Thanks for the speedy reply!

Mark