Before running any of IUP’s functions, function IupOpen must be run to initialize the toolkit.
After running the last IUP function, function IupClose must be run so that the toolkit can free internal memory and close the interface system.
Executing these functions in this order is crucial for the correct functioning of the toolkit.
Between calls to the IupOpen and IupClose functions, the application can create dialogs and display them.
Therefore, usually an application employing IUP will have a code in the main function similar to the following:
int main(int argc, char* argv[]) { if (IupOpen(&argc, &argv) == IUP_ERROR) { fprintf(stderr, "Error Opening IUP.") return; } ... IupMainLoop(); IupClose(); return 0; }
LED is a dialog-specification language whose purpose is not to be a complete programming language, but rather to make dialog specification simpler than in C.
In LED, attributes and expressions follow this form:
elem = element[attribute1=value1,attribute2=value2,...](...expression...)
The names of the elements must not contain the “iup” prefix. Attribute values
are always interpreted as strings, but they need to be in quotes (“…”) only when
they include spaces. The “IUP_” prefix must not be added to the names of the
attributes and predefined values. Expressions contain parameters for creating
the element.
In LED there is no distinction between upper and lower case, except for
attribute names.
Though the LED files are text files, there is no way to interpret a text in memory – there is only the IupLoad function, which loads a LED file and creates the IUP elements defined in it. Naturally, the same file cannot be loaded more than once, because the elements would be created again. This file interpretation does not map the elements to the native system.
The LED files are dynamically loaded and must be sent together with the application’s executable. However, this often becomes an inconvenience. To deal with it, there is the LEDC compiler that creates a C module from the LED contents.
To simply view a LED file objects use the LED viewer application, see
IupView in the applications included in the distribution.