Difference between revisions of "Obj.Create"

From OpenEUO
Jump to: navigation, search
m
 
(3 intermediate revisions by 2 users not shown)
Line 8: Line 8:
  
 
   form.Caption = "Test"
 
   form.Caption = "Test"
   form.OnClose = function (pSender) Obj.Exit() return
+
   form.OnClose = function (pSender) Obj.Exit() end
 
   form.Show()
 
   form.Show()
 
   Obj.Loop()
 
   Obj.Loop()
Line 15: Line 15:
 
An object's set event handlers must be defined before, and won't be active until, the script reaches a subsequent Obj.Loop call.  Do not free an object with set event handlers while an Obj.Loop call is active.   
 
An object's set event handlers must be defined before, and won't be active until, the script reaches a subsequent Obj.Loop call.  Do not free an object with set event handlers while an Obj.Loop call is active.   
  
See objects.txt in the openeuo distribution for available objects, their inheritance hierarchies, and associated members.  The object system utilizes Delphi's visual component library; directly consult VCL documentation for a thorough object reference.
+
See objects.txt in the OpenEUO distribution for available objects, their inheritance hierarchies, and associated members.  The object system utilizes Delphi's Visual Component Library (VCL); directly consult VCL documentation for a thorough object reference.
  
 
[[Obj.Loop]]
 
[[Obj.Loop]]
Line 21: Line 21:
 
[[Obj.Free]]
 
[[Obj.Free]]
  
[http://docwiki.embarcadero.com/VCL/en/Unit_List Delphi VCL Reference]
+
[http://docwiki.embarcadero.com/VCL/en/Unit_List VCL Unit Reference]

Latest revision as of 10:13, 17 November 2011

local oref = Obj.Create (str)

Create a gui object of the given class as specified by the string str. e.g.

local form = Obj.Create ("TForm")

instantiates a TForm object and assigns form a pointer to this object. Access members, methods, and event handlers of an object by using dot notation:

 form.Caption = "Test"
 form.OnClose = function (pSender) Obj.Exit() end
 form.Show()
 Obj.Loop()
 Obj.Free(form)

An object's set event handlers must be defined before, and won't be active until, the script reaches a subsequent Obj.Loop call. Do not free an object with set event handlers while an Obj.Loop call is active.

See objects.txt in the OpenEUO distribution for available objects, their inheritance hierarchies, and associated members. The object system utilizes Delphi's Visual Component Library (VCL); directly consult VCL documentation for a thorough object reference.

Obj.Loop

Obj.Free

VCL Unit Reference