Re: Dropping controls on subclassed NSView
Re: Dropping controls on subclassed NSView
- Subject: Re: Dropping controls on subclassed NSView
- From: "John C. Randolph" <email@hidden>
- Date: Sat, 18 Mar 2006 08:38:44 -0800
On Mar 9, 2006, at 10:21 AM, Ryan Hisey wrote:
Hi
I am having some issues with placing controls such as NSPopUpButton
on my sublassed NSView in Interface Builder. It's causing graphical
bugs in the drawing of the view. This can easily be reproduced with
a new project.
First I create a CustomView in a new window, and change it's class
to my subclassed NSView. My code for this subclassed NSView
includes drawing a border around the view, some text near the top,
and a small graphic. Next I place 3 or so NSPopUpButtons directly
below one another, or other controls in this view, within IB. When
I build the project I am seeing graphical bugs appearing around the
controls. It's basically redrawing the content described above, in
what looks like the control's content rect.
Can anyone explain to me why this happens, is this a known bug, or
is it just a misunderstanding on my part on how to add controls to
my custom view? I wanted to go through IB for easy connections to
my File's Owner.
Thanks for any insight you can pass along.
Your views are overlapping, but they're at the same level of the view
hierarchy. In such a case, the oder of drawing is indeterminate.
Make your controls subviews of your custom view with -addSubview:
-jcr
_______________________________________________
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