home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 5 / amigaformatcd05.iso / mui / developer / autodocs / mui_notify.doc < prev    next >
Encoding:
Text File  |  1996-08-13  |  22.0 KB  |  770 lines

  1. TABLE OF CONTENTS
  2.  
  3. Notify.mui/Notify.mui
  4. Notify.mui/MUIA_ApplicationObject
  5. Notify.mui/MUIA_AppMessage
  6. Notify.mui/MUIA_HelpLine
  7. Notify.mui/MUIA_HelpNode
  8. Notify.mui/MUIA_NoNotify
  9. Notify.mui/MUIA_Parent
  10. Notify.mui/MUIA_Revision
  11. Notify.mui/MUIA_UserData
  12. Notify.mui/MUIA_Version
  13. Notify.mui/MUIM_CallHook
  14. Notify.mui/MUIM_Export
  15. Notify.mui/MUIM_FindUData
  16. Notify.mui/MUIM_GetUData
  17. Notify.mui/MUIM_Import
  18. Notify.mui/MUIM_KillNotify
  19. Notify.mui/MUIM_MultiSet
  20. Notify.mui/MUIM_NoNotifySet
  21. Notify.mui/MUIM_Notify
  22. Notify.mui/MUIM_Set
  23. Notify.mui/MUIM_SetAsString
  24. Notify.mui/MUIM_SetUData
  25. Notify.mui/MUIM_SetUDataOnce
  26. Notify.mui/MUIM_WriteLong
  27. Notify.mui/MUIM_WriteString
  28. Notify.mui/Notify.mui
  29.  
  30.     Notify class is superclass of all other MUI classes.
  31.     It's main purpose is to handle MUI's notification
  32.     mechanism, but it also contains some other methods
  33.     and attributes useful for every object.
  34. Notify.mui/MUIA_ApplicationObject
  35.  
  36.     NAME
  37.     MUIA_ApplicationObject -- (V4 ) [..G], Object *
  38.  
  39.     FUNCTION
  40.     You can obtain a pointer to the application object
  41.     that some gadget belongs to by using this attribute.
  42.     Useful mainly within callback hooks if you do not want
  43.     to deal with global variables.
  44.  
  45.     If your object is not currently attached to an application,
  46.     you will receive NULL.
  47.  
  48.     SEE ALSO
  49.     MUIA_WindowObject
  50. Notify.mui/MUIA_AppMessage
  51.  
  52.     NAME
  53.     MUIA_AppMessage -- (V5 ) [..G], struct AppMessage *
  54.  
  55.     FUNCTION
  56.     When your window is an AppWindow, i.e. you have set the
  57.     MUIA_Window_AppWindow attribute to TRUE, you will be able
  58.     to get AppMessages by listening to MUIA_AppMessage.
  59.     Whenever an AppMessage arrives, this attribute will
  60.     be set to a pointer to that message.
  61.  
  62.     MUIA_AppMessage is object specific. You can e.g. set up
  63.     different notifications for different objects in your window,
  64.     they will only get exectued when icons are dropped over the
  65.     specific object.
  66.  
  67.     If you wait on MUIA_AppMessage with a window object, your
  68.     notify will always get executed when icons are dropped on
  69.     the window.
  70.  
  71.     Notes:
  72.  
  73.     - You should use the MUIM_CallHook method to call a
  74.       hook function when an AppMessage arrives (see below).
  75.       The pointer to the AppMessage is valid only as long as 
  76.       the notification method is executed.
  77.  
  78.     - AppWindows are only possible on the workench screen.
  79.  
  80.  
  81.     EXAMPLE
  82.  
  83.     /* Call the AppMsgHook when an icon is dropped on a listview */
  84.  
  85.     DoMethod(lvobj,MUIM_Notify,MUIA_AppMessage,MUIV_EveryTime,
  86.              lvobj,3,MUIM_CallHook,&AppMsgHook,MUIV_TriggerValue);
  87.  
  88.     /* Call the AppMsgHook when an icon is dropped on the window */
  89.  
  90.     DoMethod(winobj,MUIM_Notify,MUIA_AppMessage,MUIV_EveryTime,
  91.              winobj,3,MUIM_CallHook,&AppMsgHook,MUIV_TriggerValue);
  92.  
  93.     SEE ALSO
  94.     MUIA_Window_AppWindow, MUIA_Application_DropObject, MUIM_CallHook
  95. Notify.mui/MUIA_HelpLine
  96.  
  97.     NAME
  98.     MUIA_HelpLine -- (V4 ) [ISG], LONG
  99.  
  100.     FUNCTION
  101.     Define a line in a help file specified with 
  102.     MUIA_Application_HelpFile.
  103.  
  104.     SEE ALSO
  105.     MUIA_Application_HelpFile, MUIA_HelpNode
  106. Notify.mui/MUIA_HelpNode
  107.  
  108.     NAME
  109.     MUIA_HelpNode -- (V4 ) [ISG], STRPTR
  110.  
  111.     FUNCTION
  112.     Define a node in a help file specified with
  113.     MUIA_Application_HelpFile.
  114.  
  115.     SEE ALSO
  116.     MUIA_Application_HelpFile, MUIA_HelpLine
  117. Notify.mui/MUIA_NoNotify
  118.  
  119.     NAME
  120.     MUIA_NoNotify -- (V7 ) [.S.], BOOL
  121.  
  122.     FUNCTION
  123.     If you set up a notify on an attibute to react on user input,
  124.     you will also recognize events when you change this attribute
  125.     under program control with SetAttrs(). Setting MUIA_NoNotify
  126.     together with your attribute will prevent this notification
  127.     from being triggered.
  128.  
  129.     NOTE
  130.     MUIA_NoNotify is a "one time" attribute. Its only valid during
  131.     the current SetAttrs() call!
  132.  
  133.     EXAMPLE
  134.     SetAttrs(slider,MUIA_NoNotify,TRUE,MUIA_Slider_Level,26,TAG_DONE);
  135. Notify.mui/MUIA_Parent
  136.  
  137.     NAME
  138.     MUIA_Parent -- (V11) [..G], Object *
  139.  
  140.     FUNCTION
  141.     Get a pointer to the parent object of the current object.
  142.     The parent obect is always the group/family object which 
  143.     contains the current object. If an object has no parent
  144.     group, this attribute will be NULL.
  145.  
  146.     SEE ALSO
  147.     group.mui/MUIA_Group_Child
  148. Notify.mui/MUIA_Revision
  149.  
  150.     NAME
  151.     MUIA_Revision -- (V4 ) [..G], LONG
  152.  
  153.     FUNCTION
  154.     Get the revision number of an objects class. Although
  155.     MUIA_Revision is documented at notify class, you will
  156.     of course receive the revision number of the objects true
  157.     class.
  158.  
  159.     EXAMPLE
  160.     strobj = MUI_NewObject(MUIC_String,...,TAG_DONE);
  161.         ...
  162.     get(strobj,MUIA_Version ,&v);
  163.     get(strobj,MUIA_Revision,&r);
  164.     printf("String class version %ld.%ld\n",v,r);
  165.  
  166.     SEE ALSO
  167.     MUIA_Version
  168. Notify.mui/MUIA_UserData
  169.  
  170.     NAME
  171.     MUIA_UserData -- (V4 ) [ISG], ULONG
  172.  
  173.     FUNCTION
  174.     A general purpose value to fill in any kind of information.
  175. Notify.mui/MUIA_Version
  176.  
  177.     NAME
  178.     MUIA_Version -- (V4 ) [..G], LONG
  179.  
  180.     FUNCTION
  181.     Get the version number of an objects class. Although
  182.     MUIA_Version is documented at notify class, you will
  183.     of course receive the version number of the objects true
  184.     class.
  185.  
  186.     EXAMPLE
  187.     strobj = MUI_NewObject(MUIC_String,...,TAG_DONE);
  188.         ...
  189.     get(strobj,MUIA_Version ,&v);
  190.     get(strobj,MUIA_Revision,&r);
  191.     printf("String class version %ld.%ld\n",v,r);
  192.  
  193.     SEE ALSO
  194.     MUIA_Revision
  195. Notify.mui/MUIM_CallHook
  196.  
  197.     NAME
  198.     MUIM_CallHook (V4 )
  199.  
  200.     SYNOPSIS
  201.     DoMethod(obj,MUIM_CallHook,struct Hook *Hook, ULONG param1, /* ... */);
  202.  
  203.     FUNCTION
  204.     Call a standard amiga callback hook, defined by a Hook
  205.     structure. Together with MUIM_Notify, you can easily
  206.     bind hooks to buttons, your hook will be called when
  207.     the button is pressed.
  208.  
  209.     The hook will be called with a pointer to the hook
  210.     structure in a0, a pointer to the calling object in a2
  211.     and a pointer to the first parameter in a1.
  212.  
  213.     INPUTS
  214.     Hook       pointer to a struct Hook.
  215.     param1,... zero or more parameters. The hook function will
  216.                receive a pointer to the first parameter in
  217.                register a1.
  218.  
  219.     EXAMPLE
  220.  
  221.     standalone:
  222.  
  223.     DoMethod(obj,MUIM_CallHook,&hookstruct,13,42,"foobar","barfoo");
  224.  
  225.     within a notification statement:
  226.  
  227.     DoMethod(propobj,MUIM_Notify,MUIA_Prop_First,MUIV_EveryTime,
  228.              propobj,3,MUIM_CallHook,&prophook,MUIV_TriggerValue);
  229.  
  230.     prophook will be called every time the knob is moving and gets
  231.     a pointer to the knobs current level in a1.
  232. Notify.mui/MUIM_Export
  233.  
  234.     NAME
  235.     MUIM_Export (V12)
  236.  
  237.     SYNOPSIS
  238.     DoMethod(obj,MUIM_Export,Object *dataspace);
  239.  
  240.     FUNCTION
  241.     This method is called for each object in the application tree
  242.     (including menus) during execution of MUIM_Application_Save.
  243.     It's purpose is to export an objects "contents" to a dataspace
  244.     object for later saving to an IFF file.
  245.  
  246.     If you override this method to export your custom data, you
  247.     are supposed to use your MUIA_ObjectID as ID for the dataspace
  248.     entry. Don't export if your MUIA_ObjectID is 0.
  249.  
  250.     RESULT
  251.     Always return 0 or the value from DoSuperMethod() if you want
  252.     your parent classes to be able to import theirselves.
  253.  
  254.     EXAMPLE
  255.     ULONG mExport(struct IClass *cl,Object *obj,struct MUIP_Export *msg)
  256.     {
  257.        struct Data *mydata = INST_DATA(cl,obj);
  258.        ULONG id;
  259.        ULONG exp=0;
  260.  
  261.        if (id=(muiNotifyData(obj)->mnd_ObjectID))
  262.        {
  263.           DoMethod(msg->dataspace,MUIM_Dataspace_Add,
  264.                    &mydata->myvalue,sizeof(LONG),id);
  265.        }
  266.  
  267.        return(0);
  268.     }
  269.  
  270.     SEE ALSO
  271.     MUIM_Import, application.mui/MUIM_Application_Load,
  272.     application.mui/MUIM_Application_Save
  273. Notify.mui/MUIM_FindUData
  274.  
  275.     NAME
  276.     MUIM_FindUData (V8 )
  277.  
  278.     SYNOPSIS
  279.     DoMethod(obj,MUIM_FindUData,ULONG udata);
  280.  
  281.     FUNCTION
  282.     This method tests if the MUIA_UserData of the object
  283.     contains the given <udata> and returns the object
  284.     pointer in this case.
  285.  
  286.     Although this is not very useful for single objects,
  287.     performing this method on objects that handle children
  288.     can become very handy. In this case, all the children
  289.     (any maybe their children) are tested against <udata>
  290.     and the first matching object is returned.
  291.  
  292.     This method is especially useful if you created your
  293.     menu tree with a NewMenu structure and you want to
  294.     find the object pointer for a single menu item.
  295.  
  296.     INPUTS
  297.     udata - userdata to look for.
  298.  
  299.     RESULT
  300.     A pointer to the first object with the specified user data
  301.     or NULL if no object is found.
  302.  
  303.     NOTES
  304.     If you have many objects in your application, MUIM_FindUData
  305.     may take quite long. You can limit the amount of time
  306.     by performing the method not on the application but on the
  307.     window or even on the group/family your object is placed in.
  308.  
  309.     SEE ALSO
  310.     MUIM_GetUData, MUIM_SetUData
  311. Notify.mui/MUIM_GetUData
  312.  
  313.     NAME
  314.     MUIM_GetUData (V8 )
  315.  
  316.     SYNOPSIS
  317.     DoMethod(obj,MUIM_GetUData,ULONG udata, ULONG attr, ULONG *storage);
  318.  
  319.    FUNCTION
  320.     This method tests if the MUIA_UserData of the object
  321.     contains the given <udata> and gets <attr> to
  322.     <storage> for itself in this case.
  323.  
  324.     Although this is not very useful for single objects,
  325.     performing this method on objects that handle children
  326.     can become very handy. In this case, all the children
  327.     (any maybe their children) are searched against <udata>
  328.     and the first matching objects will be asked for the
  329.     specified attribute.
  330.  
  331.     INPUTS
  332.     udata   - userdata to look for.
  333.     attr    - attribute to get.
  334.     storage - place to store the attribute.
  335.  
  336.     NOTES
  337.     If you have many objects in your application, MUIM_GetUData
  338.     may take quite long. You can limit the amount of time
  339.     by performing the method not on the application but on the
  340.     window or even on the group/family your objects are place in.
  341.  
  342.     SEE ALSO
  343.     MUIM_SetUData, MUIM_FindUData
  344. Notify.mui/MUIM_Import
  345.  
  346.     NAME
  347.     MUIM_Import (V12)
  348.  
  349.     SYNOPSIS
  350.     DoMethod(obj,MUIM_Import,Object *dataspace);
  351.  
  352.     FUNCTION
  353.     This method is called for each object in the application tree
  354.     (including menus) during execution of MUIM_Application_Load.
  355.     It's purpose is to import an objects "contents" from a dataspace
  356.     object after loading from an IFF file.
  357.  
  358.     If you override this method to import your custom data, you
  359.     are supposed to use your MUIA_ObjectID as ID for the dataspace
  360.     entry. Don't import if your MUIA_ObjectID is 0.
  361.  
  362.     RESULT
  363.     Always return 0 or the value from DoSuperMethod() if you want
  364.     your parent classes to be able to import theirselves.
  365.  
  366.     EXAMPLE
  367.     ULONG mImport(struct IClass *cl,Object *obj,struct MUIP_Import *msg)
  368.     {
  369.        struct Data *mydata = INST_DATA(cl,obj);
  370.        ULONG id;
  371.        ULONG *data;
  372.  
  373.        if (id=(muiNotifyData(obj)->mnd_ObjectID))
  374.        {
  375.           if (data = (ULONG *)DoMethod(msg->dataspace,MUIM_Dataspace_Find,id))
  376.           {
  377.              mydata->myvalue = *data;
  378.           }
  379.        }
  380.  
  381.        return(0);
  382.     }
  383.  
  384.     SEE ALSO
  385.     MUIM_Import, application.mui/MUIM_Application_Load,
  386.     application.mui/MUIM_Application_Save
  387. Notify.mui/MUIM_KillNotify
  388.  
  389.     NAME
  390.     MUIM_KillNotify (V4 )
  391.  
  392.     SYNOPSIS
  393.     DoMethod(obj,MUIM_KillNotify,ULONG TrigAttr);
  394.  
  395.     FUNCTION
  396.     MUIM_KillNotify kills previously given notifications on specific 
  397.     attributes.
  398.  
  399.     INPUTS
  400.     TrigAttr - Attribute for which the notify was specified. If you
  401.                set up more than one notify for an attribute, only
  402.                the first one will be killed.
  403.  
  404.     EXAMPLE
  405.     DoMethod(button,MUIM_KillNotify,MUIA_Pressed);
  406.  
  407.     SEE ALSO
  408.     MUIM_Notify
  409. Notify.mui/MUIM_MultiSet
  410.  
  411.     NAME
  412.     MUIM_MultiSet (V7 )
  413.  
  414.     SYNOPSIS
  415.     DoMethod(obj,MUIM_MultiSet,ULONG attr, ULONG val, APTR obj, /* ... */);
  416.  
  417.     FUNCTION
  418.     Set an attribute for multiple objects.
  419.     Receiving an attribute/value pair and a list of objects,
  420.     this method sets the new value for all the objects in the list.
  421.     This is especially useful for disabling/enabling lots of
  422.     objects with one singe function call.
  423.  
  424.     The object that executes this method isn't affected!
  425.  
  426.     Note: This method was implemented in version 7 of notify class.
  427.  
  428.     INPUTS
  429.     attr     attribute to set.
  430.     value    new value for the attribute.
  431.     obj, ... list of MUI objects, terminated with a NULL pointer.
  432.  
  433.     EXAMPLE
  434.     /* disable all the address related gadgets... */
  435.  
  436.     DoMethod(xxx, MUIM_MultiSet, MUIA_Disabled, TRUE,
  437.        ST_Name, ST_Street, ST_City, ST_Country, ST_Phone, NULL);
  438.  
  439.     /* note that the xxx object doesn't get disabled! */
  440.  
  441.     SEE ALSO
  442.     MUIM_Set, MUIM_Notify
  443. Notify.mui/MUIM_NoNotifySet
  444.  
  445.     NAME
  446.     MUIM_NoNotifySet (V9 )
  447.  
  448.     SYNOPSIS
  449.     DoMethod(obj,MUIM_NoNotifySet,ULONG attr, char *format, ULONG val, /* ... */);
  450.  
  451.     FUNCTION
  452.     Acts like MUIM_Set but doesn't trigger any notification.
  453.     This can become useful to avoid deadlocks with bi-directional
  454.     connections.
  455.  
  456.     INPUTS
  457.     attr  attribute you want to set.
  458.     val   value to set the attribute to.
  459.  
  460.     EXMAPLE
  461.     DoMethod(editor,MUIM_Notify,EDIT_Top,MUIV_EveryTime,
  462.        sbar,3,MUIM_NoNotifySet,MUIA_Prop_First,MUIV_TriggerValue);
  463.  
  464.     DoMethod(sbar,MUIM_Notify,MUIA_Prop_First,MUIV_EveryTime,
  465.        editor,3,MUIM_NoNotifySet,EDIT_Top,MUIV_TriggerValue);
  466.  
  467.     SEE ALSO
  468.     MUIM_Set
  469. Notify.mui/MUIM_Notify
  470.  
  471.     NAME
  472.     MUIM_Notify (V4 )
  473.  
  474.     SYNOPSIS
  475.     DoMethod(obj,MUIM_Notify,ULONG TrigAttr, ULONG TrigVal, APTR DestObj, ULONG FollowParams, /* ... */);
  476.  
  477.     FUNCTION
  478.     Add a notification event handler to an object. Notification
  479.     is essential for every MUI application.
  480.  
  481.     A notification statement consists of a source object,
  482.     an attribute/value pair, a destination object and a
  483.     notification method. The attribute/value pair belongs
  484.     to the source object and determines when the notification
  485.     method will be executed on the destination object.
  486.  
  487.     Whenever the source object gets the given attribute set to
  488.     the given value (this can happen because of the user
  489.     pressing some gadgets or because of your program explicitly
  490.     setting the attribute with SetAttrs()), the destination
  491.     object will execute the notification method.
  492.  
  493.     With some special values, you can trigger the notification
  494.     every time the attribute is changing. In this case, you
  495.     can include the triggering attributes value within the
  496.     notification method. See below.
  497.  
  498.     One big problem with notification are endless loops.
  499.     Imagine you have a prop gadget and want to show its
  500.     state with a gauge object. You connect MUIA_Prop_First
  501.     with MUIA_Gauge_Max and everything is fine, the gauge
  502.     gets updated when the user drags around the gadget. On
  503.     the other hand, if your program sets the gauge to a new
  504.     value, you might want your prop gadget to immediately
  505.     show this change and connect MUIA_Gauge_Max width
  506.     MUIA_Prop_First. Voila, a perfect endless loop.
  507.  
  508.     To avoid these conditions, MUI always checks new
  509.     attribute values against the current state and
  510.     cancels notification when both values are equal.
  511.     Thus, setting MUIA_Prop_First to 42 if the prop
  512.     gadgets first position is already 42 won't trigger
  513.     any notification event.
  514.  
  515.     INPUTS
  516.     TrigAttr     attribute that triggers the notification.
  517.  
  518.     TrigValue    value that triggers the notification. The
  519.                  special value MUIV_EveryTime makes MUI execute
  520.                  the notification method every time when
  521.                  TrigAttr changes. In this case, the special
  522.                  value MUIV_TriggerValue in the notification
  523.                  method will be replaced with the value
  524.                  that TrigAttr has been set to. You can use
  525.                  MUIV_TriggerValue up to four times in one
  526.                  notification method. Since version 8 of
  527.                  muimaster.library, you can also use
  528.                  MUIV_NotTriggerValue here. In this case,
  529.                  MUI will replace TRUE values with FALSE
  530.                  and FALSE values with TRUE. This
  531.                  can become quite useful when you try to set
  532.                  "negative" attributes like MUIA_Disabled.
  533.  
  534.     DestObj      object on which to perform the notification
  535.                  method. Either supply a valid object pointer or
  536.                  one of the following special values (V10) which
  537.                  will be resolved at the time the event occurs:
  538.                  MUIV_Notify_Self        - notifies the object
  539.                                            itself.
  540.                  MUIV_Notify_Window      - notifies the object's
  541.                                            parent window.
  542.                  MUIV_Notify_Application - notifies the object's
  543.                                            application.
  544.  
  545.     FollowParams number of following parameters. If you e.g.
  546.                  have a notification method with three parts
  547.                  (maybe MUIM_Set,attr,val), you have to set
  548.                  FollowParams to 3. This allows MUI to copy
  549.                  the complete notification method into a
  550.                  private buffer for later use.
  551.  
  552.     ...          following is the notification method.
  553.  
  554.     EXAMPLE
  555.  
  556.     /*
  557.     ** Every time when the user releases a button
  558.     ** (and the mouse is still over it), the button object
  559.     ** gets its MUIA_Pressed attribute set to FALSE.
  560.     ** Thats what a program can react on with notification,
  561.     ** e.g. by openening another window.
  562.     */
  563.  
  564.     DoMethod(buttonobj,MUIM_Notify,
  565.        MUIA_Pressed, FALSE,                /* attribute/value pair */
  566.        windowobj,                          /* destination object   */
  567.        3,                                  /* 3 following words    */
  568.        MUIM_Set, MUIA_Window_Open, TRUE);  /* notification method  */
  569.  
  570.     /*
  571.     ** Lets say we want to show the current value of a
  572.     ** prop gadget somewhere in a text field:
  573.     */
  574.  
  575.     DoMethod(propobj,MUIM_Notify,      /* notification is triggered   */
  576.        MUIA_Prop_First, MUIV_EveryTime /* every time the attr changes */
  577.        textobj                         /* destination object */
  578.        4,                              /* 4 following words  */
  579.        MUIM_SetAsString, MUIA_Text_Contents,
  580.        "value is %ld !", MUIV_TriggerValue);
  581.        /* MUIV_TriggerValue will be replaced with the
  582.           current value of MUIA_Prop_First */
  583.  
  584.     /*
  585.     ** Inform our application when the user hits return
  586.     ** in a string gadget:
  587.     */
  588.  
  589.     DoMethod(stringobj,MUIM_Notify,
  590.        MUIA_String_Acknowledge, MUIV_EveryTime,
  591.        MUIV_Notify_Application, 2, MUIM_Application_ReturnID, ID_FOOBAR);
  592. Notify.mui/MUIM_Set
  593.  
  594.     NAME
  595.     MUIM_Set (V4 )
  596.  
  597.     SYNOPSIS
  598.     DoMethod(obj,MUIM_Set,ULONG attr, ULONG val);
  599.  
  600.     FUNCTION
  601.     Set an attribute to a value. Normally, you would set
  602.     attributes with intuition.library SetAttrs() or with
  603.     the OM_SET method as with any other boopsi objects.
  604.     But since these calls need a complete tag list, not
  605.     just a single attribute/value pair, they are not
  606.     useful within a MUIM_Notify method.
  607.  
  608.     INPUTS
  609.     attr  attribute you want to set.
  610.     val   value to set the attribute to.
  611.  
  612.     EXMAPLE
  613.     DoMethod(strobj,MUIM_Set,MUIA_String_Contents,"foobar");
  614.     and
  615.     SetAttrs(strobj,MUIA_String_Contents,"foobar",TAG_DONE);
  616.     are equal.
  617.  
  618.     SEE ALSO
  619.     MUIM_SetAsString, MUIM_Notify, MUIM_NoNotifySet
  620. Notify.mui/MUIM_SetAsString
  621.  
  622.     NAME
  623.     MUIM_SetAsString (V4 )
  624.  
  625.     SYNOPSIS
  626.     DoMethod(obj,MUIM_SetAsString,ULONG attr, char *format, ULONG val, /* ... */);
  627.  
  628.     FUNCTION
  629.     Set a (text kind) attribute to a string. This can be useful
  630.     if you want to connect a numeric attribute of an object with
  631.     a text attribute of another object.
  632.  
  633.     INPUTS
  634.     attr    attribute to set.
  635.     format  C like formatting string, remember to use "%ld" !
  636.     val,... one or more paremeters for the format string.
  637.  
  638.     EXAMPLE
  639.  
  640.     stand alone:
  641.  
  642.     DoMethod(txobj,MUIM_SetAsString,MUIA_Text_Contents,
  643.              "My name is %s and I am %ld years old.",name,age);
  644.  
  645.     within a notification statement:
  646.  
  647.     DoMethod(propobj,MUIM_Notify,MUIA_Prop_First,MUIV_EveryTime,
  648.              txobj,4,MUIM_SetAsString,MUIA_Text_Contents,
  649.              "prop gadget shows %ld.",MUIV_TriggerValue);
  650.  
  651.     SEE ALSO
  652.     MUIM_Set, MUIM_Notify
  653. Notify.mui/MUIM_SetUData
  654.  
  655.     NAME
  656.     MUIM_SetUData (V8 )
  657.  
  658.     SYNOPSIS
  659.     DoMethod(obj,MUIM_SetUData,ULONG udata, ULONG attr, ULONG val);
  660.  
  661.    FUNCTION
  662.     This method tests if the MUIA_UserData of the object
  663.     contains the given <udata> and sets <attr> to
  664.     <val> for itself in this case.
  665.  
  666.     Altough this is not very useful for single objects,
  667.     performing this method on objects that handle children
  668.     can become very handy. In this case, all the children
  669.     (any maybe their children) are tested against <udata>
  670.     and all matching objects will get the attribute set.
  671.  
  672.     If you e.g. want to clear several string gadgets in
  673.     your applciation at once, you simply give them the
  674.     same MUIA_UserData and use
  675.  
  676.     DoMethod(app,MUIM_SetUData,MyUDATA,MUIA_String_Contents,NULL);
  677.  
  678.     INPUTS
  679.     udata - userdata to look for.
  680.     attr  - attribute to set.
  681.     val   - value to set attribute to.
  682.  
  683.     NOTES
  684.     If you have many objects in your application, MUIM_SetUData
  685.     may take quite long. You can limit the amount of time
  686.     by performing the method not on the application but on the
  687.     window or even on the group your gadgets are place in.
  688.  
  689.     SEE ALSO
  690.     MUIM_GetUData, MUIM_FindUData, MUIM_SetUDataOnce
  691. Notify.mui/MUIM_SetUDataOnce
  692.  
  693.     NAME
  694.     MUIM_SetUDataOnce (V11)
  695.  
  696.     SYNOPSIS
  697.     DoMethod(obj,MUIM_SetUDataOnce,ULONG udata, ULONG attr, ULONG val);
  698.  
  699.     FUNCTION
  700.     This method performs like MUIM_SetUData, but stops when it has
  701.     found an object with the given user data. If you don't have
  702.     objects with equal user datas and don't rely on setting all
  703.     of them, MUIM_SetUDataOnce is preferrable because it's more
  704.     efficient.
  705.  
  706.     SEE ALSO
  707.     MUIM_SetUData, MUIM_GetUData
  708.  
  709. Notify.mui/MUIM_WriteLong
  710.  
  711.     NAME
  712.     MUIM_WriteLong (V6 )
  713.  
  714.     SYNOPSIS
  715.     DoMethod(obj,MUIM_WriteLong,ULONG val, ULONG *memory);
  716.  
  717.     FUNCTION
  718.     This method simply writes a longword somewhere to memory.
  719.     Although this seems quite useless, it might become handy
  720.     if used within a notify statement. For instance, you could
  721.     easily connect the current level of a slider with some
  722.     member of your programs data structures.
  723.  
  724.     INPUTS
  725.     val    - value to write
  726.     memory - location to write the value to
  727.  
  728.     EXAMPLE
  729.  
  730.     /* Let the slider automagically write its level to a variable */
  731.  
  732.     static LONG level;
  733.  
  734.     DoMethod(slider,MUIM_Notify,MUIA_Slider_Level,MUIV_EveryTime,
  735.        slider,3,MUIM_WriteLong,MUIV_TriggerValue,&level);
  736.  
  737.     SEE ALSO
  738.     MUIM_WriteString, MUIM_Notify
  739. Notify.mui/MUIM_WriteString
  740.  
  741.     NAME
  742.     MUIM_WriteString (V6 )
  743.  
  744.     SYNOPSIS
  745.     DoMethod(obj,MUIM_WriteString,char *str, char *memory);
  746.  
  747.     FUNCTION
  748.     This method simply copies a string somewhere to memory.
  749.     Although this seems quite useless, it might become handy
  750.     if used within a notify statement. For instance, you could
  751.     easily connect the current contents of a string gadget
  752.     with some member of your programs data structures.
  753.  
  754.     Note: The string is copied with strcpy(), you must assure
  755.               that the destination points to enough memory.
  756.  
  757.     INPUTS
  758.     str    - string to copy
  759.     memory - location to write the value to
  760.  
  761.     EXAMPLE
  762.  
  763.     static char buffer[256];
  764.  
  765.     DoMethod(string,MUIM_Notify,MUIA_String_Contents,MUIV_EveryTime,
  766.        string,3,MUIM_WriteString,MUIV_TriggerValue,buffer);
  767.  
  768.     SEE ALSO
  769.     MUIM_WriteLong, MUIM_Notify
  770.