[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1859.0. "Changing menu-history in callback from menu item" by ULTRA::WRAY (John Wray, Secure Systems Development) Thu Dec 07 1989 10:52

    Can I set the MENU_HISTORY value on a popup menu widget inside the
    activate callback of a button that's on the menu?  I'm trying to
    implement "To-bottom" and "To-top" buttons at the top and bottom of the
    popup menu (as a work-around for the menu popping-up off-screen bug),
    but changing MENU_HISTORY on the pop-up menu doesn't seem to have any
    effect.
    
    This attribute is supposed to take a widget reference, isn't it?
    
    John
T.RTitleUserPersonal
Name
DateLines
1859.1Another approach?DECWIN::KLEINThu Dec 07 1989 12:3826
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-
1859.2ULTRA::WRAYJohn Wray, Secure Systems DevelopmentThu Dec 07 1989 15:048
    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
1859.3Not a widget...LEOVAX::TREGGIARIThu Dec 07 1989 16:083
core.screen is a "Screen" as defined in Xlib.h.

Leo