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: 31.12.2000 (GToolKit/GTKAction.h)

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

Methods

+ (id) actionWithTarget:(id) _target selector:(SEL) _selector
Create an autoreleased GTKAction that will send selector to target.

See also: -performWithSender:args:count:

+ (id) actionWithTarget:(id) _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 (if it is an object).

- (id) init

Initialize a new GTKAction without target and selector.

See also: -setTarget:selector:

- (id) initWithTarget:(id) _target selector:(SEL) _selector

Initialize a new GTKAction that will send selector to target.

See also: -performWithSender:args:count:

- (id) initWithTarget:(id) _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 (if it is an object).

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

Set the receiver's target and/or selector. If target is nil or selector is 0, the previous target or selector 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 (or nil).

- (id) 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:(id) 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.

Note: The current implementation will only pass up to 6 arguments from the args array. If it contains more values, the argument list will be truncated.

See also: -connectSignal:withAction: in class GTK


generated Thu Jan 4 20:20:23 2001 by Objcdoc