• 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: Putting window titlebar under menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Putting window titlebar under menu


  • Subject: Re: Putting window titlebar under menu
  • From: email@hidden
  • Date: Fri, 25 Jan 2002 11:56:05 +0100

Is there any way to force a window (a floating panel) to have its
titlebar under the menubar? I've tried using
setFrameTopLeftPoint: but if I specify a position under the
menubar, it moves the window to the right instead...

i thing your NSBorderlessWindowMask is the right solution in this case. just you may need to call a mouseDown event so that you can move your window for a right placement [think of clock in OS X ]:

- (void)mouseDown:(NSEvent *)theEvent
{
dragStartLocation = [theEvent locationInWindow];
}
- (void)mouseDragged:(NSEvent *)theEvent
{
if([theEvent type] == NSLeftMouseDragged)
{
NSPoint origin;
NSPoint newLocation;

origin = [[self window] frame].origin;
newLocation = [theEvent locationInWindow];

[[self window] setFrameOrigin:
NSMakePoint(origin.x + newLocation.x - dragStartLocation.x,
origin.y + newLocation.y - dragStartLocation.y)];
}
}
let dragStartLocation be in @interface declaration
NSPoint dragStartLocation;

besides, keeping the window level at the top will be more of help:
[yourWindow setLevel: NSStatusWindowLevel];
so that you can keep your window anywhere even above the menubar

amazing :)
==
chandan
(remember, the code i've pasted for you is not written by me. it's my collection from a friend. i've tested and modified it for my purpose. it works just as one more CoolFact :)


  • Follow-Ups:
    • Re: Putting window titlebar under menu
      • From: Kim Foo-Jones <email@hidden>
  • Prev by Date: app size
  • Next by Date: Re: app size
  • Previous by thread: Putting window titlebar under menu
  • Next by thread: Re: Putting window titlebar under menu
  • Index(es):
    • Date
    • Thread