SetIconProperties(id, table) SetIconProperties(file$, type[, tooltypes, deftool$]) (Amiga only)
SetIconProperties()
.
There are two ways of using this function: You can either pass the
identifier of an icon in the first parameter and a table in the
second parameter or you can pass the filename of an icon file in
the first parameter and more arguments in the following parameters.
Passing a filename to SetIconProperties()
is only supported on
AmigaOS and compatibles, passing an icon identifier is supported
on all platforms however.
If you choose to pass an icon identifier to SetIconProperties()
, you
have to pass a table in the second argument to specify the actual
properties to modify. The following icon properties can currently
be modified:
Type:
#AMIGAICON_DISK:
#AMIGAICON_DRAWER:
#AMIGAICON_TOOL:
#AMIGAICON_PROJECT:
DefaultTool
tag (see below).
#AMIGAICON_GARBAGE:
##AMIGAICON_DEVICE:
#AMIGAICON_KICKSTART:
(V9.0)
IconX:
IconY:
DrawerX:
Type
is set to a container type like #AMIGAICON_DRAWER
,
this tag can be used to set the x position of the new window that
will be opened when double-clicking the icon. (V9.0)
DrawerY:
Type
is set to a container type like #AMIGAICON_DRAWER
,
this tag can be used to set the y position of the new window that
will be opened when double-clicking the icon. (V9.0)
DrawerWidth:
Type
is set to a container type like #AMIGAICON_DRAWER
,
this tag can be used to set the width of the new window that
will be opened when double-clicking the icon. (V9.0)
DrawerHeight:
Type
is set to a container type like #AMIGAICON_DRAWER
,
this tag can be used to set the height of the new window that
will be opened when double-clicking the icon. (V9.0)
ViewAll:
Type
is set to a container type like #AMIGAICON_DRAWER
,
you can set this tag to True
to tell Workbench to show all files
of the drawer, not just the ones that have an icon. (V9.0)
StackSize:
Type
is set to #AMIGAICON_TOOL
or #AMIGAICON_PROJECT
,
the desired stack size for the program to be launched. (V9.0)
DefaultTool:
Type
is set to #AMIGAICON_PROJECT
, this can be set to
a string containing name (and optionally path) of the program to
open the file with. (V9.0)
ToolTypes:
ToolTypes
tag. The table must contain a list of subtables, one
subtable per tooltype entry. Each subtable can contain the following
tags:
Key:
Value:
Enabled:
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.
Alternatively, you can also set tooltypes by using the
RawToolTypes
tag (see below).
(V9.0)
RawToolTypes:
ToolTypes
tag for some reason, you
can also use RawToolTypes
to set them. In contrast to ToolTypes
,
the RawToolTypes
tag doesn't divide tooltypes into their individual
constituents (key, value, enabled flag). Instead, the RawToolTypes
tag will just copy the tooltypes to the icon without any additional
processing. This makes it possible to store custom data in
tooltypes as well. If you want to do that, just set RawToolTypes
to a table that contains all tooltypes that should be set
as simple strings. (V9.0)
To read the properties of an icon, use the GetIconProperties() command.
Key
field set;
defaults to {} (empty table)#AMIGAICON_PROJECT
; defaults to ""SetIconProperties(1, { Type = #AMIGAICON_PROJECT, DefaultTool = "Hollywood:System/Hollywood", ToolTypes = { {Key = "BORDERLESS"}, {Key = "BACKFILL", Value = "GRADIENT"}, {Key = "STARTCOLOR", Value = "$000000"}, {Key = "ENDCOLOR", Value = "$0000ff"}, {Key = "FIXED", Enabled = False} } })The code above sets the type of icon 1 to
#AMIGAICON_PROJECT
,
the default tool to "Hollywood:System/Hollywood" and adds
some tooltypes.
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).