home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / desklib / Docs / ModuleNote / Event < prev    next >
Encoding:
Text File  |  1992-04-11  |  1.5 KB  |  37 lines

  1. User notes for Event.c
  2. ======================
  3.  
  4. Note that Event does not know when you delete a window. Thus, before you
  5. delete a window, call Event_ReleaseWindow() to release all event claims for
  6. that window handle.
  7.  
  8. Otherwise, the best you can hope for is a slight drag effect on the speed of
  9. event dispatching as it searches through lists of unneeded handler
  10. registrations, and the worst you can expect is to find a whole load of
  11. handlers attached to a window you create later that happens to end up with
  12. the same window handle as one of it's predecessors.
  13. This will also return (small) amounts of memory back to the free "malloc"
  14. pool.
  15.  
  16. It is suggested that you use Window_CreateAndShow() and Window_Delete(), as
  17. these calls handle the following for you:
  18.   Creation and opening of the window
  19.   Allocation of memory for indirected icons, etc.
  20.  
  21.   Closing and deleting the window,
  22.   Deallocating any memory claimed for the window,
  23.   Removal of any handlers you have added for that window.
  24. ...and force you to do the "right thing" by only creating windows when you
  25. first need them, and deleting them as soon as they are closed.
  26.  
  27. ---
  28.  
  29. Note that some functions in RISC OS Lib, such as those to find out the last
  30. event received, do not immediately appear to have a DeskLib equivalent.
  31. The reason for this is in fact that I see no reason to waste memory and
  32. processor time on a useless function - event stores this value in a global
  33. variable, (event_lastevent) and you are free to use this variable as you see
  34. fit. (Just don't be antisocial towards it!)
  35.  
  36. ---
  37.