From: hebo@hp850.mbari.org (Bob Herlien)
Newsgroups: comp.windows.x.motif,comp.sys.hp
Subject: Help!  Menus aren't working on my HP 750
Keywords: Menu
Date: 13 Oct 92 23:09:23 GMT
Followup-To: comp.windows.x.motif
Organization: Monterey Bay Aquarium Research Institute

Simple option and popup menus don't appear to work properly on my HP 750
system, although the same code works correctly on my HP 370.  Systems:

HP 9000/750, HP-UX 8.07, X11R4, Motif 1.1.? (1.1.3, I think)
HP 9000/370, HP-UX 8.00, X11R4, Motif 1.1.? (1.1.3, I think)

Symptoms:
1) The example programs for Nye & O'Reilly, Volume 6 (Motif Prog Manual),
   chapter 16 (Menus) don't work correctly on the 750, although they do on
   the 370.  For example, simple_option.c, which creates an option menu with
   4 options using XmVaCreateSimpleOptionMenu(), operates in the following
   erroneous manner:
   - when you click mouse button 1 on the option men, it pops up a tiny
     (looks like 10x10 pixels or so) square, rather than the entire menu.
   - the name of the default option is "option_menu_cascadeBtn", instead
     of "Line".

    Here's the pertinent code from simple_option.c:

    draw_shape = XmStringCreateSimple("Draw Mode:");
    line = XmStringCreateSimple("Line");
    square = XmStringCreateSimple("Square");
    circle = XmStringCreateSimple("Circle");
    option_menu = XmVaCreateSimpleOptionMenu(rc, "option_menu",
        draw_shape, 'D', 0, option_cb,
        XmVaPUSHBUTTON, line, 'L', NULL, NULL,
        XmVaPUSHBUTTON, square, 'S', NULL, NULL,
        XmVaPUSHBUTTON, circle, 'C', NULL, NULL,
        NULL);
    XmStringFree(line);
    XmStringFree(square);
    XmStringFree(circle);
    XmStringFree(draw_shape);

   Similarly, simple_popup.c pops up the tiny square instead of the menu.
   But build_popup.c, build_option.c, and make_pulldown.c, which work by
   first creating the menu (XmCreateOptionMenu(), XmCreatePopupMenu(), etc)
   and then adding the children, work OK.


2) Here's the problem I really want to solve.
   I use Builder Xcessory 2.5 (BX) on my HP 750 to build my application.
   BX creates option menus by first calling XtCreatePopupShell to create
   a popup shell of class xmMenuShellWidgetClass, creating a child RowColum
   of type XmMENU_PULLDOWN, and then creating PushButton children of that.
   When I build my application using BX and then run it, as soon as the 
   user clicks on the option menu, it seems to steal keyboard focus and
   doesn't give it up.  This is demonstrated by the fact that my TextField
   widgets, which are siblings of the PopupShell, can no longer be edited.
   That is, when you subsequently click on the TextField, it doesn't highlight,
   you can't enter text, and the cursor is not the text entry cursor that
   looks kind of like a capital 'I', but the carat cursor that looks like '^'.
   Also, no other widgets (PushButtons, etc) ever again get the red
   highlightling that indicated it's selected.

   Can anybody shed any light on what's going on?  Or tell me what information
   I've left out, or what I need to try, to allow someone out there to
   diagnose my problem?   Any and all help is appreciated.  Thanks.

--------------------------------------------------------------
Bob Herlien
MBARI (Monterey Bay Aquarium Research Institute)
hebo@mbari.org