FROM : Pierre Chatel
DATE : Thu Apr 14 18:41:42 2005
Hi list,
i'm using a NSDrawer attached to a NSFloatingWindowLevel window. This
window is put at 99% out of the screen. There is a smal portion of the
window which is visible at the screen edge (a small white line). This
way i detect when a mouse cursor enter the main window and i open the
drawer. For the user it seems like the drawer is poping out of the
screen edge.
By the way, you can try my app at:
http://www.chatelp.org/sidenote_v1_0.sit
My problem is: if the user activate Exposé (F9) when the drawer is
open, it loses its position -> when coming back from Exposé mode, the
drawer is no more attached to its parent window and can appear anywhere
on your screen.
I had already noticed this behavior when working with other
NSDrawer-using applications (like Mail for instance) but not
systematically !
Does someone here has a clue about that ?
The NSWindow instance is associated to the drawer using
InterfaceBuilder (via the parentWindow outlet).
This is the code i'm using in my NSWindow subclass:
-(void) awakeFromNib {
//get defaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
edge = [[defaults objectForKey:UNSAscreenEdge] intValue];
//change border and position
SpecialWindow *borderlessWindow = self;
NSView *oldView = [borderlessWindow contentView];
borderlessWindow = [ borderlessWindow initWithContentRect: [self
getContentRect:edge]
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer: YES];
[borderlessWindow setContentView:oldView ];
[borderlessWindow setLevel:NSFloatingWindowLevel];
[borderlessWindow changeWindowHeight:[[defaults
objectForKey:UNSAdrawerHeight] floatValue]];
}
PS: It would seem that I had found a bug with NSTextView used inside
NSDrawer in my previous post (
http://www.cocoabuilder.com/archive/message/cocoa/2005/3/30/131788 ).
It has been submitted to apple as recomendend here, but I still did not
have an answer. The bug was manually "solved" by pre-opening a unused
NSTextView outside of the drawer. Odd !!
DATE : Thu Apr 14 18:41:42 2005
Hi list,
i'm using a NSDrawer attached to a NSFloatingWindowLevel window. This
window is put at 99% out of the screen. There is a smal portion of the
window which is visible at the screen edge (a small white line). This
way i detect when a mouse cursor enter the main window and i open the
drawer. For the user it seems like the drawer is poping out of the
screen edge.
By the way, you can try my app at:
http://www.chatelp.org/sidenote_v1_0.sit
My problem is: if the user activate Exposé (F9) when the drawer is
open, it loses its position -> when coming back from Exposé mode, the
drawer is no more attached to its parent window and can appear anywhere
on your screen.
I had already noticed this behavior when working with other
NSDrawer-using applications (like Mail for instance) but not
systematically !
Does someone here has a clue about that ?
The NSWindow instance is associated to the drawer using
InterfaceBuilder (via the parentWindow outlet).
This is the code i'm using in my NSWindow subclass:
-(void) awakeFromNib {
//get defaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
edge = [[defaults objectForKey:UNSAscreenEdge] intValue];
//change border and position
SpecialWindow *borderlessWindow = self;
NSView *oldView = [borderlessWindow contentView];
borderlessWindow = [ borderlessWindow initWithContentRect: [self
getContentRect:edge]
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer: YES];
[borderlessWindow setContentView:oldView ];
[borderlessWindow setLevel:NSFloatingWindowLevel];
[borderlessWindow changeWindowHeight:[[defaults
objectForKey:UNSAdrawerHeight] floatValue]];
}
PS: It would seem that I had found a bug with NSTextView used inside
NSDrawer in my previous post (
http://www.cocoabuilder.com/archive/message/cocoa/2005/3/30/131788 ).
It has been submitted to apple as recomendend here, but I still did not
have an answer. The bug was manually "solved" by pre-opening a unused
NSTextView outside of the drawer. Odd !!
| Related mails | Author | Date |
|---|---|---|
| Pierre Chatel | Apr 14, 18:41 | |
| Mark T | Apr 16, 03:06 |






Cocoa mail archive

