Blitz3D+ Command Reference

FreeIconStrip icon_strip

Parameters

icon_strip - icon strip to free

Description

Frees an icon strip loaded with LoadIconStrip.

Requires Extended language mode.

Releases the strip's images and invalidates its handle; using the handle afterwards stops with a runtime error.

The nice part: gadgets keep their own copy of a strip's images. A toolbar created from the strip, or a list, combo, tree or tabber given it with SetGadgetIconStrip, is completely unaffected when the source strip is freed - the icons keep drawing. So the tidy pattern is load, assign to every gadget that wants it, then free the strip straight away:

strip=LoadIconStrip("editor_icons.bmp")
SetGadgetIconStrip listBox,strip
SetGadgetIconStrip tree,strip
FreeIconStrip strip

FreeIconStrip 0 is a harmless no-op. Strips you never free are cleaned up when the program ends, so this is about tidiness during a long-running tool, not correctness.

The world editor shell sample shows the toolbar and icon setup this belongs to.

See also: LoadIconStrip, SetGadgetIconStrip, CreateToolBar, FreeGadget.

Index