• 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: NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView


  • Subject: Re: NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView
  • From: Wagner Truppel <email@hidden>
  • Date: Sat, 29 Jul 2006 07:31:58 -0700

Hi Ricky,

thank you for replying so quickly. I like the simplicity of your solution and I'm now inclined to implement my palette that way, but I'm still curious as to how to solve the problem with an approach along the lines of what I've done so far. I'm fairly new at Cocoa and I'm trying to understand what is missing in my current approach.

Thanks again.
Wagner

On Jul 29, 2006, at 6:55 AM, Ricky Sharp wrote:

One thing you could do is have your NSTabView subclass implement a protocol. Methods on the protocol would be the accessors for the additional attributes the subclass would have, along with any other support API. Then, in your palette's willInspectObject: method, do something like this:

- (void)willInspectObject:(NSNotification*)aNotification
{
    id theObject = [aNotification object];

    if ([theObject conformsToProtocol:@protocol(YourSpecialProtocol)])
        addInspectorModeWithIdentifier:@"My NSTabView Attributes"
            forObject:theObject
            localizedLabel:@"Some label"
            inspectorClassName:@"YourCustomInspectorClass"
            ordering:-1.0];
}

You then do _not_ implement the inspectorClassName method on the subclass of NSTabView.

So, whenever an instance of your subclass is selected in IB, you should then see the default NSTabView inspector and then gain an additional inspector pane (appended to the end of popup menu item list; hence the -1.0 ordering) to handle your additional attributes.

The really nice thing about this approach is that if Apple ever adds other attributes to NSTabView over time, you'll gain access to those without modifications to your palette since you're now using two inspectors (default Apple-supplied inspector, plus one to handle your additions).


_______________________________________________
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


References: 
 >NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView (From: Wagner Truppel <email@hidden>)
 >Re: NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: NSTextField subclass - not using NSTextFieldCell subclass when unarchived from nib?
  • Next by Date: Re: NSSearchField - detect loss of focus
  • Previous by thread: Re: NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView
  • Next by thread: NSTextField subclass - not using NSTextFieldCell subclass when unarchived from nib?
  • Index(es):
    • Date
    • Thread