Unit 'icon' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#morphunits]

GetDiskObjectNew

Read in a Workbench disk object from disk.

Declaration

Source position: icon.pas line 359

function GetDiskObjectNew(

  const name: pCHAR

):PDiskObject;

function GetDiskObjectNew(

  const name: RawByteString

):PDiskObject;

Arguments

name

  

Name of the object or nil if you just want a DiskObject structure allocated for you (useful when calling AddAppIcon() in workbench.library).

Function result

The Workbench disk object in question

Arguments

name

  

Name of the object or nil if you just want a DiskObject structure allocated for you (useful when calling AddAppIcon() in workbench.library).

Description

This routine reads in a Workbench disk object in from disk. The name parameter will have ".info" postpended to it, and the icon file of that name will be read. If the call fails, it will return zero. The reason for the failure may be obtained via IoErr().

Using this routine protects you from any future changes to the way icons are stored within the system.

A TFreeList structure is allocated just after the DiskObject structure; FreeDiskObject() makes use of this to get rid of the memory that was allocated.

This call is functionally identical to GetDiskObject() with one exception. If its call to GetDiskObject() fails, this function calls GetDefDiskObject(). This is useful when there is no .info file for the icon you are trying to get a disk object for. Applications that use workbench application windows must use this call if they want to handle the user dropping an icon (that doesn't have a '.info' file) on their window.

See also

IoErr()

  

Return extra information from the system

DeleteDiskObject

  

Delete a Workbench disk object from disk.

FreeDiskObject

  

Free all memory in a Workbench disk object.

GetDiskObject

  

Read in a Workbench disk object from disk.

GetIconTagList

  

Retrieve an icon

NewDiskObject

  

Create an empty icon

PutDiskObject

  

Write out a DiskObject to disk.

PutIconTagList

  

Store an icon

AddAppIconA

  


Documentation generated on: 2021-07-30