IB problem with object hierarchy
IB problem with object hierarchy
- Subject: IB problem with object hierarchy
- From: Beat Koch <email@hidden>
- Date: Fri, 13 Dec 2002 10:07:30 +0100
In have added a custom view to my nib-file. On that custom view, I have
put an NSImageView which is as large as the view; it should display a
background image. On top of the image, I've put several text fields. In
design mode, everything looks fine, but in test mode or when the
application is run, the image always hides the text fields. Sending the
image to the back does not help.
I have extracted the hierarchy of the nib-file with nibtool (see below)
and as expected, the NSImageView is on the same level as the text
fields, which probably is the reason for having this problem. The
question is: how can I force the NSImageView to become the parent
object for the text fields? Everything works well if I put the image
view and text fields on a window, but not if I put them on a custom
view.
Just before sending this mail, I've found a solution proposed by Ivan
Myrvold (
http://cocoa.mamasam.com/COCOADEV/2002/05/2/34620.php):
Selecting everything in the view and making it the subview of a box
works for me, too. But why does this work? In the object hierarchy, the
image view is still on the same level as the text fields, so it seems
to be a coincidence that this produces the correct results.
Regards, Beat
Hierarchy = {
"Object 1 <NSCustomObject> (File's Owner)" = {
"Object -1 <IBFirstResponder> (First Responder)";
"Object 5 <NSCustomView> (MyView)" = {
"Object 239 <NSTextField> (NSTextField9)";
"Object 240 <NSTextField> (NSTextField3)";
"Object 313 <NSImageView>";
};
"Object 13 <NSWindowTemplate> (Window)" = {
"Object 14 <NSView>" = {
"Object 95 <NSTextField> (NSTextField23)";
"Object 130 <NSButton> (NSButton)";
};
};
};
}; /* End Hierarchy */
_______________________________________________
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.