CustomView as TitleBar
CustomView as TitleBar
- Subject: CustomView as TitleBar
- From: Weston Houghton <email@hidden>
- Date: Sun, 17 Oct 2004 18:18:07 -0400
Ok, this is going to be a newbie question, but I've already spent all
day on it, and all I'm doing is just getting further from the solution
I think. Also, note, I am a Cocoa UI newbie in general.
I'm trying to create a pretty simple app right now that can have from
1-4 windows open (all viewports into the same opengl context). Anyhow,
I'm not even to the OpenGL part yet, but that should be the easier part
for me. Anyhow, so I'm at the point of only making one window right
now. I'm making a NSTexturedBackgroundWindowMask to get rid of the
title bar, as I'm doing live snapping of the window to the edge of the
screen (and eventually hopefully to each other I guess).
This means I have to basically make my own title bar for the window,
which is fine by me. My thought is to make a CustomView that basically
sits in the background of the window where a title bar would be and
then basically test if the start of the dragging location is in the
frame of that CustomView.
This all sounds good, but I'm a little at a loss as how to how to
implement it between InterfaceBuilder and Xcode. I've added a
customview object from the tool palette, then subclassed NSView in the
MainMenu.nib window. I then select the CustomView in the application
window, and in the Inspector select the new Custom Class.
All of that sorta makes sense to me, but this is where I really start
to lose it.
Back in Xcode I need to try and access that Custom View, and I really
just don't know where to start. If the class is called TitleBarView,
can I just reference it by that name in the code, e.g.:
[TitleBarView frame]
Or do I actually have to build a custom class in code subclassing
NSView as well? Any help would be greatly, greatly appreciated.
I'm throwing another simple question in too. What exactly would I use
to put a tiling background in where the title bar should be? To give a
visual representation of what area is draggable and all? Can I add in
an NSImage to the CustomView to put an image in, and if so, how do I
tell it to tile that image across the available area?
Thanks a ton!
Wes
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden