+ (MUIApplication *) currentApplication
- (void) aboutMUI:(MUIWindow *)refwindow

Show the MUI about window. Please include that in all your applications and link with a menu item called "About MUI...".

- (BOOL) active

This attribute reflects the state that the user adjusted with commodities Exchange. MUI itself doesn't pay any attention to it, this is up to you.

- (OBString *) applicationHelpFile

This attribute allows defining an AmigaGuide style file to be displayed when the user requests online help.

When the HELP button is pressed and the application defines a MUIA_Application_HelpFile, MUI tries to obtain MUIA_HelpNode from the current object (the one under the mouse pointer). If MUIA_HelpNode is not defined, MUI continues asking the parent object for this attribute (usually a group, but remember: the parent of a windows root object is the window itself, the parent of a window is the application).

When a non NULL MUIA_HelpNode is found, the same procedure is applied to MUIA_HelpLine. Then MUI puts the application to sleep and displays the file at the position specified with MUIA_HelpNode and/or MUIA_HelpLine.

This behaviour allows you to define one MUIA_Application_HelpFile for your application object and different help nodes and lines for your applications windows and/or gadgets.

- (OBString *) applicationVersion

Define a version string for an application. This string shall follow standard version string convetions but must *not* contain a leading "\0".

- (OBString *) author

Name of the applications author.

- (OBString *) base

The basename for an application. This name is used for the builtin ARexx port and for some internal file management.

A basename must neither contain spaces nor any special characters such as ":/()#?*...".

When your program is a single task application (i.e. MUIA_Application_SingleTask is TRUE), the base name will be used without further modification.

Otherwise, it gets a ".1", ".2", etc. appended, depending on how many applications are already running. If you need to know the name of your ARexx port, you can query the base name attribute after the application is created.

- (CxObj *) broker

If you need to attach some additional commodities objects to your application (e.g. because you need lots of hotkeys), you can obtain a pointer to the applications Broker structure and add some commodities objects.

MUI will free the complete broker when the application is disposed, no need for you to free your objects yourself.

To receive input from your objects, you will also need to install a MUIA_Application_BrokerHook.

- (struct Hook *) brokerHook

You specify a pointer to hook structure. The function will be called whenever a commodities message arrives (between MUI's GetMsg() and ReplyMsg()).

You receive a pointer to the application object as object in a2 and a pointer to commodities CxMsg message in a1.

- (struct MsgPort *) brokerPort

Get a pointer to the applications commodities message port. If you want to add own Hotkeys to your application, you need a message port. Instead of creating your own, you should better use this one.

- (LONG) brokerPri

Adjust the priority of an applications broker.

- (APTR) buildSettingsPanel:(ULONG)number
- (void) checkRefresh

This method checks all currently open windows if they need refreshing and refreshes them if necessary.

You won't need to call this method if you are within your traditional MUI main loop. However, if you e.g. spawn some kind of synchronous requester (AslRequest), MUI cannot react on IDCMP_REFRESHWINDOW messages.

The result is that the user may see a damaged MUI window if he moves around a file requester and MUI is configured for simple refresh.

MUIA_Application_CheckRefresh is the solution for this problem. Just open your requesters with

ASLFR_UserData , ApplicationObject, ASLFR_IntuiMsgFunc, &IntuiMsgHook,

and let IntuiMsgHook point to something like this:

SAVEDS ASM VOID IntuiMsgFunc( _a1 struct IntuiMessage *imsg, _a2 struct FileRequester *req) { if (imsg->Class==IDCMP_REFRESHWINDOW) DoMethod(req->fr_UserData,MUIM_Application_CheckRefresh); }

RESULT Windows with damage will be refreshed. This may result in MUI calling MUIM_Draw of some of your custom classes. The result value of this method is undefined.

- (struct MUI_Command *) commands

This attribute allows an application to include its own set of ARexx commands. You specify a pointer to an array of MUI_Command structures, which look like this:

struct MUI_Command { char *mc_Name; char *mc_Template; LONG mc_Parameters; struct Hook *mc_Hook; LONG mc_Reserved[5]; };

mc_Name contains the name of your command. Commands are not case sensitive.

mc_Template is an argument template that follows the same rules as dos.library/ReadArgs(). It may be NULL, in which case your command doesn't need any parameters.

mc_Parameters is the number of parameters specified in the template array.

mc_Hook is a pointer to the callback hook defining the function to be called.

You may specify any number of MUI_Command structures, but you must terminate your array with a NULL field.

When a command shows up an applications ARexx port, MUI parses the arguments according to the given template and calls the hook with the application object as hook object in a2 and a pointer to an array of longwords containing the parameters in a1.

The result code of your hook will be replied to ARexx as rc.

If you have some simple ARexx commands that just emulate some user action (e.g. clicking a button), you can use the magic cookie MC_TEMPLATE_ID for mc_Template and a return id value for mc_Parameters. In this case, MUI will do no argument parsing and instead simply return the specified id value on the next call to MUIM_Application_Input.

For more sophisticated possibilities in ARexx callback hooks, please refer to MUIA_Application_RexxMsg and MUIA_Application_RexxString.

- (OBString *) copyright

A copyright string, containing the year and the company.

- (IPTR) defaultConfigItem:(ULONG)cfgid
- (OBString *) description

Short description, about 40 characters. Shown e.g. in commodities exchange.

- (struct DiskObject *) diskObject

Pointer to a struct DiskObject, e.g. obtained from GetDiskObject(). If present, MUI will use this object for the AppIcon when your application gets iconified.

Otherwise MUI will try to locate "env:sys/dev_mui.info" and, if not present, fall back to a default icon.

- (BOOL) doubleStart

This attribute is set automatically when the user tries to start a MUIA_Application_SingleTask application twice. You can react on this and take appropriate actions, e.g. pop up a requester or quit yourself.

- (BOOL) forceQuit

When your input loop receives a MUIV_Application_ReturnID_Quit, you should query this attribute. In case its TRUE, your program should exit quietly without popping up any safety requesters or other stuff.

MUI will e.g. set this if the user issued a "QUIT FORCE" ARexx command to your application.

- (ULONG) getMenuCheck:(ULONG)menuid

Ask whether a checkmark menu item has its checkmark set or cleared. The application will ask its sub windows for a menu item with the given id and return the state of the first item it finds.

- (ULONG) getMenuState:(ULONG)menuid

Ask whether a menu item is enabled or disabled. The application will ask its sub windows for a menu item with the given id and return the state of the first item it finds.

- (BOOL) iconified

Setting this attribute to TRUE causes the application to become iconified. Every open window will be closed and a (configurable) AppIcon will appear on the workbench.

Same thing happens when the user hits the iconify gadget in the window border or uses commodities Exchange to hide your applications interface.

There is no way for you to prevent your application from being iconified. However, you can react on the iconification by listening to the MUIA_Application_Iconified attribute with notification. This allows you to free some resources you don't need in iconified state.

When an application is iconified and you try to open a window, the window won't open immediately. Instead MUI remembers this action and opens the window once the application is uniconified again.

- (OBString *) iconifyTitle
- (IPTR) inputBuffered

Imagine your application does some time consuming operation, e.g. copying a disk, and you are for some reasons unable to react on return ids during this period. One solution would be to simply put your application to sleep, it will get a busy pointer and the user knows whats going on.

However, this will make it impossible for the user to resize your applications windows or iconify it, he will have to wait until you are done with your operation.

MUIM_Application_InputBuffered offers a solution for this problem. Using this method, you needn't set to sleep your application. Just call it on a regular basis and MUI will be able to handle all actions concerning the GUI. You do not need to pay attention on return values, they remain on an internal stack until your next call to the non buffered input method.

- (Boopsiobject *) instantiateWithWindows:(MUIWindow *)window, ... 

instantiates the Application object with the NULL temrinated list of window objects. MUI requires that you pass at least one window object

- (BOOL) load:(OBString *)name

MUIM_Application_Save, MUIM_Application_Load and MUIA_ObjectID offer an easy way of saving and loading a programs configuration.

Each object with a non NULL MUIA_ObjectID will get its contents saved during MUIM_Application_Save and restored during MUIM_Application_Load. This makes it very easy to design a configuration window with "Save", "Use" and "Cancel" buttons to allow saving & loading of settings. When the application starts, you would just have to call MUIM_Application_Load and the stored settings will be read and installed.

Not all classes are able to import and export their contents. Currently, you may define a MUIA_ObjectID for

String class - MUIA_String_Contents is ex/imported. Radio class - MUIA_Radio_Active is ex/imported. Cycle class - MUIA_Cycle_Active is ex/imported. List class - MUIA_List_Active is ex/imported. Text class - MUIA_Text_Contents is ex/imported. Numeric class - MUIA_Numeric_Value is ex/imported. Area class - MUIA_Selected is ex/imported (e.g. for Checkmark gadgets) Menuitem class - MUIA_Menuitem_Checked is ex/imported (V9). Group class - MUIA_Group_ActivePage is ex/imported (V8). Balance class - weight of children is ex/imported (MorphOS 3.10)

- (BOOL) loadENV
- (BOOL) loadENVARC
- (ULONG) menuAction

Whenever a menu item is selected, this attribute will be set to the corresponding UserData field of the gadtools NewMenu structure. This allows reacting on menu items via broadcasting.

- (ULONG) menuHelp

Whenever a menu item is selected with the help key, this attribute will be set to the corresponding UserData field of the gadtools NewMenu structure. Together with MUIM_Application_ShowHelp this allows creation of menu help texts.

- (MUIMenustrip *) menustrip

Specify a menu strip object for the application. The object is treated as a child of the application and will be disposed when the application is disposed.

Menustrip objects defined for the application are used as menu for every window of the application, as long as the window doesn't define its private menu.

MUIA_Application_Menustrip replaces the old and obsolete MUIA_Application_Menu tag.

Usually, you will create the menu object with MUI's builtin object library from a gadtools NewMenu structure, but its also OK to define the menu tree "by hand" using the Family class.

- (void) noNotifySetActive:(BOOL)active
- (void) noNotifySetApplicationHelpFile:(OBString *)applicationhelpfile
- (void) noNotifySetBrokerHook:(struct Hook *)brokerhook
- (void) noNotifySetCommands:(struct MUI_Command *)commands
- (void) noNotifySetDiskObject:(struct DiskObject *)diskobject
- (void) noNotifySetDoubleStart:(BOOL)doublestart
- (void) noNotifySetDropObject:(id)dropobject
- (void) noNotifySetForceQuit:(BOOL)forcequit
- (void) noNotifySetIconified:(BOOL)iconified
- (void) noNotifySetIconifyTitle:(OBString *)iconifytitle
- (void) noNotifySetMenuAction:(ULONG)menuaction
- (void) noNotifySetRexxHook:(struct Hook *)rexxhook
- (void) noNotifySetRexxMsg:(struct RexxMsg *)rexxmsg
- (void) noNotifySetRexxString:(OBString *)rexxstring
- (void) noNotifySetSleep:(BOOL)sleep
- (void) noNotifySetUsedClasses:(OBArray *)usedclasses
- (BOOL) openConfigWindow:(ULONG)flags classid:(OBString *)classid
- (void) quit
- (void) returnID:(ULONG)retid

Tell MUI to return the given id with the next call to MUIM_Application_Input.

Together with the MUI's notification mechanism, this method connects your user interface and your program. If you e.g. want to be informed if the user presses a "Play" button, you would have define an id for this action and set up a notification event with MUIM_Notify.

You can use any long word as return id, except from -255 up to 0. These values are reserved for MUI's internal use and for special return values like MUIV_Application_ReturnID_Quit.

Note that MUI will put all incoming return ids onto a private fifo stack and feed this stack to its input methods result code later.

- (struct Hook *) rexxHook

When specified, MUI calls this hook whenever a rexx message arrives and MUI can't map it to a builtin or a programmer specified command. The hook will be called with a pointer to itself in A0, a pointer to the application object in A2 and a pointer to a struct RexxMsg in A1.

The return code from the hook is used as result code when replying the message, the secondary result can be set with MUIA_Application_RexxString.

- (struct RexxMsg *) rexxMsg

Within an ARexx callback hook, you can obtain a pointer to the RexxMsg that came with the command. This allows you to use some ARexx support functions coming with amiga.lib

- (void) run
- (BOOL) save:(OBString *)name
- (BOOL) saveENV
- (BOOL) saveENVARC
- (void) setActive:(BOOL)active
- (void) setApplicationHelpFile:(OBString *)applicationhelpfile
- (void) setApplicationVersion:(OBString *)applicationversion

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setAuthor:(OBString *)author

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setBase:(OBString *)base

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setBrokerHook:(struct Hook *)brokerhook
- (void) setBrokerPri:(LONG)brokerpri

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setCommands:(struct MUI_Command *)commands
- (void) setConfigItem:(ULONG)item data:(APTR)data

Private method, only for PSI.

- (void) setCopyright:(OBString *)copyright

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setDescription:(OBString *)description

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setDiskObject:(struct DiskObject *)diskobject
- (void) setDoubleStart:(BOOL)doublestart
- (void) setDropObject:(id)dropobject

If your application is iconified and the user drops icons onto the AppIcon, the object specified here will receive the AppMessage.

- (void) setForceQuit:(BOOL)forcequit
- (void) setIconified:(BOOL)iconified
- (void) setIconifyTitle:(OBString *)iconifytitle
- (void) setMenuAction:(ULONG)menuaction
- (ULONG) setMenuCheck:(ULONG)menuid stat:(LONG)stat

Set or clear the checkmark of a menu item. The application will ask its sub windows for menu items with the given id and set/clear all found entries.

- (ULONG) setMenuState:(ULONG)menuid stat:(LONG)stat

Enable or disable a menu item. The application will ask its sub windows for menu items with the given id and enable/disable all found entries.

- (void) setMenustrip:(MUIMenustrip *)menustrip

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setRexxHook:(struct Hook *)rexxhook
- (void) setRexxMsg:(struct RexxMsg *)rexxmsg
- (void) setRexxString:(OBString *)rexxstring

ARexx allows returning a string as result of a function call. This attribute allows setting the result string within an ARexx callback hook.

The string is temporarily copied.

- (void) setSingleTask:(BOOL)singletask

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setSleep:(BOOL)sleep
- (void) setTitle:(OBString *)title

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setUseCommodities:(BOOL)usecommodities

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setUseRexx:(BOOL)userexx

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setUseScreenNotify:(BOOL)usescreennotify

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setUsedClasses:(OBArray *)usedclasses
- (void) showHelp:(MUIWindow *)window name:(OBString *)name node:(OBString *)node line:(LONG)line

Show an AmigaGuide help file. The application will be put to sleep until the file is displayed.

Usually, you don't need to call this method directly. MUI comes with a sophisticated online help system, you just need to supply your gadgets with help nodes and everything will be handled automatically.

- (BOOL) sleep

This attribute can be used to put a whole application to sleep. All open windows get disabled and a busy pointer appears.

This attribute contains a nesting count, if you tell your application to sleep twice, you will have to tell it to wake up twice too.

If you need to do some time consuming actions, you always should set this attribute to inform the user that you are currently unable to handle input.

A sleeping application's windows cannot be resized.

EXAMPLES set(app,MUIA_Application_Sleep,TRUE ); // go to bed calc_fractals(); set(app,MUIA_Application_Sleep,FALSE); // wake up

- (OBString *) title

This tag defines the title of an application. The title is e.g. shown in Commodities Exchange or in the MUI preferences program.

An application title shall not contain any version information, just the pure title. Also, special characters such as ":/()#?*..." are not allowed.

You should use a quite long and unique name for your applications. Naming it "Viewer" or "Browser" is not a wise choice.

The length of the name must not exceed 30 characters!

- (OBArray *) usedClasses

Tell the MUI system what external classes your application might use.

You have to pass a pointer to a NULL terminated string array which lists each of the external classes used by your application. For example, if your program uses the Listtree class, add "Listtree.mcc" to the array.

Although MUI does not strictly require this information to run your application, you should nevertheless make it available. With the aid of this attribute, MUI will be able to determine which GUI preferences pages should be presented to the user when he adjusts your application specific MUI settings.

If you do not inform MUI about your external classes, MUI will present lots of unnecessary pages that won't affect your application at all. Any MUI program should therefore use this tag.