Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "AmigaOS Manual: Workbench ARexx Port"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
(Created page with "Workbench acts as an ARexx host under the name of "WORKBENCH". It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsysl...")
 
Line 33: Line 33:
 
/* Activate the "Work:" partition's window. */
 
/* Activate the "Work:" partition's window. */
 
ACTIVATEWINDOW 'Work:'
 
ACTIVATEWINDOW 'Work:'
  +
</syntaxhighlight>
  +
  +
= CHANGEWINDOW command =
  +
  +
; Purpose:
  +
: This command will attempt to change the size and the position of a window.
  +
  +
; Format:
  +
: CHANGEWINDOW [WINDOW] <ROOT|ACTIVE|Drawer name> [[LEFTEDGE] <new left edge position>][[TOPEDGE] <new top edge position>][[WIDTH] <new window width>][[HEIGHT] <new window height>]
  +
  +
; Template:
  +
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N
  +
  +
; Parameter:
  +
: WINDOW
  +
:: Either "ROOT" to resize/move the Workbench root window (where volume icons and AppIcons live), "ACTIVE" to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.
  +
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.
  +
  +
: LEFTEDGE
  +
:: New left edge window position.
  +
  +
: TOPEDGE
  +
:: New top edge window position.
  +
: WIDTH
  +
:: New window width.
  +
: HEIGHT
  +
:: New window height.
  +
  +
; Errors:
  +
: 10 - If the named window cannot be changed; this can also happen if you specified ACTIVE" as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.
  +
  +
; Result:
  +
: -
  +
  +
; Notes:
  +
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example "Work:" is a fully qualified name, and so is "SYS:Utilities". "Devs/Printers" would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.
  +
  +
; Example:
  +
  +
<syntaxhighlight>
  +
/* Change the root window; move it to position 10,30. * and change its size to 200100 pixels. */
  +
ADDRESS workbench
  +
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100
  +
  +
/* Change the currently active window. */
  +
CHANGEWINDOW active 20 40 200 100
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 23:23, 23 January 2014

Workbench acts as an ARexx host under the name of "WORKBENCH". It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.

ACTIVATEWINDOW command

Purpose
This command will attempt to make a window the active one.
Format
ACTIVATEWINDOW [WINDOW] <ROOT|Drawer name>
Template
ACTIVATEWINDOW WINDOW
Parameters
WINDOW
Either "ROOT" to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.
If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.
Errors
10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.
Result
-
Notes
If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example Work:" is a fully qualified name, and so is SYS:Utilities". Devs/Printers" would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.
Example
/* Activate the root window. */ ADDRESS workbench

ACTIVATEWINDOW root   /* Activate the "Work:" partition's window. */ ACTIVATEWINDOW 'Work:'

CHANGEWINDOW command

Purpose
This command will attempt to change the size and the position of a window.
Format
CHANGEWINDOW [WINDOW] <ROOT|ACTIVE|Drawer name> [[LEFTEDGE] <new left edge position>][[TOPEDGE] <new top edge position>][[WIDTH] <new window width>][[HEIGHT] <new window height>]
Template
CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N
Parameter
WINDOW
Either "ROOT" to resize/move the Workbench root window (where volume icons and AppIcons live), "ACTIVE" to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.
If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.
LEFTEDGE
New left edge window position.
TOPEDGE
New top edge window position.
WIDTH
New window width.
HEIGHT
New window height.
Errors
10 - If the named window cannot be changed; this can also happen if you specified ACTIVE" as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.
Result
-
Notes
If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example "Work:" is a fully qualified name, and so is "SYS:Utilities". "Devs/Printers" would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.
Example
/* Change the root window; move it to position 10,30. * and change its size to 200100 pixels. */
ADDRESS workbench
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100
 
/* Change the currently active window. */
CHANGEWINDOW active 20 40 200 100