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
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
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];
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: