Custom NSWindow Subclass
Custom NSWindow Subclass
- Subject: Custom NSWindow Subclass
- From: mw <email@hidden>
- Date: Sun, 13 Oct 2002 21:49:37 -0400
Hello,
I would like to make my own custom subclass of NSWindow (the borderless
type). Most of you will probably start on me about how using borderless
windows is not kosher, and how there is some other way to go about it. Well,
I have a window that is going to be made mainly up of custom NSView
subclasses, one of which is a titlebar, so I do not want the standard Aqua
titlebar in my window.
Now, I have subclassed NSWindow and made it the class type of the main
window in my nib file (this portion of my suite is not document-based), and
I create the files and send them into my PB project.
I need to know how to intercept the message (is it still init?) that is sent
to the window when it needs to be initialized. This is because I need to
call initWithContentRect:styleMask:styleMaskbacking:defer:
so I can set the styleMask attribute of the window to
NSBorderlessWindowMask. Then, if the message is still init, I would return
from init with the object returned by
initWithContentRect:styleMask:styleMaskbacking:defer: so the window would
have correct settings.
Am I going about this correctly, or is there some other way to do it.
Also, one thing regarding my view subclasses. My views are just going to be
custom button controls that have normal and over states. Would the best way
to go about this be placing the NSView (with the picture in it) underneath a
transparent bevel button? I know this method *should* work for handling
mouse-down events (since all NSButtons handle those quite nicely ;-) ), but
will I also be able to intercept mouseOver: events? If not, then do I have
to implement mouse event tracking methods in my NSView subclasses to handle
mouseDown AND mouseOver, or is mouseDown also handled automatically by
NSView?
Thanks,
mw
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.