Name
SetIconProperties -- change properties of an Amiga icon (V4.5)
Synopsis
SetIconProperties(file$, type[, tooltypes, deftool$])
Platforms
AmigaOS and compatibles only

Function
This function can be used to change properties of an Amiga icon in the *.info format. You can change the icon's type, its tooltypes, as well as the icon's default tool. The default tool is only used for icons that are of the type #AMIGAICON_PROJECT.

The type argument must be set to one of the following constants:

#AMIGAICON_DISK:
An icon of a drive (e.g. RAM, HD, CD-ROM, etc.)

#AMIGAICON_DRAWER:
An icon of a drawer.

#AMIGAICON_TOOL:
An icon of a program

#AMIGAICON_PROJECT:
An icon of a project. A project is a data file that can be opened by an other program. The program that should be used to open the project should be passed as deftool$. E.g. "SYS:Utilities/MultiView".

The tooltypes argument is optional and you only need to specify it if you would like to set tooltypes for the icon. To do that, you have to pass a table in the tooltypes argument. The table must contain a list of subtables, one subtable per tooltype entry. Each subtable can contain the following tags:

Key:
This tag is mandatory. It specifies the name of the tooltype. Tooltype names should use letters of the English alphabet only. They should always be in upper-case format and must not use any SPACE characters. If you want a SPACE, use an underscore instead ("_"). Furthermore, numbers should not be used as the initial characters of a tooltype name.

Value:
This tag is optional. You can use it to assign a value to the tooltype. If you do not set this value, the tooltype will be a boolean one.

Enabled:
This tag is optional. It defaults to True. If you want to add tooltypes that are initially disabled, you can set this tag to False. In that case, the tooltype will be enclosed by parentheses which means that it is disabled.

The third argument deftool$ is only used for icons of the type #AMIGAICON_PROJECT. If that is the case, you can specify the default tool of the project file associated with this icon. For text files, the default tool is often "SYS:Utilities/MultiView".

To read the properties of an icon, use the GetIconProperties() command.

Inputs
file$
the icon to modify
type
new type for the icon; must be one of the constants from above
tooltypes
optional: a table containing a list of all tooltypes you want to set; each list entry must have at least the Key field set; defaults to {} (empty table)
deftool$
optional: the default tool to set for this icon; will only be set for icons of type #AMIGAICON_PROJECT; defaults to ""
Example
SetIconProperties("MyCoolScript.hws.info", #AMIGAICON_PROJECT, {
{Key = "BORDERLESS"},
{Key = "BACKFILL", Value = "GRADIENT"},
{Key = "STARTCOLOR", Value = "$000000"},
{Key = "ENDCOLOR", Value = "$0000ff"},
{Key = "FIXED", Enabled = False} }, "Hollywood:System/Hollywood")
The code above sets Hollywood as the default tool for "MyCoolScript.hws". Furthermore, it adds several tooltypes to the script's icon that tell Hollywood what eye candy it should add to the script (e.g. gradient backfill).

Show TOC