System Guide

Initialization

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;
}