How do I get access to the control within a NSToolbarItem?
How do I get access to the control within a NSToolbarItem?
- Subject: How do I get access to the control within a NSToolbarItem?
- From: Daryle Walker <email@hidden>
- Date: Sun, 03 Aug 2014 14:11:45 -0400
I’m adding a combined Back/Forward toolbar button to my web browser project. I was going to enable/disable each button half like:
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
// Ignore notices from sub-frames
if ((self.webView == sender) && (frame == [sender mainFrame])) {
[self.toolbarBackForward setEnabled:[sender canGoBack] forSegment:kPrGoBackSegment];
[self.toolbarBackForward setEnabled:[sender canGoForward] forSegment:kPrGoForwardSegment];
}
}
But I was getting problems with the method signatures being unrecognized. Then I realized that the control I dragged from the XIB to the header file was a NSToolbarItem*, not the NSSegmentedControl* I was expecting. How do I get to that inner control? (Hopefully without wasting time making a subclass.)
—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com
_______________________________________________
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