Skip navigation.
 
mlNSTabView delegate question
FROM : Manooch Khajeh
DATE : Sat Dec 14 18:54:08 2002

I am working on a 'System Preferences' plug-in which has 2 tabs.  When
I get a click on a tab, I like to update the contents of the text
fields in that tabview.

I have created a NSObject called infoPaneDelegate which I create and
pass it a pointer to the main object.  When I click on a tab, I do get
the willSelectTabViewItem call.  In there, I send a message to my main
code to redraw the content, but the call [cMacWirelessConfig
informationInit] never happens.

Below please see the simple code.  Would you please let me know what I
am doing wrong?

thanks,
Manooch


// main code
//
- (void)didSelect
{
   kern_return_t    rc;

   cInfoPaneDelegate = [[infoPaneDelegate alloc] init];
   rc = [cInfoPaneDelegate initInfoPaneDelegate:self];
   if (rc != noErr)
   {
       NSLog (@"MacWirelessConfig:didSelect:initInfoPaneDelegate failed.
rc=%d\n", rc);
       return;
   }





//
//  infoPaneDelegate.h
//
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>

@class ComMacWirelessConfig;

@interface infoPaneDelegate : NSObject
{
   // MacWirelessConfig class
   ComMacWirelessConfig    cMacWirelessConfig;
}

- (kern_return_t)
initInfoPaneDelegate:(ComMacWirelessConfig)pMacWirelessConfig;
- (void)tabView:(NSTabView*)tabView
willSelectTabViewItem:(NSTabViewItem*)tabViewItem;
@end







//
//  infoPaneDelegate.m
//
#import "infoPaneDelegate.h"
#import "MacWirelessConfigUI.h"


@implementation infoPaneDelegate

- (kern_return_t)
initInfoPaneDelegate:(ComMacWirelessConfig)pMacWirelessConfig
{    
   NSLog (@"MacWirelessConfig:infoPaneDelegate.m:initInfoPaneDelegate\n");
   
   cMacWirelessConfig = pMacWirelessConfig;
   
   return kIOReturnSuccess;
}


- (void)tabView:(NSTabView*)tabView
willSelectTabViewItem:(NSTabViewItem *)tabViewItem;
{
//    kern_return_t    rc;

   NSLog
(@"MacWirelessConfig:infoPaneDelegate.m:willSelectTabViewItem\n");

   [cMacWirelessConfig informationInit];
}

@end
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
No related mails found.