home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / dev / mui-2.1.lha / MUI-2.1 / Developer / Autodocs / MUI_Application.doc next >
Encoding:
Text File  |  1994-07-04  |  34.2 KB  |  1,148 lines

  1. TABLE OF CONTENTS
  2.  
  3. Application.mui/Application.mui
  4. Application.mui/MUIM_Application_GetMenuCheck
  5. Application.mui/MUIM_Application_GetMenuState
  6. Application.mui/MUIM_Application_Input
  7. Application.mui/MUIM_Application_InputBuffered
  8. Application.mui/MUIM_Application_Load
  9. Application.mui/MUIM_Application_PushMethod
  10. Application.mui/MUIM_Application_ReturnID
  11. Application.mui/MUIM_Application_Save
  12. Application.mui/MUIM_Application_SetMenuCheck
  13. Application.mui/MUIM_Application_SetMenuState
  14. Application.mui/MUIM_Application_ShowHelp
  15. Application.mui/MUIA_Application_Active
  16. Application.mui/MUIA_Application_Author
  17. Application.mui/MUIA_Application_Base
  18. Application.mui/MUIA_Application_Broker
  19. Application.mui/MUIA_Application_BrokerHook
  20. Application.mui/MUIA_Application_BrokerPort
  21. Application.mui/MUIA_Application_BrokerPri
  22. Application.mui/MUIA_Application_Commands
  23. Application.mui/MUIA_Application_Copyright
  24. Application.mui/MUIA_Application_Description
  25. Application.mui/MUIA_Application_DiskObject
  26. Application.mui/MUIA_Application_DoubleStart
  27. Application.mui/MUIA_Application_DropObject
  28. Application.mui/MUIA_Application_ForceQuit
  29. Application.mui/MUIA_Application_HelpFile
  30. Application.mui/MUIA_Application_Iconified
  31. Application.mui/MUIA_Application_Menu
  32. Application.mui/MUIA_Application_MenuAction
  33. Application.mui/MUIA_Application_MenuHelp
  34. Application.mui/MUIA_Application_Menustrip
  35. Application.mui/MUIA_Application_RexxHook
  36. Application.mui/MUIA_Application_RexxMsg
  37. Application.mui/MUIA_Application_RexxString
  38. Application.mui/MUIA_Application_SingleTask
  39. Application.mui/MUIA_Application_Sleep
  40. Application.mui/MUIA_Application_Title
  41. Application.mui/MUIA_Application_Version
  42. Application.mui/MUIA_Application_Window
  43. Application.mui/Application.mui
  44.  
  45. Application class is the master class for all
  46. MUI applications. It serves as a kind of anchor
  47. for all input, either coming from the user or
  48. somewhere from the system, e.g. commodities
  49. or ARexx messages.
  50.  
  51. An application can have any number of sub windows,
  52. these windows are the children of the application.
  53. Application.mui/MUIM_Application_GetMenuCheck
  54.  
  55.     NAME
  56.     MUIM_Application_GetMenuCheck (V4) (OBSOLETE)
  57.  
  58.     SYNOPSIS
  59.     DoMethod(obj,MUIM_Application_GetMenuCheck,ULONG MenuID);
  60.  
  61.     FUNCTION
  62.     Ask whether a checkmark menu item has its checkmark
  63.     set or cleared.
  64.     The application will ask its sub windows for a
  65.     menu item with the given id and return the state of
  66.     the first item it finds.
  67.  
  68.     INPUTS
  69.     MenuID - the value you wrote into the
  70.                  UserData field of struct NewMenu.
  71.  
  72.     SEE ALSO
  73.     MUIM_Application_SetMenuCheck, MUIA_Application_Menu
  74. Application.mui/MUIM_Application_GetMenuState
  75.  
  76.     NAME
  77.     MUIM_Application_GetMenuState (V4) (OBSOLETE)
  78.  
  79.     SYNOPSIS
  80.     DoMethod(obj,MUIM_Application_GetMenuState,ULONG MenuID);
  81.  
  82.     FUNCTION
  83.     Ask whether a menu item is enabled or disabled.
  84.     The application will ask its sub windows for a
  85.     menu item with the given id and return the state of
  86.     the first item it finds.
  87.  
  88.     INPUTS
  89.     MenuID - the value you wrote into the
  90.                  UserData field of struct NewMenu.
  91.  
  92.     SEE ALSO
  93.     MUIM_Application_SetMenuState, MUIA_Application_Menu
  94. Application.mui/MUIM_Application_Input
  95.  
  96.     NAME
  97.     MUIM_Application_Input (V4)
  98.  
  99.     SYNOPSIS
  100.     DoMethod(obj,MUIM_Application_Input,LONGBITS *signal);
  101.  
  102.     FUNCTION
  103.     The MUI system itself does not wait for any user input.
  104.     It just tells your application which signal bits it
  105.     has allocated, then it's up to you to call MUIs input
  106.     handle function when one of these signals gets set.
  107.  
  108.     In a simple MUI application you would just Wait()
  109.     for these signals and call MUI when one is received.
  110.     However, you can perfectly allocate some signal bits
  111.     yourself and include them in your Wait() command.
  112.     You needn't even Wait(), your application could
  113.     maybe calculate some fractal graphics or copy
  114.     disks, the only important thing is that you call
  115.     MUI's input method when one of the MUI allocated
  116.     signals arrives.
  117.  
  118.     The usual way of communication with your user
  119.     interface is via return ids. Every action happening
  120.     to the GUI can create return ids, e.g. pressing a
  121.     button or trying to close a window. MUI buffers these
  122.     ids and uses them as result codes for the input method.
  123.     Thats where you can get it from and take the appropriate
  124.     actions.
  125.  
  126.     Now lets have a look on a usual input loop of a
  127.     MUI application. Imagine you have an Play and a
  128.     Cancel button and have previously told them
  129.     to return ID_PLAY and ID_CANCEL when pressed.
  130.     (see MUIM_Notify and MUIM_Application_ReturnID
  131.     on information about these topics). Your input
  132.     loop would look like this:
  133.  
  134.  
  135.     while (running)
  136.     {
  137.        ULONG signals;
  138.  
  139.        switch (DoMethod(app,MUIM_Application_Input,&signals))
  140.        {
  141.           case ID_PLAY:
  142.              PlaySound();
  143.              break;
  144.  
  145.           case ID_CANCEL:
  146.           case MUIV_Application_ReturnID_Quit:
  147.              running = FALSE;
  148.              break;
  149.        }
  150.  
  151.        if (running && signals) Wait(signals);
  152.     }
  153.  
  154.  
  155.     So what is happening here?
  156.  
  157.     First, you have to call the MUIM_Application_Input method.
  158.     You supply the address of a ULONG as parameter, thats
  159.     where MUI fills in the signals it needs. Note that you can
  160.     call the input method at any time, regardless of signal
  161.     setting. MUI will simply return when there is nothing
  162.     to do.
  163.  
  164.     In case the user pressed the Play or the Cancel button,
  165.     MUIM_Application_Input will return ID_PLAY or ID_CANCEL.
  166.     Otherwise you will receive a 0, that's why you cannot
  167.     use 0 as one of your id values.
  168.  
  169.     There is one predefined id called
  170.     MUIV_Application_ReturnID_Quit. This will be sent to you
  171.     when someone tried to quit your application from outside,
  172.     e.g. via commodities exchange or the ARexx "quit" command.
  173.     It is required that your application handles this id,
  174.     just treat as if the user clicked on a "Quit" button or
  175.     selected a "Quit" menu item.
  176.  
  177.     After handling the return value, you have to examine
  178.     if MUI wants you to wait for any signals. If this
  179.     is the case (signals != 0), just wait for it. If
  180.     MUI puts a 0 into signals it wants to tell you to
  181.     immediately call the input method again, maybe some
  182.     other return ids have received and need to be handled.
  183.     You *must* check this because Wait()ing on a zero
  184.     signal mask is not a good idea!
  185.  
  186.     Note: It is very important that you call the input method
  187.     whenever a signal arrives. MUI needs this to correctly
  188.     refresh its windows, handle resizing and iconification
  189.     operations and commodities and ARexx messages. If you
  190.     don't, you will annoy your user!
  191.  
  192.     If your program needs to be in a state where you are
  193.     for some reasons unable to call the input method for
  194.     a considerable amount of time (maybe half a second or
  195.     more), you should put your application to sleep. See
  196.     MUIA_Application_Sleep on how to do this.
  197.  
  198.     SEE ALSO
  199.     MUIA_Application_Sleep, MUIM_Application_InputBuffered
  200. Application.mui/MUIM_Application_InputBuffered
  201.  
  202.     NAME
  203.     MUIM_Application_InputBuffered (V4)
  204.  
  205.     SYNOPSIS
  206.     DoMethod(obj,MUIM_Application_InputBuffered,);
  207.  
  208.     FUNCTION
  209.     Imagine your application does some time consuming
  210.     operation, e.g. copying a disk, and you are for
  211.     some reasons unable to react on return ids during
  212.     this period. One solution would be to simply
  213.     put your application to sleep, it will get a
  214.     busy pointer and the user knows whats going on.
  215.  
  216.     However, this will make it impossible for the user
  217.     to resize your applications windows or iconify it,
  218.     he will have to wait until you are done with your
  219.     operation.
  220.  
  221.     MUIM_Application_InputBuffered offers a solution
  222.     for this problem. Using this method, you needn't
  223.     set to sleep your application. Just call it on a
  224.     regular basis and MUI will be able to handle
  225.     all actions concerning the GUI. You do not need
  226.     to pay attention on return values, they remain
  227.     on an internal stack until your next call to
  228.     the non buffered input method.
  229.  
  230.     EXAMPLE
  231.     for (track=0; track<80; track++)
  232.     {
  233.        read_track();
  234.        DoMethod(app,MUIM_Application_InputBuffered);
  235.        write_track();
  236.        DoMethod(app,MUIM_Application_InputBuffered);
  237.     }
  238.  
  239.     SEE ALSO
  240.     MUIM_Application_Input, MUIA_Application_Sleep
  241. Application.mui/MUIM_Application_Load
  242.  
  243.     NAME
  244.     MUIM_Application_Load (V4)
  245.  
  246.     SYNOPSIS
  247.     DoMethod(obj,MUIM_Application_Load,STRPTR name);
  248.  
  249.     FUNCTION
  250.     MUIM_Application_Save, MUIM_Application_Load and
  251.     MUIA_ExportID offer an easy way of saving and loading
  252.     a programs configuration.
  253.  
  254.     Each gadget with a non NULL MUIA_ExportID will get
  255.     its contents saved during MUIM_Application_Save and
  256.     restored during MUIM_Application_Load. This makes
  257.     it very easy to design a configuration window
  258.     with "Save", "Use" and "Cancel" buttons to allow
  259.     the user storing the settings. When the application
  260.     starts, you would just have to call MUIM_Application_Load
  261.     and the stored settings will be read and installed.
  262.  
  263.     Not all classes are able to import and export their
  264.     contents. Currently, you may define MUIA_ExportIDs for
  265.  
  266.     String class  - MUIA_String_Contents is ex/imported.
  267.     Radio class   - MUIA_Radio_Active is ex/imported.
  268.     Cycle class   - MUIA_Cycle_Active is ex/imported.
  269.     List class    - MUIA_List_Active is /ex/imported.
  270.     Text class    - MUIA_Text_Contents is ex/imported.
  271.     Slider class  - MUIA_Slider_Level is ex/imported.
  272.     Area class    - MUIA_Selected is ex/imported
  273.                     (e.g. for Checkmark gadgets)
  274.  
  275.     INPUTS
  276.     name - Name of the file you wish to load the settings from.
  277.            Usually you won't need to think of a real name but
  278.            instead use one of the magic cookies
  279.            MUIV_Application_Load_ENV or
  280.            MUIV_Application_Load_ENVARC.
  281.  
  282.     EXAMPLE
  283.     see the sample program "Settings.c"
  284.  
  285.     SEE ALSO
  286.     MUIM_Application_Save, MUIA_ExportID
  287. Application.mui/MUIM_Application_PushMethod
  288.  
  289.     NAME
  290.     MUIM_Application_PushMethod (V4)
  291.  
  292.     SYNOPSIS
  293.     DoMethod(obj,MUIM_Application_PushMethod,Object *dest, LONG count, /* ... */);
  294.  
  295.     FUNCTION
  296.     Usually, you may not talk to the MUI system from two
  297.     tasks at the same time. MUIM_Application_PushMethod
  298.     provides some kind of solution for this problem.
  299.  
  300.     This (and only this) method may be called from a
  301.     second task. It takes another method as parameter
  302.     and puts in onto a private stack of the application
  303.     object. The next time MUIM_Application_Input
  304.     is called, the pushed method will be executed
  305.     in the context of the current task.
  306.  
  307.     INPUTS
  308.     dest  - object on which to perform the pushed method.
  309.         count - number of following arguments.
  310.     ...   - the destination method.
  311.  
  312.     EXAMPLE
  313.     /* set a status line from a sub task */
  314.     DoMethod(app,MUIM_Application_PushMethod,
  315.        txstatus,3,MUIM_Set,MUIA_Text_Contents,"reading...");
  316.  
  317.     SEE ALSO
  318.     MUIM_Application_Input
  319. Application.mui/MUIM_Application_ReturnID
  320.  
  321.     NAME
  322.     MUIM_Application_ReturnID (V4)
  323.  
  324.     SYNOPSIS
  325.     DoMethod(obj,MUIM_Application_ReturnID,ULONG retid);
  326.  
  327.     FUNCTION
  328.     Tell MUI to return the given id with the next call to 
  329.     MUIM_Application_Input.
  330.  
  331.     Together with the MUI's notification mechanism, this
  332.     method connects your user interface and your program.
  333.     If you e.g. want to be informed if the user presses
  334.     a "Play" button, you would have define an id for
  335.     this action and set up a notification event with
  336.     MUIM_Notify.
  337.  
  338.     You can use any long word as return id, except
  339.     from -255 up to 0. These values are reserved for
  340.     MUI's internal use and for special return values
  341.     like MUIV_Application_ReturnID_Quit.
  342.  
  343.     Note that MUI will put all incoming return ids
  344.     onto a private fifo stack and feed this stack
  345.     to its input methods result code later.
  346.  
  347.     EXAMPLE
  348.  
  349.     /* inform me if a button is pressed (actually released, */
  350.     /* since this is the way amiga buttons are handled)     */
  351.  
  352.     #define ID_PLAYBUTTON 42
  353.  
  354.     ...
  355.  
  356.     DoMethod(buttonobj, MUIM_Notify,
  357.        MUIA_Pressed, FALSE,
  358.        appobj, 2, MUIM_Application_ReturndID, ID_PLAYBUTTON);
  359.  
  360.     ...
  361.  
  362.     while (running)
  363.     {
  364.        switch (DoMethod(appobj,MUIM_Application_Input,&sigs))
  365.        {
  366.           case ID_PLAYBUTTON:
  367.              printf("Ok, lets play a game...");
  368.              break;
  369.        }
  370.     }
  371.  
  372.     SEE ALSO
  373.     MUIM_Application_Input, MUIM_Notify
  374. Application.mui/MUIM_Application_Save
  375.  
  376.     NAME
  377.     MUIM_Application_Save (V4)
  378.  
  379.     SYNOPSIS
  380.     DoMethod(obj,MUIM_Application_Save,STRPTR name);
  381.  
  382.     FUNCTION
  383.     MUIM_Application_Save, MUIM_Application_Load and
  384.     MUIA_ExportID offer an easy way of saving and loading
  385.     a programs configuration.
  386.  
  387.     Each gadget with a non NULL MUIA_ExportID will get
  388.     its contents saved during MUIM_Application_Save and
  389.     restored during MUIM_Application_Load. This makes
  390.     it very easy to design a configuration window
  391.     with "Save", "Use" and "Cancel" buttons to allow
  392.     the user storing the settings. When the application
  393.     starts, you would just have to call MUIM_Application_Load 
  394.     and the stored settings will be read and installed.
  395.  
  396.     Not all classes are able to import and export their
  397.     contents. Currently, you may define MUIA_ExportIDs for
  398.  
  399.     String class  - MUIA_String_Contents is ex/imported.
  400.     Radio class   - MUIA_Radio_Active is ex/imported.
  401.     Cycle class   - MUIA_Cycle_Active is ex/imported.
  402.     List class    - MUIA_List_Active is /ex/imported.
  403.     Text class    - MUIA_Text_Contents is ex/imported.
  404.     Slider class  - MUIA_Slider_Level is ex/imported.
  405.     Area class    - MUIA_Selected is ex/imported
  406.                     (e.g. for Checkmark gadgets).
  407.  
  408.     INPUTS
  409.     name - Name of the file you wish to save the settings to.
  410.            Usually you won't need to think of a real name but
  411.            instead use one of the magic cookies
  412.            MUIV_Application_Save_ENV or
  413.            MUIV_Application_Save_ENVARC.
  414.            This will save your application's settings somewhere
  415.            in env:mui/ or envarc:mui/, you needn't worry about
  416.            it.
  417.  
  418.     EXAMPLE
  419.     see the sample program "Settings.c"
  420.  
  421.     SEE ALSO
  422.     MUIM_Application_Load, MUIA_ExportID
  423. Application.mui/MUIM_Application_SetMenuCheck
  424.  
  425.     NAME
  426.     MUIM_Application_SetMenuCheck (V4) (OBSOLETE)
  427.  
  428.     SYNOPSIS
  429.     DoMethod(obj,MUIM_Application_SetMenuCheck,ULONG MenuID, LONG stat);
  430.  
  431.     FUNCTION
  432.     Set or clear the checkmark of a menu item.
  433.     The application will ask its sub windows for menu items
  434.     with the given id and set/clear all found
  435.     entries.
  436.  
  437.     INPUTS
  438.     MenuID - the value you wrote into the
  439.                  UserData field of struct NewMenu.
  440.  
  441.     set    - TRUE to set checkmark, FALSE to clear
  442.  
  443.     SEE ALSO
  444.     MUIM_Application_GetMenuCheck, MUIA_Application_Menu,
  445. Application.mui/MUIM_Application_SetMenuState
  446.  
  447.     NAME
  448.     MUIM_Application_SetMenuState (V4) (OBSOLETE)
  449.  
  450.     SYNOPSIS
  451.     DoMethod(obj,MUIM_Application_SetMenuState,ULONG MenuID, LONG stat);
  452.  
  453.     FUNCTION
  454.     Enable or disable a menu item.
  455.     The application will ask its sub windows for menu items
  456.     with the given id and enable/disable all found
  457.     entries.
  458.  
  459.     INPUTS
  460.     MenuID - the value you wrote into the
  461.                  UserData field of struct NewMenu.
  462.  
  463.     set    - TRUE to enable item, FALSE to disable.
  464.  
  465.     SEE ALSO
  466.     MUIM_Application_GetMenuState, MUIA_Application_Menu,
  467. Application.mui/MUIM_Application_ShowHelp
  468.  
  469.     NAME
  470.     MUIM_Application_ShowHelp (V4)
  471.  
  472.     SYNOPSIS
  473.     DoMethod(obj,MUIM_Application_ShowHelp,Object *window, char *name, char *node, LONG line);
  474.  
  475.     FUNCTION
  476.     Show an AmigaGuide help file. The application will be
  477.     put to sleep until the file is displayed.
  478.  
  479.     Usually, you don't need to call this method directly.
  480.     MUI comes with a sophisticated online help system,
  481.     you just need to supply your gadgets with help nodes
  482.     and everything will be handled automatically.
  483.  
  484.     INPUTS
  485.     window - (Object *) - Help will appear on this windows
  486.                           screen. May be NULL.
  487.     name   - (char *)   - name of the help file
  488.     node   - (char *)   - name of a node in this help file
  489.     line   - (char *)   - line number
  490.  
  491.     SEE ALSO
  492.     MUIA_HelpFile, MUIA_HelpNode, MUIA_HelpLine
  493. Application.mui/MUIA_Application_Active
  494.  
  495.     NAME
  496.     MUIA_Application_Active -- (V4) [ISG], BOOL
  497.  
  498.     FUNCTION
  499.     This attribute reflects the state that the user adjusted
  500.     with commodities Exchange. MUI itself doesn't pay any
  501.     attention to it, this is up to you.
  502.  
  503.     SEE ALSO
  504.     MUIA_Application_Broker
  505. Application.mui/MUIA_Application_Author
  506.  
  507.     NAME
  508.     MUIA_Application_Author -- (V4) [I.G], STRPTR
  509.  
  510.     FUNCTION
  511.     Name of the applications author.
  512.  
  513.     EXAMPLE
  514.     see MUIA_Application_Title
  515.  
  516.     SEE ALSO
  517.     MUIA_Application_Title, MUIA_Application_Copyright,
  518.     MUIA_Application_Version, MUIA_Application_Description,
  519.     MUIA_Application_Base
  520. Application.mui/MUIA_Application_Base
  521.  
  522.     NAME
  523.     MUIA_Application_Base -- (V4) [I.G], STRPTR
  524.  
  525.     FUNCTION
  526.     The basename for an application. This name is used
  527.     for the builtin ARexx port and for some internal
  528.     file management.
  529.  
  530.     A basename must neither contain spaces nor any
  531.     special characters such as ":/()#?*...".
  532.  
  533.     When your program is a single task application
  534.     (i.e. MUIA_Application_SingleTask is TRUE), the
  535.     base name will be used without further modification.
  536.  
  537.     Otherwise, it gets a ".1", ".2", etc. appended,
  538.     depending on how many applications are already
  539.     running. If you need to know the name of your
  540.     ARexx port, you can query the base name attribute
  541.     after the application is created.
  542.  
  543.     EXAMPLE
  544.     see MUIA_Application_Title
  545.  
  546.     SEE ALSO
  547.     MUIA_Application_Title, MUIA_Application_Version,
  548.     MUIA_Application_Author, MUIA_Application_Copyright,
  549.     MUIA_Application_Description
  550. Application.mui/MUIA_Application_Broker
  551.  
  552.     NAME
  553.     MUIA_Application_Broker -- (V4) [..G], Broker *
  554.  
  555.     FUNCTION
  556.     If you need to attach some additional commodities objects
  557.     to your application (e.g. because you need lots of hotkeys),
  558.     you can obtain a pointer to the applications Broker structure
  559.     and add some commodities objects.
  560.  
  561.     MUI will free the complete broker when the application is
  562.     disposed, no need for you to free your objects yourself.
  563.  
  564.     To receive input from your objects, you will also need to
  565.     install a MUIA_Application_BrokerHook.
  566.  
  567.     NOTES
  568.     Unless you have set MUIA_Application_RequiresCX, you must be
  569.     prepared to receive a NULL pointer. In this case, the
  570.     commodities interface is not available, maybe because the
  571.     user installed a light version of MUI.
  572.  
  573.     SEE ALSO
  574.     MUIA_Application_BrokerHook
  575. Application.mui/MUIA_Application_BrokerHook
  576.  
  577.     NAME
  578.     MUIA_Application_BrokerHook -- (V4) [ISG], struct Hook *
  579.  
  580.     FUNCTION
  581.     You specify a pointer to hook structure. The function
  582.     will be called whenever a commodities message arrives
  583.     (between MUI's GetMsg() and ReplyMsg()).
  584.  
  585.     You receive a pointer to the application object
  586.     as object in a2 and a pointer to commodities
  587.     CxMsg message in a1.
  588.  
  589.     NOTES
  590.     The commodities interface isn't available in the
  591.     memory saving "light" version of MUI. Your hook
  592.     will never be called in this case.
  593.  
  594.     SEE ALSO
  595.     MUIA_Application_Broker
  596. Application.mui/MUIA_Application_BrokerPort
  597.  
  598.     NAME
  599.     MUIA_Application_BrokerPort -- (V6) [..G], struct MsgPort *
  600.  
  601.     FUNCTION
  602.     Get a pointer to the applications commodities message port.
  603.     If you want to add own Hotkeys to your application, you
  604.     need a message port. Instead of creating your own, you
  605.     should better use this one.
  606.  
  607.     NOTES
  608.     Unless you have set MUIA_Application_RequiresCX, you must be
  609.     prepared to receive a NULL pointer. In this case, the
  610.     commodities interface is not available, maybe because the
  611.     user installed a light version of MUI.
  612.  
  613.     SEE ALSO
  614.     MUIA_Application_BrokerHook
  615. Application.mui/MUIA_Application_BrokerPri
  616.  
  617.     NAME
  618.     MUIA_Application_BrokerPri -- (V6) [I.G], LONG
  619.  
  620.     FUNCTION
  621.     Adjust the priority of an applications broker.
  622.  
  623.     SEE ALSO
  624.     MUIA_Application_BrokerHook
  625. Application.mui/MUIA_Application_Commands
  626.  
  627.     NAME
  628.     MUIA_Application_Commands -- (V4) [ISG], struct MUI_Command *
  629.  
  630.     FUNCTION
  631.     This attribute allows an application to include 
  632.     its own set of ARexx commands. You specify a
  633.     pointer to an array of MUI_Command structures,
  634.     which look like this:
  635.  
  636.     struct MUI_Command
  637.     {
  638.        char        *mc_Name;
  639.        char        *mc_Template;
  640.        LONG         mc_Parameters;
  641.        struct Hook *mc_Hook;
  642.        LONG         mc_Reserved[5];
  643.     };
  644.  
  645.     mc_Name       contains the name of your command.
  646.                   Commands are not case sensitive.
  647.  
  648.     mc_Template   is an argument template that follows
  649.                   the same rules as dos.library/ReadArgs().
  650.                   It may be NULL, in which case your command
  651.                   doesn't need any parameters.
  652.  
  653.     mc_Parameters is the number of parameters specified
  654.                   in the template array.
  655.  
  656.     mc_Hook       is a pointer to the callback hook defining
  657.                   the function to be called.
  658.  
  659.     You may specify any number of MUI_Command structures,
  660.     but you must terminate your array with a NULL field.
  661.  
  662.     When a command shows up an applications ARexx port,
  663.     MUI parses the arguments according to the given
  664.     template and calls the hook with the application
  665.     object as hook object in a2 and a pointer to
  666.     an array of longwords containing the parameters
  667.     in a1.
  668.  
  669.     The result code of your hook will be replied to
  670.     ARexx as rc.
  671.  
  672.     If you have some simple ARexx commands that just
  673.     emulate some user action (e.g. clicking a button),
  674.     you can use the magic cookie MC_TEMPLATE_ID for 
  675.     mc_Template and a return id value for mc_Parameters. 
  676.     In this case, MUI will do no argument parsing and 
  677.     instead simply return the specified id value on the 
  678.     next call to MUIM_Application_Input.
  679.  
  680.     For more sophisticated possibilities in ARexx
  681.     callback hooks, please refer to
  682.     MUIA_Application_RexxMsg and MUIA_Application_RexxString.
  683.  
  684.     EXAMPLE
  685.     static struct MUI_Command commands[] =
  686.     {
  687.        { "rescan", MC_TEMPLATE_ID, ID_RESCAN, NULL     },
  688.        { "select", "PATTERN/A"   , 1        , &selhook },
  689.        { NULL    , NULL          , NULL     , NULL     }
  690.     };
  691.  
  692.     SEE ALSO
  693.     MUIA_Application_RexxMsg, MUIA_Application_RexxString
  694. Application.mui/MUIA_Application_Copyright
  695.  
  696.     NAME
  697.     MUIA_Application_Copyright -- (V4) [I.G], STRPTR
  698.  
  699.     FUNCTION
  700.     A copyright string, containing the year and the
  701.     company.
  702.  
  703.     EXAMPLE
  704.     see MUIA_Application_Title
  705.  
  706.     SEE ALSO
  707.     MUIA_Application_Title, MUIA_Application_Version,
  708.     MUIA_Application_Author, MUIA_Application_Description,
  709.     MUIA_Application_Base
  710. Application.mui/MUIA_Application_Description
  711.  
  712.     NAME
  713.     MUIA_Application_Description -- (V4) [I.G], STRPTR
  714.  
  715.     FUNCTION
  716.     Short description, about 40 characters.
  717.     Shown e.g. in commodities exchange.
  718.  
  719.     EXAMPLE
  720.     see MUIA_Application_Title
  721.  
  722.     SEE ALSO
  723.     MUIA_Application_Title, MUIA_Application_Version,
  724.     MUIA_Application_Author, MUIA_Application_Copyright,
  725.     MUIA_Application_Base
  726. Application.mui/MUIA_Application_DiskObject
  727.  
  728.     NAME
  729.     MUIA_Application_DiskObject -- (V4) [ISG], struct DiskObject *
  730.  
  731.     FUNCTION
  732.     Pointer to a struct DiskObject, e.g. obtained
  733.     from GetDiskObject(). If present, MUI will use
  734.     this object for the AppIcon when your application
  735.     gets iconified.
  736.  
  737.     Otherwise MUI will try to locate "env:sys/dev_mui.info"
  738.     and, if not present, fall back to a default icon.
  739.  
  740.     EXAMPLE
  741.     ...
  742.     MUIA_Application_DiskObject, 
  743.        dobj = GetDiskObject("PROGDIR:MyApp"),
  744.     ...
  745.  
  746.     /* note that you have to free dobj yourself! */
  747.  
  748.     NOTES
  749.     Unless you have set MUIA_Application_RequiresIconification,
  750.     this attribute might have no effect, maybe because the
  751.     user installed a light version of MUI. You must be prepared
  752.     to receive a NULL pointer when you try to read it!
  753.  
  754.    SEE ALSO
  755.     MUIA_Application_Iconified
  756. Application.mui/MUIA_Application_DoubleStart
  757.  
  758.     NAME
  759.     MUIA_Application_DoubleStart -- (V4) [..G], BOOL
  760.  
  761.     FUNCTION
  762.     This attribute is set automatically when the user
  763.     tries to start a MUIA_SingleTask application twice.
  764.     You can react on this and take appropriate actions,
  765.     e.g. pop up a requester or quit yourself.
  766.  
  767.     SEE ALSO
  768.     MUIA_Application_SingleTask
  769. Application.mui/MUIA_Application_DropObject
  770.  
  771.     NAME
  772.     MUIA_Application_DropObject -- (V5) [IS.], Object *
  773.  
  774.     FUNCTION
  775.     If your application is iconified and the user drops
  776.     icons onto the AppIcon, the object specified here will 
  777.     receive the AppMessage.
  778.  
  779.     SEE ALSO
  780.     MUIA_Window_AppWindow, MUIM_CallHook
  781. Application.mui/MUIA_Application_ForceQuit
  782.  
  783.     NAME
  784.     MUIA_Application_ForceQuit -- (V8) [..G], BOOL
  785.  
  786.     FUNCTION
  787.     When your input loop receives a MUIV_Application_ReturnID_Quit,
  788.     you should query this attribute. In case its TRUE, your program
  789.     should exit quietly without popping up any safety requesters or 
  790.     other stuff.
  791.  
  792.     MUI will e.g. set this if the user issued a "QUIT FORCE" ARexx
  793.     command to your application.
  794. Application.mui/MUIA_Application_HelpFile
  795.  
  796.     NAME
  797.     MUIA_Application_HelpFile -- (V8) [ISG], STRPTR
  798.  
  799.     FUNCTION
  800.     This attribute allows defining an AmigaGuide style file
  801.     to be displayed when the user requests online help.
  802.  
  803.     When the HELP button is pressed and the application
  804.     defines a MUIA_Application_HelpFile, MUI tries to obtain
  805.     MUIA_HelpNode from the current object (the one under
  806.     the mouse pointer). If MUIA_HelpNode is not defined,
  807.     MUI continues asking the parent object for this
  808.     attribute (usually a group, but remember: the parent
  809.     of a windows root object is the window itself, the
  810.     parent of a window is the application).
  811.  
  812.     When a non NULL MUIA_HelpNode is found, the same procedure
  813.     is applied to MUIA_HelpLIne. Then MUI puts the application 
  814.     to sleep and displays the file at the position specified 
  815.     with MUIA_HelpNode and/or MUIA_HelpLine.
  816.  
  817.     This behaviour allows you to define one 
  818.     MUIA_Application_HelpFile for your application object 
  819.     and different help nodes and lines for your applications 
  820.     windows and/or gadgets.
  821.  
  822.     EXAMPLE
  823.  
  824.     ApplicationObject,
  825.        ...
  826.        MUIA_Application_HelpFile, "progdir:myapp.guide",
  827.        ...,
  828.        SubWindow, WindowObject,
  829.           MUIA_Window_Title, "Prefs Window",
  830.           ...,
  831.           MUIA_HelpNode, "prefs-section",
  832.           ...,
  833.           End,
  834.  
  835.        SubWindow, WindowObject,
  836.           MUIA_Window_Title, "Play Window",
  837.           ...
  838.           MUIA_HelpNode, "play-section",
  839.           ...
  840.           WindowContents, VGroup,
  841.              ...,
  842.              Child, StringObject,
  843.                 MUIA_HelpNode, "play-string",
  844.                 ...,
  845.                 End,
  846.              End,
  847.           End,
  848.        End;
  849.  
  850.     In this case, the user will get the prefs-section chapter
  851.     of "myapp.guide" when he requests help in the Prefs window,
  852.     the play-string chapter when he requests help over the
  853.     string gadget in the Play window or the play-section
  854.     chapter somewhere else in the Play window.
  855.  
  856.     NOTES
  857.     Since muimaster.library V8, this attribute replaces the old
  858.     and obsolete MUIA_HelpFile attribute. MUI no longer supports
  859.     the possibility to specify different help files for different
  860.     parts of your application. This step was necessary due to
  861.     some other internal changes and enhancements.
  862.  
  863.     SEE ALSO
  864.     MUIA_HelpNode, MUIA_HelpLine
  865. Application.mui/MUIA_Application_Iconified
  866.  
  867.     NAME
  868.     MUIA_Application_Iconified -- (V4) [.SG], BOOL
  869.  
  870.     FUNCTION
  871.     Setting this attribute to TRUE causes the application
  872.     to become iconified. Every open window will be closed
  873.     and a (configurable) AppIcon will appear on the workbench.
  874.  
  875.     Same thing happens when the user hits the iconify gadget
  876.     in the window border or uses commodities Exchange to
  877.     hide your applications interface.
  878.  
  879.     There is no way for you to prevent your application from
  880.     being iconified. However, you can react on the iconification
  881.     by listening to the MUIA_Application_Iconified attribute
  882.     with notification. This allows you to free some resources
  883.     you don't need in iconified state.
  884.  
  885.     When an application is iconified and you try to open a
  886.     window, the window won't open immediately. Instead MUI
  887.     remembers this action and opens the window once the
  888.     application is uniconified again.
  889.  
  890.     EXAMPLE
  891.  
  892.     /* inform the main input loop of iconification events */
  893.  
  894.     #define ID_HIDE 42
  895.     #define ID_SHOW 24
  896.  
  897.     DoMethod(app,MUIM_Notify,
  898.        MUIA_Application_Iconified, TRUE,
  899.        app, 2, MUIM_Application_ReturnID, ID_HIDE);
  900.  
  901.     DoMethod(app,MUIM_Notify,
  902.        MUIA_Application_Iconified, FALSE,
  903.        app, 2, MUIM_Application_ReturnID, ID_SHOW);
  904.  
  905.     SEE ALSO
  906.     MUIA_Application_DiskObject
  907. Application.mui/MUIA_Application_Menu
  908.  
  909.     NAME
  910.     MUIA_Application_Menu -- (V4) [I.G], struct NewMenu * (OBSOLETE)
  911.  
  912.     FUNCTION
  913.     Obsolete, use MUIA_Application_Menustrip instead.
  914.  
  915.     SEE ALSO
  916.     MUIA_Application_Menustrip
  917. Application.mui/MUIA_Application_MenuAction
  918.  
  919.     NAME
  920.     MUIA_Application_MenuAction -- (V4) [..G], ULONG
  921.  
  922.     FUNCTION
  923.     Whenever a menu item is selected, this attribute will be
  924.     set to the corresponding UserData field of the gadtools
  925.     NewMenu structure. This allows reacting on menu items
  926.     via broadcasting.
  927.  
  928.     SEE ALSO
  929.     MUIA_Application_Menu, MUIA_Application_MenuAction
  930. Application.mui/MUIA_Application_MenuHelp
  931.  
  932.     NAME
  933.     MUIA_Application_MenuHelp -- (V4) [..G], ULONG
  934.  
  935.     FUNCTION
  936.     Whenever a menu item is selected with the help key, this
  937.     attribute will be set to the corresponding UserData field
  938.     of the gadtools NewMenu structure. Together with
  939.     MUIM_Application_ShowHelp this allows creation of
  940.     menu help texts.
  941.  
  942.     SEE ALSO
  943.     MUIA_Application_Menu, MUIA_Application_ShowHelp
  944. Application.mui/MUIA_Application_Menustrip
  945.  
  946.     NAME
  947.     MUIA_Application_Menustrip -- (V8) [I..], Object *
  948.  
  949.     FUNCTION
  950.     Specify a menu strip object for the application. The object
  951.     is treated as a child of the application and will be disposed
  952.     when the application is disposed.
  953.  
  954.     Menustrip objects defined for the application are used
  955.     as menu for every window of the application, as long as
  956.     the window doesn't define its private menu.
  957.  
  958.     MUIA_Application_Menustrip replaces the old and obsolete
  959.     MUIA_Application_Menu tag.
  960.  
  961.     Usually, you will create the menu object with MUI's builtin
  962.     object library from a gadtools NewMenu structure, but its
  963.     also OK to define the menu tree "by hand" using the
  964.     Family class.
  965. Application.mui/MUIA_Application_RexxHook
  966.  
  967.     NAME
  968.     MUIA_Application_RexxHook -- (V7) [ISG], struct Hook *
  969.  
  970.     FUNCTION
  971.     When specified, MUI calls this hook whenever a rexx message 
  972.     arrives and MUI can't map it to a builtin or a programmer
  973.     specified command. The hook will be called with a pointer 
  974.     to itself in A0, a pointer to the application object in A2 
  975.     and a pointer to a struct RexxMsg in A1.
  976.  
  977.     The return code from the hook is used as result code
  978.     when replying the message, the secondary result can
  979.     be set with MUIA_Application_RexxString.
  980.  
  981.     SEE ALSO
  982.     MUIA_Application_Commands
  983. Application.mui/MUIA_Application_RexxMsg
  984.  
  985.     NAME
  986.     MUIA_Application_RexxMsg -- (V4) [..G], struct RxMsg *
  987.  
  988.     FUNCTION
  989.     Within an ARexx callback hook, you can obtain
  990.     a pointer to the RexxMsg that came with the
  991.     command. This allows you to use some ARexx
  992.     support functions coming with amiga.lib
  993.  
  994.     SEE ALSO
  995.     MUIA_Application_Commands, MUIA_Application_RexxString
  996. Application.mui/MUIA_Application_RexxString
  997.  
  998.     NAME
  999.     MUIA_Application_RexxString -- (V4) [.S.], STRPTR
  1000.  
  1001.     FUNCTION
  1002.     ARexx allows returning a string as result of a
  1003.     function call. This attribute allows setting the
  1004.     result string within an ARexx callback hook.
  1005.  
  1006.     The string is temporarily copied.
  1007.  
  1008.     SEE ALSO
  1009.     MUIA_Application_Commands, MUIA_Application_RexxMsg
  1010. Application.mui/MUIA_Application_SingleTask
  1011.  
  1012.     NAME
  1013.     MUIA_Application_SingleTask -- (V4) [I..], BOOL
  1014.  
  1015.     FUNCTION
  1016.     Boolean value to indicate whether or not your application
  1017.     is a single task program. When set to TRUE, MUI will
  1018.     refuse to create more than one application object.
  1019.  
  1020.     In this case, the already running application gets its
  1021.     MUIA_DoubleStart attribute set to TRUE. You can listen
  1022.     to this and take appropriate actions, e.g. pop up
  1023.     a requester.
  1024.  
  1025.     Examples for single task applications are the system
  1026.     preferences program. It doesn't make sense for them
  1027.     to run more than once.
  1028.  
  1029.     SEE ALSO
  1030.     MUIA_Application_DoubleStart
  1031. Application.mui/MUIA_Application_Sleep
  1032.  
  1033.     NAME
  1034.     MUIA_Application_Sleep -- (V4) [.S.], BOOL
  1035.  
  1036.     FUNCTION
  1037.     This attribute can be used to put a whole application
  1038.     to sleep. All open windows get disabled and a busy
  1039.     pointer appears.
  1040.  
  1041.     This attribute contains a nesting count, if you tell
  1042.     your application to sleep twice, you will have to tell 
  1043.     it to wake up twice too.
  1044.  
  1045.     If you need to do some time consuming actions, you
  1046.     always should set this attribute to inform the user
  1047.     that you are currently unable to handle input.
  1048.  
  1049.     A sleeping application's windows cannot be resized.
  1050.  
  1051.     EXAMPLES
  1052.     set(app,MUIA_Application_Sleep,TRUE ); // go to bed
  1053.     calc_fractals();
  1054.     set(app,MUIA_Application_Sleep,FALSE); // wake up
  1055.  
  1056.     SEE ALSO
  1057.     MUIA_Window_Sleep, MUIM_Application_InputBuffered
  1058. Application.mui/MUIA_Application_Title
  1059.  
  1060.     NAME
  1061.     MUIA_Application_Title -- (V4) [I.G], STRPTR
  1062.  
  1063.     FUNCTION
  1064.     This tag defines the title of an application.
  1065.     The title is e.g. shown in Commodities Exchange
  1066.     or in the MUI preferences program.
  1067.  
  1068.     An application title shall not contain any version
  1069.     information, just the pure title. Also, special
  1070.     characters such as ":/()#?*..." are not allowed.
  1071.  
  1072.     You should use a quiet long and unique name for
  1073.     your applications. Naming it "Viewer" or "Browser"
  1074.     is not a wise choice.
  1075.  
  1076.     The length of the name must not exceed 30 characters!
  1077.  
  1078.     EXAMPLE
  1079.     ApplicationObject,
  1080.        MUIA_Application_Title      , "WbMan",
  1081.        MUIA_Application_Version    , "$VER: WbMan 0.24 (19.7.93)",
  1082.        MUIA_Application_Copyright  , "© 1993 by Klaus Melchior",
  1083.        MUIA_Application_Author     , "Klaus Melchior",
  1084.        MUIA_Application_Description, "Manages the WBStartup.",
  1085.        MUIA_Application_Base       , "WBMAN",
  1086.        ...
  1087.  
  1088.     SEE ALSO
  1089.     MUIA_Application_Version, MUIA_Application_Copyright,
  1090.     MUIA_Application_Author, MUIA_Application_Description,
  1091.     MUIA_Application_Base
  1092. Application.mui/MUIA_Application_Version
  1093.  
  1094.     NAME
  1095.     MUIA_Application_Version -- (V4) [I.G], STRPTR
  1096.  
  1097.     FUNCTION
  1098.     Define a version string for an application.
  1099.     This string shall follow standard version string
  1100.     convetions but must *not* contain a leading "\0".
  1101.  
  1102.     EXAMPLE
  1103.     see MUIA_Application_Title
  1104.  
  1105.     SEE ALSO
  1106.     MUIA_Application_Title, MUIA_Application_Copyright,
  1107.     MUIA_Application_Author, MUIA_Application_Description,
  1108.     MUIA_Application_Base
  1109. Application.mui/MUIA_Application_Window
  1110.  
  1111.     NAME
  1112.     MUIA_Application_Window -- (V4) [I..], Object *
  1113.  
  1114.     FUNCTION
  1115.     A pointer to a MUI object of Window class. An
  1116.     application may have any number of sub windows,
  1117.     each of them being a child of the application.
  1118.  
  1119.     When the application receives some kind of user
  1120.     input through its IDCMP, it diverts the message
  1121.     down to its children, as long as they are opened.
  1122.  
  1123.     Things like iconification or preferences changes
  1124.     cause the application object to temporarily close
  1125.     every open window (and reopen it later). Your
  1126.     main program normally doesn't need to deal with
  1127.     these things.
  1128.  
  1129.     As with the children of group class, it's common
  1130.     to use a call to MUI_NewObject() as value for
  1131.     this attribute. No error checking needs to be
  1132.     done, the application object handles every
  1133.     failure automatically.
  1134.  
  1135.     When you dispose your application, its sub windows
  1136.     will also get deleted. Thus, the only thing to do
  1137.     to remove your application is a
  1138.  
  1139.     MUI_DisposeObject(ApplicationObject);
  1140.  
  1141.     Every window, every gadget, every memory will be
  1142.     freed by this single call.
  1143.  
  1144.     EXAMPLE
  1145.     Please refer to one of the example programs.
  1146.  
  1147.     SEE ALSO
  1148.