Re: addsubview
Re: addsubview
- Subject: Re: addsubview
- From: koko <email@hidden>
- Date: Fri, 20 Apr 2012 13:02:36 -0600
On Apr 20, 2012, at 12:13 PM, Keary Suska wrote:
> On Apr 20, 2012, at 9:19 AM, koko wrote:
>
>> Here is the code that creates and adds the subview ....The method -makeAndWrapViews is in the custom class of the NSTabViewItem view.
>>
>> I do get -viewDidMoveToSuperview when addSubview is called.
>>
>> When the tab is clicked I do get viewdidMoveToWindow
>>
>> But I never see thev iew!
>>
>> - (void)makeAndWrapViews
>> {
>> NSRect frame = [self frame];
>
> Who is "self" here? Is it the tab view item view? If so, does the tab view item know that you are using a custom subclass? Lastly, what is the origin point (to make sure it isn't being placed outside the viewable area)?
self is the custom class of the view that is owned by the tab view item.
you do not use a custom class for the tab view item
the origin is 10,25
>
>> frame.size.width = 288;
>> frame.size.height = 259;
>>
>> m_text = [[NSPDText alloc] initWithFrame:frame];
>>
>> BOOL text = [NSBundle loadNibNamed:@"NSPDText" owner:m_text];
>>
>> if (text)
>> {
>> [self addSubview:m_text];
>> }
>> }
>
> Does this code work when you substitute NSPDText with a canned cocoa UI object?
Yes. I created an NSButton in the same method, added it and it displays.
>
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden