• 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
Re: What is an NSNextStepFrame?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is an NSNextStepFrame?


  • Subject: Re: What is an NSNextStepFrame?
  • From: John Stiles <email@hidden>
  • Date: Sat, 13 Aug 2005 16:40:41 -0700

Why not set its top-left point before ordering it front?


On Aug 13, 2005, at 12:39 PM, Michael Rothwell wrote:


I figured it out. Below is the code that I am using to position a panel near my NSStatusItem's location. The first method returns an NSPoint of the origin of my NSStatusItem's window. The second uses that point (if it's not 0,0) to move the NSPanel to be right under the NSStatusItem. The first time it's used, I can see the panel move to the location of the NSStatusItem. Subsequent times, it just appears there, as it's saving its last location to preferences.



/** * statusItemOrigin * Figures out the location of our NSStatusItem */ -(NSPoint)statusItemOrigin { NSView *o =(NSView *)[appMenuButton superview];

NSWindow *w = [o window];
if (w)
{
// NSLog(@"4 origin: %f,%f", [w frame].origin.x,[w frame].origin.y);
// NSLog(@"4 size: %f,%f", [w frame].size.width,[w frame].size.height);
return [w frame].origin;
}
return NSPointFromString(@"{0,0}");
}



/** * showRunPanel * Displays the "run" panel */ -(void)showRunPanel:(NSMenuItem *)item { // Get location of my NSStatusItem NSPoint o = [self statusItemOrigin];

    NSLog(@"showRunPanel");

    // Bring window to front and display
    [runPanel orderFrontRegardless];
    [runPanel makeKeyWindow];
    [runPanel display];

    // move to under NSStatusItem
    if (o.x>0 && o.y>0)
    {
        NSLog(@"move panel to %f, %f", o.x, o.y);
        [runPanel setFrameTopLeftPoint:o];
    };
};




On Aug 13, 2005, at 1:21 PM, Michael Rothwell wrote:


I am attempting to fid out where my NSStatusItem view (an NSButton) lives on the screen, so that I can place a popup window close to it.

The NSButton reports that its superview is an NSNextStepFrame, from which I cannot get a frame. It doesn't seem to behave like an NSView.

I don't really know what an NSNextStepFrame is. Does anyone else?

-Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40rothwell.us


This email sent to email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to email@hidden


_______________________________________________ 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
References: 
 >What is an NSNextStepFrame? (From: Michael Rothwell <email@hidden>)
 >Re: What is an NSNextStepFrame? (From: Michael Rothwell <email@hidden>)

  • Prev by Date: Re: Core Data questions re: primary keys and modeling tool
  • Next by Date: Re: Copy managed object between contexts?
  • Previous by thread: Re: What is an NSNextStepFrame?
  • Next by thread: NEWBIE: Connecting up all those Ms, Vs and Cs
  • Index(es):
    • Date
    • Thread