| It would be much easier to use this code to keep the popup menu from going
offscreen:
...
/* Let the toolkit try to position the popup menu. Then, to be
* friendly, make sure that it is completely visible on the screen. */
DwtMenuPosition (popupMenuW, eventP);
if (popupMenuW->core.x < 0) popupMenuW->core.x = 0;
if ((popupMenuW->core.x + popupMenuW->core.width) >
popupMenuW->core.screen->width) popupMenuW->core.x =
popupMenuW->core.screen->width - popupMenuW->core.width;
if (popupMenuW->core.y < 0) popupMenuW->core.y = 0;
if ((popupMenuW->core.y + popupMenuW->core.height) >
popupMenuW->core.screen->height) popupMenuW->core.y =
popupMenuW->core.screen->height - popupMenuW->core.height;
/* And pop it up. */
XtManageChild (popupMenuW);
...
-steve-
|
| Is "popupMenuW->core.screen->" a core widget record, or is some other
data type used to describe the screen? If so, what?
Looks like the SDL that generated the ADA declarations I'm using for
this stuff left something to be desired, as there doesn't seem to be
much type information left.
John
|