• 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
How to create and show an NSButton programmatically?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to create and show an NSButton programmatically?


  • Subject: How to create and show an NSButton programmatically?
  • From: Ivan Kourtev <email@hidden>
  • Date: Sun, 5 Feb 2006 17:30:02 -0500

Hello,

I am having trouble creating and showing a button (instance of NSButton) on a window programmatically? I have tried allocating and initializing the button with something along the lines of:

NSButton *button = [[NSButton alloc] init];
[button setButtonType:NSMomentaryPushInButton];
[[newWindow contentView] addSubview:button];
[button setNeedsDisplay:YES];

and although I get no errors or warnings (at compile or run time) I am not able to make the button show up.

I searched the documentation and it doesn't speak much of doing what I am doing so perhaps this is not the preferred way of doing what I want to do? What am I missing here?

Thanks for any help,

--
ivan
_______________________________________________
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: How to create and show an NSButton programmatically?
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: NSArrayController Difficulties
  • Next by Date: Re: Universal Binaries and messages to nil
  • Previous by thread: Universal Binaries and messages to nil
  • Next by thread: Re: How to create and show an NSButton programmatically?
  • Index(es):
    • Date
    • Thread