Re: addSubView: [NSView subviews] doesn't show any subviews, after adding subviews. ****Revised****
Re: addSubView: [NSView subviews] doesn't show any subviews, after adding subviews. ****Revised****
- Subject: Re: addSubView: [NSView subviews] doesn't show any subviews, after adding subviews. ****Revised****
- From: "Frederick C. Lee" <email@hidden>
- Date: Fri, 18 Nov 2005 16:03:00 -0800
Revision:
I essentially added another NSImageView to the mix so that after
clicking the button 'add SubViews' I should get two (2) subviews
within the container.
Scenario:
1) The container view is a subClass of NSBox (so I can visually see
the outline of the container). The ricImageView, etc. are just small
thumbnail images.
2) I got suspicious about seeing ONLY ONE (1) NSView under the
container view when I clearly added two (2) views.
So I looked inside this one NSView and found the two subviews
that I was originally searching for.
(gdb) cont
Continuing.
2005-11-18 15:55:53.819 Global Village[24379] {GVDocument.m: addSubView}
2005-11-18 15:55:53.820 Global Village[24379] {GVContainerView.m:
addSubview}
2005-11-18 15:55:53.821 Global Village[24379] {GVContainerView.m:
addSubview}
(gdb) po [gvContainerView subviews]
<NSCFArray 0x362170>(
<NSView: 0x3918a0>
)
(gdb) po [[gvContainerView subviews] objectAtIndex:0]
<NSView: 0x3918a0>
(gdb) po [[[gvContainerView subviews] objectAtIndex:0] subviews]
<NSCFArray 0x3ca130>(
<NSImageView: 0x3968a0>,
<NSImageView: 0x3d7390>
)
3) I don't know what this middle 'NSView' object is. Perhaps its the
Context View of GVContainerView? I don't know.
I just had to drill DEEPER to find the subviews.
Ric.
Correct.
ricImageView is a simple image and is not null:
(gdb) po ricImageView
<NSImageView: 0x397200>
(gdb) po [ricImageView image]
NSImage 0x396600 Size={65, 45} Reps=(
NSBitmapImageRep 0x397060 Size={65, 45}
ColorSpace=NSCalibratedRGBColorSpace BPS=8 BPP=24 Pixels=65x45
Alpha=NO Planar=NO Format=0
)
(gdb)
On Nov 18, 2005, at 3:18 PM, Joseph Kelly wrote:
Is ricImageView non-null?
joe
On Nov 18, 2005, at 3:14 PM, Frederick C. Lee wrote:
Greetings:
I just wanted to add subviews to a container view: eventually
having n-rows and n-columns of subviews within a container view.
I want to manage those views via the container view's subviews
array. But as you can see, the container array doesn't get
populated by new subviews.
What am I missing?
Regards,
Ric.
Before Adding Subview:
(gdb) po [gvContainerView subviews]
<NSCFArray 0x394890>(
<NSView: 0x394ba0>
)
After Adding Subview:
(gdb) po [gvContainerView subviews]
<NSCFArray 0x394890>(
<NSView: 0x394ba0>
)
- (IBAction)addSubView:(id)sender {
NSLog(@"{GVDocument.m: addSubView}");
[gvContainerView addSubview:ricImageView];
NSRect myRect;
myRect.origin.x = 10; myRect.origin.y = 10;
myRect.size.width = 60; myRect.size.height = 60;
[ricImageView setFrame:myRect];
[gvContainerView setNeedsDisplay:YES];
return;
}
_______________________________________________
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
_______________________________________________
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