home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / windows / x / motif / 8363 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.5 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!ursa!buzz
  2. From: buzz@bear.com (Buzz Moschetti)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Yet another "Has anyone created..." Request
  5. Message-ID: <BUZZ.93Jan6092406@lion.bear.com>
  6. Date: 6 Jan 93 14:24:06 GMT
  7. Sender: news@bear.com
  8. Reply-To: buzz@bear.com (Buzz Moschetti)
  9. Organization: Bear, Stearns & Co. - FAST
  10. Lines: 33
  11.  
  12. Anyone who has worked with popup and option menus knows that they are are
  13. tedious to put together.  The grundiness factor is complemented by a
  14. performance hit when one wants, say, a popup menu to be attached to *many*
  15. widgets.  Conventional programming style would create duplicate menus for
  16. each widget, creating a large number of redundant widgets.
  17.  
  18. What is needed is an Motif utility to construct popup menus and option
  19. menus on the fly.  Tentative design:
  20.  
  21.     Widget XmVaCreatePopupMenu(parent, [ resources ,] ...);
  22.  
  23. If a widget (e.g. a label) wishes to attach the menu, it calls
  24.     XmAttachPopupMenu(label_widget, menu);
  25.  
  26. Such a design enables us to do this:
  27.  
  28.     Widget menu_w;
  29.     Widget *mess_of_widgets;
  30.     String choices[] = {"Add","Delete","Copy", 0};
  31.     ...
  32.     menu_w = XbsVaCreatePopupMenu(parent_widget,
  33.             XmNtitle,    "Edit",
  34.             XmNalignment,  XmALIGNMENT_CENTER,
  35.             XbsNmenuChoices, choices,
  36.             XbsNselectCallback,  my_callback,
  37.             NULL);
  38.  
  39.     /* Attach it to all the widgets: */
  40.     for(i = 0; i < max; i++) {
  41.         XbsAttachPopupMenu(mess_of_widgets[i], menu_w);
  42.     }
  43.  
  44. Anyone care to post something like this?  
  45.