carlogulliani (carlogulliani) wrote in macosxdev,

is it bug or not?

 So, i made class which replaced my Window.

I used initWithContentRect for re-drawing my Window interface (i just removed close, minimize, maximize buttons and removed titlebar)

so, in my app i using webView which load html page with flash, and after using initWithContentRect method my flash cannot get mouse events, for example - my flash has button and in normal mode button is pressing, but after using this method button doesn't pressing

i used the next:

- (id)initWithContentRect:(NSRect)contentRect 

styleMask:(unsigned int)aStyle 

  backing:(NSBackingStoreType)bufferingType 

defer:(BOOL)flag {


NSSize size = [[NSScreen mainScreen] frame].size;

    self = [super initWithContentRect:NSMakeRect(0, 0, size.width, size.height)

styleMask:NSBorderlessWindowMask 

  backing:NSBackingStoreBuffered 

defer:NO];

if(self) {

[self setLevel: NSStatusWindowLevel];

[self setHasShadow: NO];

[self setMovableByWindowBackground:YES];

}

    return self;

}

 

- (BOOL) canBecomeKeyWindow

{

    return YES;

}

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

  • 4 comments

moonlessnights

January 27 2009, 06:09:15 UTC 5 years ago

My guess is that you also need to override acceptsMouseMovedEvents to return YES or call setAcceptsMouseMovedEvents:YES.

By default, NSWindow instances don't accept mouse moved events and distribute them to the responder chain.

carlogulliani

January 27 2009, 09:13:39 UTC 5 years ago

unfortunately, it doesn't work(
i added line: [self setAcceptsMouseMovedEvents:YES];

but i still can't get mouse events within my app

carlogulliani

January 27 2009, 10:03:52 UTC 5 years ago

so, i've found the bug.

when i launch my application it doesn't work. if i switch to another app and return to my app, events are working. do u know how to solve it?

Deleted comment

carlogulliani

January 28 2009, 09:37:04 UTC 5 years ago

thank you, already done)