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 


defer:(BOOL)flag {

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

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




if(self) {

[self setLevel: NSStatusWindowLevel];

[self setHasShadow: NO];

[self setMovableByWindowBackground:YES];


    return self;



- (BOOL) canBecomeKeyWindow


    return YES;


  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
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.
unfortunately, it doesn't work(
i added line: [self setAcceptsMouseMovedEvents:YES];

but i still can't get mouse events within my app
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

thank you, already done)