home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!ursa!buzz
- From: buzz@bear.com (Buzz Moschetti)
- Newsgroups: comp.windows.x.motif
- Subject: Yet another "Has anyone created..." Request
- Message-ID: <BUZZ.93Jan6092406@lion.bear.com>
- Date: 6 Jan 93 14:24:06 GMT
- Sender: news@bear.com
- Reply-To: buzz@bear.com (Buzz Moschetti)
- Organization: Bear, Stearns & Co. - FAST
- Lines: 33
-
- Anyone who has worked with popup and option menus knows that they are are
- tedious to put together. The grundiness factor is complemented by a
- performance hit when one wants, say, a popup menu to be attached to *many*
- widgets. Conventional programming style would create duplicate menus for
- each widget, creating a large number of redundant widgets.
-
- What is needed is an Motif utility to construct popup menus and option
- menus on the fly. Tentative design:
-
- Widget XmVaCreatePopupMenu(parent, [ resources ,] ...);
-
- If a widget (e.g. a label) wishes to attach the menu, it calls
- XmAttachPopupMenu(label_widget, menu);
-
- Such a design enables us to do this:
-
- Widget menu_w;
- Widget *mess_of_widgets;
- String choices[] = {"Add","Delete","Copy", 0};
- ...
- menu_w = XbsVaCreatePopupMenu(parent_widget,
- XmNtitle, "Edit",
- XmNalignment, XmALIGNMENT_CENTER,
- XbsNmenuChoices, choices,
- XbsNselectCallback, my_callback,
- NULL);
-
- /* Attach it to all the widgets: */
- for(i = 0; i < max; i++) {
- XbsAttachPopupMenu(mess_of_widgets[i], menu_w);
- }
-
- Anyone care to post something like this?
-