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

NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView


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

I am attempting to write an IB palette for a custom subclass of NSTabView. Since there's no public access to NSTabViewInspector.h, I've had to implement much of the existing standard functionality. In particular, I've had to implement changing the number of NSTabViewItems.

Everything works with the exception of one not-so-small detail: when I add new NSTabViewItems, the custom NSTabView subclass is updated as expected and new NSTabViewItem objects appear, but when I single- click on them, I get the regular (non-IB) behavior, namely, the tabs are selected (and the views under them are switched in) just as if I was running in simulation mode. The same thing happens if I double- click on them.

But I'm not yet in simulation mode. I'm still in editing/design mode, and I should be getting the behavior that, upon single-clicking, the view under an NSTabViewItem should be activated so that I can drag controls from the IB palettes into it. Moreover, when double-clicking on a NSTabViewItem, its label should enter edit mode.

The relevant bit of (pseudo) code is as follows:

in the -(void)ok:(id)sender method, I check whether the user is requesting more items
if so, then repeat the following as many times as necessary
{
NSString *label = [NSString stringWithFormat :@"Tab %i", index];
NSString *identifier = [NSString stringWithFormat :@"%i", index];


NSTabViewItem *item = [[NSTabViewItem alloc] initWithIdentifier :identifier];

  [item setLabel :label];
  [[self object] addTabViewItem :item];

  [item release];
}

where index increases by one with every iteration. This works fine to get the custom TabView to display new NSTabViewItem objects, but how do I make those new objects respond to mouse clicks in the same way as those added when using the standard NSTabView palette?

Thanks in advance for any help.
Wagner
_______________________________________________
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


  • Follow-Ups:
    • Re: NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Core Data and auto increment
  • Next by Date: Re: NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView
  • Previous by thread: Re: Core Data and auto increment
  • Next by thread: Re: NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView
  • Index(es):
    • Date
    • Thread