0

How to change properties of 1 segment in a segmented cell? I can't find it. This is what i've tried:

  • Google
  • Some experimenting: _segmentedcell.SelectedSegment (does not work)

Here is my AppDelegate.h

#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>

@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (weak) IBOutlet NSSegmentedCell *BackForward;
@property (weak) IBOutlet WebView *WebBrowser;
- (IBAction)BackForwardAction:(id)sender;

@property (assign) IBOutlet NSWindow *window;

@end

And here is my AppDelegate.m

#import "AppDelegate.h"

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
}

- (IBAction)BackForwardAction:(id)sender {
    if (_BackForward.selectedSegment == 0) {
        _WebBrowser.goBack;
        if (_WebBrowser.canGoBack == false) {
            //here it does need to disable segment 0
        }
    } else if (_BackForward.selectedSegment == 1) {
        _WebBrowser.goForward;
        if (_WebBrowser.canGoForward == false) {
            // here it does neet to disable segment 1
        }
    }
}
@end
4

1 回答 1

0

我不确定 Google 是如何没有将您引导至的类参考的NSSegmentedControl,但是:

[_BackForward setEnabled:NO forSegment:0];
于 2014-07-28T13:09:35.643 回答