• 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
Problem using InterfaceBuilder with Automator Action
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem using InterfaceBuilder with Automator Action


  • Subject: Problem using InterfaceBuilder with Automator Action
  • From: Timothy Mowlem <email@hidden>
  • Date: Sun, 12 Mar 2006 19:00:21 +0000

Hello,

I am having some problems getting interface builder to work as I need while creating an Automator action. I created a simple test project with just the bare bones to see if that solved the problem but it hasn't (although the symptoms have changed so I am probably making at least two separate mistakes)!!

I am writing some shell script based Automator actions which normally inherit from AMShellScriptAction. I have a simple GUI having an NSPopUpButton and an NSTextField. The textfield displays a simple help text which varies depending on the selection of the popup. In order to be able to respond to popup selection changes by setting the text via Target-Action I need my own class since I need to add an outlet and a method, so I have created a simple class named GUIController which inherits from AMShellScriptAction.

In IB I have a NSTextField and a NSPopUpButton on the action's view. I have selected AMShellScriptAction under the classes tab and chose menuitem "Classes->Read Files..." and choose GUIController.h. Then I set the File's Owner to be of custom class GUIController.

Now I can control drag from File's Owner to the NSTextField and connect the text outlet to the NSTextField. This works fine.

BUT when I control drag from NSPopUpButton to File's Owner the connections list shows "target" greyed out. I don't understand why this is.
Can anyone help here please?



Thanks,

Tim Mowlem


.h file:

#import <Cocoa/Cocoa.h>
#import <Automator/AMShellScriptAction.h>


@interface GUIController : AMShellScriptAction { IBOutlet NSTextField *text; }

- (IBAction) setText: (id) sender;

@end


.m file:


#import "GUIController.h"


@implementation GUIController

- (IBAction) setText: (id) sender
{
	int idx = [sender indexOfSelectedItem];
	if (idx == 0)
	{
		[text setStringValue: @"Leopard");
	}
	else if (idx == 1)
	{
		[text setStringValue: @"Tiger");
	}
	else
	{
		[text setStringValue: @"Panther");
	}
}

@end

_______________________________________________
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


  • Prev by Date: Embedding image data
  • Next by Date: Re: Sheet in a non-document-based Application
  • Previous by thread: Re: Embedding image data
  • Next by thread: [Meet] UK Mac Developers (London) - Monday 13th March
  • Index(es):
    • Date
    • Thread