• 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 do I put a subview in a superview with color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how do I put a subview in a superview with color


  • Subject: how do I put a subview in a superview with color
  • From: colo <email@hidden>
  • Date: Thu, 30 Dec 2010 17:22:37 -0500

I was following the Chapter 17 Cocoa programming for osx 3rd ed
The code is below.
All I want to do for a working example is draw an NSView subview in
the superview.
And give it have a color and width height.

I was trying all sorts of things. I can draw NSMakeRects in the drawRect method
But I just can't get it to draw another NSview for practice.
Or draw an NSMakeRect as a NSView.




	NSView *superview = [window contentView];
	NSRect frame2 = NSMakeRect(10, 10, 200, 100);

	NSButton *button = [[NSButton alloc] initWithFrame:frame];
	[button setTitle:@"fuuuu"];


	[superview addSubview:button];
	[button release];
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: how do I put a subview in a superview with color
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: Detecting MouseUp in NSSplitview
  • Next by Date: Re: how do I put a subview in a superview with color
  • Previous by thread: Re: track files even if moved
  • Next by thread: Re: how do I put a subview in a superview with color
  • Index(es):
    • Date
    • Thread