Guia

IUP - Portable User Interface

Resources

Resources are several auxiliary tools including menus, images, fonts and global names.

Some objects like menus and images, that are not inserted in the dialog tree, are in fact associated with dialogs, other controls or exist independent from both. They all must be destroyed independently. When associated with dialogs or controls they must be destroyed after the respective dialog is destroyed. When not they can be destroyed any time.

Menus can be associated with dialogs only. Images can be associated with labels, buttons, toggles and menu items (this last in Windows only).

Both images and menus to be associated use a global table of names. This exist because of the LED scripts. First you associate the image or menu Ihandle to a name, then you associated the MENU or IMAGE attribute to the respective name.

For example, in C:

Ihandle* img = IupImage (11, 11, pixmap) ;
IupSetHandle("myImg", img);
IupSetAttribute(myButton, "IMAGE", "myImg") ;

or in LED:

myImg = image[...] (
...
)
myButton = button[IMAGE = myImg]("")

or in Lua:

myImg = iupimage {
...
}
myButton = iupbutton { title = "", image = myImg }