home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / poplibsr.arc / README.POP < prev    next >
Encoding:
Text File  |  1988-08-19  |  2.7 KB  |  69 lines

  1. What is in this package ?
  2.  
  3. This posting contains a shared library for creating popup menus in all Atari-
  4. programs (not only GEM-Applications, but no accessories). It is based on the
  5. shared library framework of Preston L. Bannister. He had an excellant idea.
  6. Please read the original readme file from his distribution.
  7. There is no easy way to use AES-Calls in a library started at boot-time. So i
  8. choosed the accessory form for this library. The popup.acc does not provide a
  9. menu-entry. It can only be called from inside of other programs.
  10.  
  11.  
  12. What is a popup menu ?
  13.  
  14. It is like an usual GEM-menu in the menu-bar except that it pops up wherever
  15. the mouse cursor is located when you call it. You can then select in the usual
  16. way by clicking with the left mouse button when the desired item is highlighted.
  17. Submenus are indicated by an arrow on the left side of the entry-text. If you
  18. select a submenu, it pops up at the current cursor location and the process of
  19. selection is repeated. You can also cancel the actual menu level by clicking
  20. the right mouse button. If you press the Help-key you'll get some help on the
  21. current entry (or popup menus in general, if no entry is selected).
  22.  
  23.  
  24. How can i use these menus ?
  25.  
  26. You can use them inside your own programs. Perhaps you should first look at the
  27. example source poptest.c . Normally you create a popup-menu by calling the
  28. function DefineMenu("<menu-text>"), where <menu-text> is a list of entries, all
  29. seperated by the pipe-symbol `|'. For more advanced formats you should look at
  30. popup.h, the interface documentation for popup.acc . As return value of the
  31. function DoMenu(), which does the entire dialog, you get the number of the
  32. selected entry.
  33.  
  34.  
  35. How can i provide my own (help) functions ?
  36.  
  37. The format-specification in DefineMenu() is used like the C-function printf().
  38. To specify a function to be called, when an entry is selected (the Help-key is
  39. pressed), you can use the format %f (%h) and provide the function-address as
  40. parameter to DefineMenu(). An example:
  41.  
  42.     beep()
  43.     {
  44.         putchar(7);
  45.     }
  46.  
  47.     menu_selection()
  48.     {
  49.             menu    my_menu;
  50.  
  51.             my_menu = DefineMenu(" hello world ! %f",beep);
  52.             DoMenu(my_menu);
  53.             FreeMenu(my_menu);
  54.     }
  55.  
  56. The function is called with three parameters:
  57.     - the current GEM-handle of the virtual workstation of popup.acc
  58.     - the default return value of this item
  59.     - the string-entry of the current item
  60. If you don't use AES-calls anywhere else in your program, you can use the
  61. FormAlert()-function to display GEM-alerts on the screen (with the usual
  62. parameters of form_alert()). So you need not to link the whole GEM-stuff to
  63. your program.
  64.  
  65. Any comments and suggestions are always welcome. Please mail to one of the
  66. addresses given in the popup.h file or when getting the generic-help message.
  67.  
  68. Edgar Roeder
  69.