• 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
Subview display problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subview display problem


  • Subject: Subview display problem
  • From: DKJ <email@hidden>
  • Date: Tue, 28 Oct 2008 06:23:23 -0700

I'm having no luck getting a subview to display. In the awakeFromNib of the controller I have this:

	helpView = [[MyView alloc] init];
	[helpView setFrameOrigin:RectCentre( [theView frame] )];
	[helpView setFrameSize:NSZeroSize];
	[theView addSubview:helpView];

(RectCentre is a function that finds the centre of a rectangle.) In the help button action I have this:

	[[helpView animator] setFrameSize:[theView frame].size];
	[helpView setNeedsDisplay:YES];

(I'm sure the button connection is set in IB.) Finally, in the drawRect: method of MyView I have this:

	[[NSColor colorWithCalibratedRed:1.0 green:1.0 blue:0.8 alpha:0.9]
		set];
	[NSBezierPath fillRect:[self bounds]];
	[NSBezierPath strokeRect:[self bounds]];

When I press my Help button, all I see is a small patch of colour appearing briefly in the main view.

theView does have animation layers. Would this make a difference?

dkj
_______________________________________________

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: Subview display problem
      • From: Patrick Mau <email@hidden>
    • Re: Subview display problem
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: Not so long filenames
  • Next by Date: Re: Finding out that a volume is going away before it does
  • Previous by thread: Re: Turning off Auto Complete feature for NSTextField
  • Next by thread: Re: Subview display problem
  • Index(es):
    • Date
    • Thread