How to create programaticlly

2009-07-14 Thread Agha Khan
Hi: How to create infoButton programaticlly? I do not have nib file, so I have to create inside - (void)loadView function. Regards -Agha ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: How to create programaticlly

2009-07-14 Thread I. Savant
On Jul 14, 2009, at 5:38 PM, Agha Khan wrote: How to create infoButton programaticlly? I do not have nib file, so I have to create inside - (void)loadView function. http://lmgtfy.com/?q=cocoa+creating+buttons+programmatically -- I.S. ___ Cocoa

Re: How to create programaticlly

2009-07-14 Thread Joel Norvell
Hi Agha, I guess you've overridden your NSViewController's loadView method, which seems like a good place to roll your own button. You'll need to create and initialize the button with something like this: NSButton *newButton = [[[NSButton alloc] initWithFrame:nestedFrame] autorelease];

Re: How to create programaticlly

2009-07-14 Thread Joel Norvell
Hi Agha, In my previous note, I forgot to mention that the button will have to be explicitly connected to its window's view hierarchy, unless your view controller does this for you. So you'll probably need to find its super view and do something like this: [itsSuperview addSubview: