Objective-Everything Release 5. Copyright ©1994-1998 by TipTop Software, Inc. All Rights Reserved.
Lookup object by name. If name represents an illegal object ValueError is raised.
py% lookup("NSObject") Class.NSObject py% x=C.NSObject() py% x <NSObject: 0xfade8> py% lookup('@NSObject@0xfade8') <NSObject: 0xfade8> py% lookup('0xfade8') <NSObject: 0xfade8>
Dynamically links (loads) the specified files.
Returns true if ObjPy object is nil, false otherwise. Raises if o is not an ObjPy object.
print is_nil(nil) # ==> 1 print is_nil(lookup("Object")) # ==> 0 print is_nil("hello") # ==> raises
Returns an error description if o is a bad ObjPy object, or if o is not an ObjPy object at all. Returns false (0) if o is a valid ObjPy object. Never raises.
py% o=C.NSObject() py% o.release() py% print is_bad(o) Dealloc'ed object py% print is_bad(123) not an ObjPy object py% print is_bad(nil) 0
Returns true if object is automatically retained/released by ObjPy. Only NSAutoreleasePools are not automatically retained/released.
Returns a method object (callable) for target with name. If the class argument is included, implementation in that class is targeted. In this case, object target must be a kind of class.
py% o=C.MyObject() # same as: m=o.respondsTo py% m=Method(o,'respondsTo') # m('respondsTo:') is equivalent to [obj respondsTo:@selector(respondsTo:)] # or: o.msg_send('respondsTo:','respondsTo:') py% print m('respondsTo:') 1 py% print m('xyz') 0 # Sending msg to super using Method. # Get the method: py% m=Method(o,'methodWithArg:',o.superclass()) # invoke it: py% m(args...)
Converts Python object py to its ObjPy equivalent.
Converts ObjPy object obj to its Python equivalent.
The nil object.
py% print str(nil) nil py% print repr(nil) nil py% print type(nil) <type 'ObjPyObject'>
Within a method body, sends super/ex message.
Class namespace. See the "Integration with C" section.
Class lookup helper. Access Objective-Everything classes as attributes.
Returns the Objective-Everything class name. If the class does not exist in the runtime system, an attempt to autoload the class will be made.
Returns a list of all currently loaded classes
Protocol lookup helper. Access protocols as attributes.
Returns protocol name
Returns a list of all protocols known to the system.
CGlob lookup helper. Access C globals as attributes.
Returns the value of C global name.
Assigns value val to C global name.
Returns a list of C global variable names.
Get various runtime information. See the "Introspection" section.
ObjPyObject type is used to represent a generic object (id) in the Python domain.
Sends a regular, super, or ex mesage to o.
Returns whether o has an instance variable key.
Returns a list of o's instance variable names.
Returns a list of o's instance variable values.
Returns a list of o's instance variable names and values.
Returns the number of instance variables of o
Returns o's instance variable accessor object.
Returns o's attribute variable accessor object.
ObjPySeqObject type is used to represent NSArrays in the Python domain.
Appends object v to array a.
Returns number of occurences of object v in array a.
Returns index of object v in array a.
Inserts object v into array a at index i.
Sorts array a.
Removes element v from array a.
Reverses array a.
Compares arrays a and b.
Gets/sets the i-th element of array a.
Gets/sets the slice i:j of array a.
Retuns an array which is the result of concatenation of a and b.
Repeats a i times.
Number of elements in a.
ObjPyMapObject type is used to represent NSDictionaries in the Python domain.
Returns whether d has key.
Returns a list of d's keys.
Returns a list of d's values.
Returns a list of d's key names and values.
Returns the number of elements in d.
Gets/sets the key value of dictionary d.
Compares dictionaries d and e.
ObjPyClassObject type is used to represent Objective-Everything classes in the Python domain.
Constructs an instance of the class. The number of arguments determines which constructor is used. The initial constructor table is loaded at the startup time from the ObjCore.conmap file. The init keyword argument can be used to explicitly specify which constructor to use. The selector name can start with + or -.
Without any arguments, this method returns a list of constructors for this class. With arguments, this method specifies constructors for clazz. Each selector name can start with + or -.
Rename clazz.
Subclass clazz with class named name, and instance variables ivarspec.
Subclass clazz with Python class pyclass.
Creates category for clazz.
Binds methods into clazz.
ObjPyMethod type is used to represent method invocations.
Invokes method with args.
Selector name.
Target of the method.
Argument count.
Argument types. Return type is element 0.
Method signature.
To load AppKit, simply import the AppKit module.
This brings in the AppKit and ObjAppKit frameworks. NOTE: If dynamically loading, you must import the ObjPy module first!
Runs the AppKit main event loop.
Asynchronously executes callable. If the delay argument is specified, callable is executed after delay seconds.