• 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
Re: NSTabView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTabView


  • Subject: Re: NSTabView
  • From: Graham Cox <email@hidden>
  • Date: Thu, 12 Sep 2013 17:35:40 +0200

On 12/09/2013, at 5:25 PM, Joseph Ayers <email@hidden> wrote:

> I created a delegate procedure in the window controller
>
> - (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem
> {
>     AppDelegate *appDelegate = [NSApp delegate];
>     if (tabViewItem == [[appDelegate graphicsWindowController] scopeItem]){
>         NSLog(@"Scope Item Selected");
>     }
>     else if (tabViewItem == [[appDelegate graphicsWindowController] graphItem]){
>     NSLog(@"GraphItem Selected");
>     }
>
> }
> That never gets called. Hence my question about the target action of the tabs. When I first create the oscilloscope tab the oscilloscope gets drawn,
> but if I then create a graphViewItem it draws a blank screen. If I then click on the oscilloscope tab, the oscilloscope image doesn't come back.
>


Are you sure it never gets called, or is it that neither statement is ever logged?

The NSTabViewItem is NOT the same object as the view it hosts, so your conditionals will always return false. [NSTabViewItem view] is the object you're looking for.

That said, the rest of your code (which is rather difficult to read) does not appear to be setting the view - or I may have missed it, or it might be being done in a method not shown here.

I've done this sort of thing a few times and it's fairly straightforward. You appear to be making heavy weather of it. All you need to do is to call -setView: for each tab view item with the views you want to add to the tab. It should do the rest.


--Graham


_______________________________________________

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: NSTabView
      • From: Graham Cox <email@hidden>
References: 
 >NSTabView (From: Joseph Ayers <email@hidden>)
 >Re: NSTabView (From: Graham Cox <email@hidden>)
 >Re: NSTabView (From: Joseph Ayers <email@hidden>)

  • Prev by Date: Re: Analyser reports memory leak… where?
  • Next by Date: Re: Analyser reports memory leak… where?
  • Previous by thread: Re: NSTabView
  • Next by thread: Re: NSTabView
  • Index(es):
    • Date
    • Thread