Plugin:MirLua/Module/m icolib

From Miranda NG
Jump to: navigation, search
This page contains changes which are not marked for translation.

Allows you to work with icons.

Include module: local icolib = require('m_icolib')

AddIcon

Registers an icon.

Parameters

Parameter name Required Type Description
name Yes string Unique icon name.
description Yes string Description.
section No string Section name in Miranda icon settings. By default plugin name (MirLua) is used.
path No string Default icon file to use. By default path to executable file of Miranda NG is used.

Result

     Type: light userdata

     Returns icon handle if icon was registered successfully, otherwise nil.

Example

local hIcon = icolib.AddIcon('iconUniqueName', 'My super icon')


GetIcon

Returns icon handle.

Parameters

Parameter name Required Type Description
name Yes string Unique icon name.

Result

     Type: boolean

     Returns icon handle if icon was found, otherwise nil.

Example

if icolib.GetIcon('iconUniqueName') then

 print('Icon iconUniqueName exists')

end


GetIconHandle


RemoveIcon

Removes an icon.

Parameters

Parameter name Required Type Description
name Yes string Unique icon name.

Example

icolib.RemoveIcon('iconUniqueName')