• 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
NSPopover subview positioning issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPopover subview positioning issue


  • Subject: NSPopover subview positioning issue
  • From: Erik Stainsby <email@hidden>
  • Date: Sat, 17 Mar 2012 12:48:49 -0700

I've got a popover controller which loads one of several subviews ('panels' below) as it's content. I have properties on the controller which expose the current panel's height and width.  The popover resizes correctly but fails to place the panel correctly.  If the replaceSubview:with: is called before the resize (as illustrated) the panel appears shifted down by half it's height, leaving half of the panel content inaccessible. If the -replaceSubview:with: call is placed after the resize, the inserted panel is half invisible off the top edge of the popover.

Does anyone understand what on earth is happening? And what I can do about it?


@implementation RSPanelPopoverController

@synthesize popover = _popover;
@synthesize box = _box;
@synthesize activePanelWidth;
@synthesize activePanelHeight;

- (void) showPanelPopover:(NSView*)locator activePanel:(NSView*)panel {

	[[self view] replaceSubview:[self box] with:panel];

	[self setActivePanelWidth: panel.frame.size.width];
	[self setActivePanelHeight: panel.frame.size.height];

	[[self popover] showRelativeToRect:[locator bounds] ofView:locator preferredEdge:NSMinYEdge];
}


Erik Stainsby
email@hidden
-------------------------------------
Consistently place constants on the LHS of an expression: you cannot accidentally assign when you meant to compare.





_______________________________________________

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: NSPopover subview positioning issue
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: How to get Mac codesign certificate?
  • Next by Date: Re: NSPopover subview positioning issue
  • Previous by thread: Re: How to get Mac codesign certificate?
  • Next by thread: Re: NSPopover subview positioning issue
  • Index(es):
    • Date
    • Thread