wiki:FAQ/General Questions

Version 5 (modified by Thore Böckelmann, 4 years ago) (diff)

General Questions

  1. How are frame settings influenced by certain images?
  2. How much stack memory is required for MUI?

How are frame settings influenced by certain images?

Usually MUI will add a unique frame to each object, unless a specific frame is enforced by the application. The kind of frame MUI chooses depends on several things.

By default all objects get a standard frame which can be configured in the MUI preferences application, i.e. a button frame for buttons. This setting can be overridden by applications for single objects if the developer thinks that this is necessary. However, for image buttons there exists a special feature which removes the frame chosen by MUI if the image comes with its own frame within the imagery and the file has a special name. For example if an image file is named "ArrowUp_framed.mim" instead of "ArrowUp.mim" MUI will set not set the standard image button frame for the created object as this would result in a double frame (one by MUI and the second by the image itself) which definitely is not intended and would look bad. In this case MUI will trust the imagery to provide a proper frame and will not draw the frame defined for image buttons.

How much stack memory is required for MUI?

MUI applications require a certain amount of stack memory during creation of the GUI due to the typical deeply nested code. The default stack size of 8K (8192 bytes) is usually not enough. A too low stack size will cause unpredictable crashes of either the MUI application or random other applications due to a stack overflow and hence trashed memory.

Since AmigaOS has no concept of automatic stack enlargement the only solution is to provide enough stack memory from the beginning. Its size can be defined either in the application's Workbench icon or, if the application is started from a shell or a script, by setting a sufficiently large stack by running C:Stack with an appropriate size.

MUI for AmigaOS has a built-in check whether the stack size of an application is large enough. If the stack size is found to be too small a warning requester will be displayed to inform the user about this nuisance. The current minimum stack size requirement is at least 32K (32768 bytes) to avoid the stack overflows mentioned above. Please note that this size is NO guarantee. It is just a compromise between safety and excessive memory usage. There may be applications with a complex GUI which requires more stack memory.

Unfortunately there exist some applications which launch a subprocess which then creates the MUI application and the GUI. Most of the time this subprocess' stack size is fixed and too low and cannot be adjusted by the user. In this situation the only way to increase the stack size to avoid the warning requester and possible crashes is a patch like StackAttack or StackAttack2. Such patches will apply to all applications, not just MUI applications.