Iyonix Select Acorn RISCOS 4 Home About Toolbox Examples Maillist Downloads
AppBasic

Toolbar


General
ResEd
Objects
Components
Events
Methods
Modules

Toolbox objects

Creating objects

Objects are created (in the application's program) using the SWI
SYS &44EC0,,"MyTemplate" TO object
or its veneer equivalent
object=FNToolbox_CreateObject("MyTemplate")
Either of these commands creates an object from the template whose name is MyTemplate. The variable object, whose value is assigned by the Toolbox, is a 32-bit integer known as the object's id. If the template's 'Shared object' flag is set (see below) then only one object can be created with only one object id; otherwise a new object id is assigned each time the template is used.

Showing an object

To show an object on the desktop call
SYS&44EC3,,object,showtype
or its veneer equivalent
PROCToolbox_ShowObject(object,showtype)
where object is the object id and showtype is a parameter indicating how the object is to be shown.

Automatically creating and showing objects

If a template's Auto-create and Auto-show flags are set then an object of that type will be automatically created and shown on the desktop (without the need to write any code).
auto/gif
Setting a template's auto-show and auto-create flags
N.B. When a new AppBasic application is created the iconbar object has its Auto-show and Auto-create flags set.

Attached objects

Objects can be attached to each other. For example, a menu can be attached to an iconbar object (as is the case with a new AppBasic application). As the following figure demonstrates, attaching objects is very easy to do using ResEd.
attach/gif The steps are:
  1. Double-click the Iconbar template (to display its edit dialogue box)
  2. In the section of the dialogue box marked “Select button”, select the 'Show object' option button
  3. Drag the template to be attached to the writable icon (to enter its name. Alternatively, just type the name of the template to be attached)
  4. Select the 'OK' action button to register the changes.
N.B. When an object is created, all of its attached objects are also created