# Class GTKAction

The GTKAction class manages connections between objects. Instances of this class can be passed as arguments to GTK's -connectSignal:withAction: methods.

### Class-Hierarchy:

        NSObject
          |
          +---GTKAction

## Class GTKAction inherits from NSObject

Last modified: 15.1.2000 (GToolKit/GTKAction.m)

## Instance Variables

protected id target
  target object of this action
protected SEL selector
  target selector to perform
protected IMP method
  target function pointer
protected void *data
  optional user data
protected BOOL retained
  user data should be retained

## Method Index

- creating actions
  + actionWithTarget:target selector:(SEL) selector
  + actionWithTarget:target selector:(SEL) selector data:(const void *) data
  - initWithTarget:target selector:(SEL) selector
  - initWithTarget:target selector:(SEL) selector data:(const void *) data
  - (void) retainData
  - (void) setData:(const void *) data
  - (void) setTarget:target selector:(SEL) selector
- inspecting action values
  - (void *) data
  - (BOOL) dataRetained
  - (SEL) selector
  - target
- invoking an action
  - (void) performWithSender:sender args:(GtkArg *) args count:(unsigned) count

## Methods

+ actionWithTarget:_target selector:(SEL) _selector

  Create an autoreleased GTKAction that will send selector to target.

  See also: -performWithSender:args:count:

+ actionWithTarget:_target selector:(SEL) _selector data:(const void *) _data

  Create an autoreleased GTKAction that will send selector to target. data will be passed as an additional argument to the method. Note that data is not retained by default.

- init

  Initialize a new GTKAction without selector and target.

  See also: -setTarget:selector:

- initWithTarget:_target selector:(SEL) _selector

  Initialize a new GTKAction that will send selector to target.

  See also: -performWithSender:args:count:

- initWithTarget:_target selector:(SEL) _selector data:(const void *) _data

  Initialize a new GTKAction that will send selector to target. data will be passed as an additional argument to the method. Note that data is not retained by default.

- (void) setTarget:_target selector:(SEL) _selector

  Set the receiver's target and/or selector. If target is `nil` or selector is `NULL`, the previous value is not changed.

- (void) setData:(const void *) _data

  Set the receiver's user data.

- (void) retainData

  Tell the receiver to retain its user data. Use this only if the data really is some kind of NSObject.

- target

  Return the current target of this action.

- (SEL) selector

  Return the current selector of this action.

- (void *) data

  Return the current user data of this action.

- (BOOL) dataRetained

  Return whether the user data should be retained.

- (void) performWithSender:sender args:(GtkArg *) args count:(unsigned) count

  Send the current selector to the target. The action will pass the sender object, count arguments from the argument array starting at args and the user data (if it has been set) to the method. The return value will be stored in args[count], which must contain the correct type information for the return value.

  If the selector's return type is `void` and count is `0`, args may be `NULL`.

  See also: -connectSignal:withAction: in class GTK

generated Wed Jan 19 1:31:44 2000 by Objcdoc