• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Nested Views in different *.XIB files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Nested Views in different *.XIB files


  • Subject: Nested Views in different *.XIB files
  • From: "Mazen M. Abdel-Rahman" <email@hidden>
  • Date: Sat, 24 Oct 2009 22:02:47 -0700

Hi All,

My goal is to have a split view with a left side pane containing an outline view - and 3 panes on the right on top of each other. To do this I did the following:

1) created a split view that is split horizontally into 3 parts.
2) I then created another split view that is split vertically into 2 parts - and put the split view created in step 1 in the right pane. The left pane has an NSOutlineView.


In one of the split view panes I put a NSTabView - and inside that NSTabView I wish to put a form with labels, text boxes, etc. that is also scrollable. I would also like to have the view with the form elements defined in a separate *.xib (PatientsDemoForm.xib) file from the main *.xib (MainMenu.xib).

I was able to set the content view of one of the NSTabViewItems to be the view that's defined in the other *.xib - but I am having trouble embedding that view in an NSScrollView. When it's *.xib file open and I have the view selected all the options under "Layout->Embed Objects In" are disabled.

I started looking at doing it programatically. I was wondering if anyone could tell me if this is the best way to go about it - or if there is a better way?

//Get the view from the View controller
NSView * v = [patientDemoVC view];
//Create a clibView
NSClipView * clipView = [[NSClipView alloc] init];
//Attach the view (i.e. the one that contains the form mentioned above) to the clibView
[clipView setDocumentView:v];
//Create a scrollView
NSScrollView* scrollView = [[NSScrollView alloc] init];
//Attach the clibView to the scrollView
[scrollView setContentView:clipView];

//Set the scrollView as the content view of the tabview item.
NSTabViewItem * tvi = [[NSTabViewItem alloc] init];
[tvi setView:scrollView ];


I know that there is still some things I need to do in order to get this to work - but I really would like to find out if I am going about it the right way - or if I am "barking up the wrong tree.".

Thanks for your help!
Mazen Abdel-Rahman
_______________________________________________

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


  • Follow-Ups:
    • Re: Nested Views in different *.XIB files
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: IKImageBrowserView Dragging outside
  • Next by Date: Re: Nested Views in different *.XIB files
  • Previous by thread: Re: NSComboBoxCell in a NSTableView
  • Next by thread: Re: Nested Views in different *.XIB files
  • Index(es):
    • Date
    • Thread