NSTabViewItem objects not responding appropriately to mouse clicks in custom NSTabView
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