setIcon

>>--setIcon(--newImage--)------------------------------------------------------><

Sets or removes the icon image for this static control. This method only effects the image type static control. For instance an icon can not be set for a frame or rectangle.

Details

Raises syntax errors when incorrect arguments are detected.

The programmer should manage the image objects as he thinks best. See the .Image documentation for a discussion of this. The static control does not make a copy of the icon, nor does it release an icon image.

Arguments:

The single argument is:

newImage

A .Image object that represents the image for the control, or .nil to remove an existing image. The image object must be an icon image.

Return value:

This method returns the existing image object, if there is one. Otherwise .nil is returned.

Example:

icon = .Image~getImage(.Image~toID(IDI_QUESTION), .Image~toID(IMAGE_ICON))
if \ icon~isNull then do
  oldIcon = iconControl~setIcon(icon)
  ...
end
else do
  -- handle error
  ...
end