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

Conference noted::motif

Title:"OSF/Motif" is a trademark
Notice:MOTIF kit note in 7.*
Moderator:GOOEY::GRASS
Created:Mon Aug 07 1989
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:5973
Total number of notes:24620

5921.0. "XmNmenuHistory question?" by CHUECA::JMGUERRA (MCS Madrid) Tue Jan 28 1997 09:41

    Hi,
    
    A client is programming under ADA and with Motif 1.2-4.
    
    They were working the XmNmenuHistory in prior versions to 1.2-4.  It 
    was working correctly.  Now, with Motif 1.2-4, the value returned by
    this resource is incorrect.
    
    I have seen several notes regarding the use of this resource
    (XmNmenuHistory), and some of them said that it doesn't work correctly.
    
    Please, can somebody tell me if the XmNmenuHistory has worked at all?
    Also if it works, what is it suppose to do? Is it supported under Motif
    1.2-4?
    
    We have seen that it was used in the DECBURGER, but it
    doesn't appear in the MOTIFBURGER example. 
    
    
    Thanks and regards
    Jose Miguel
T.RTitleUserPersonal
Name
DateLines
5921.1GERUND::WOLFEI'm going to huff, and puff, and blow your house downTue Jan 28 1997 12:5713
What platform on you on (VMS, UNIX)? 

I use XmNmenuHistory for option menus. You can set which item in the menu
should be the current item and you can query the current item using
this resource. It definitely works in Digital UNIX V4.0 (Motif 1.2-4)
and has always worked for me in the past on all Motif revs. 

The value returned from a XtGetValues for an options menu should be 
the widget id of the currently selected widget in the menu. Are they 
seeing the wrong widget id or garbage? Try using editres to see
what the widget thinks the setting is before you query it. 

			Pete
5921.2H2SO4::GERSBACHEdwin Gersbach MCS SwitzerlandWed Jan 29 1997 04:075
I've written a small ADA application which makes use of this resource, but only
by setting it. I've seen no problems on VMS 6.1/6.2 Motif 1.2-4 (both VAX and
AXP).

Edwin
5921.3any explanationMDR01::NIEVESMCS MadridThu Jan 30 1997 07:4830
    The customer says that the only time the value she puts in the
    XMENUHISTORY appears is the first time, when she does fetch, all the
    following times this value doesn't have the one she put there.
    
    This is what she told me:
    
    
    the first time she creates the window and the window appears (fetch)
    she checks the window exists, if
    it does't exist she does fetch of the mrm jerarchy of the window. 
    
    In Ada, in the menu history she puts the value she wants, she manages the 
    whole window and she makes the window dissapear (she doesn't destroy the 
    window). The following time 
    she wants the window to appear she doesn't have to do fetch because the
    window exists, so she puts a value in the xmnenuhistory and do manage,
    but doesn't do fetch, the window appears, but the xmnenuhistory doesn't
    get the value she put in, instead the value that appears is the last
    window selected in the optionmenu before doing dismiss.
    
    She says that the value she puts in the xmenuhistory only appears
    correctly the first time, not the following ones.
    
    She has tried to change the example in ADA$EXAMPLES:XM_BURGER, she
    reset the optionmenu to put a default value similar to the one of the
    DEC_BURGER.C and it does the same as if you don't put any value.
    
    Which is the correct behaviour of the function?
    
    Nieves 
5921.4H2SO4::GERSBACHEdwin Gersbach MCS SwitzerlandMon Feb 03 1997 03:498
>> ...so she puts a value in the xmnenuhistory and do manage,
>>    but doesn't do fetch ...

What value? The value she would like to see? That would be wrong!
The value has to be the widget id of a menu button!
It may help if you show us some of their code used to change that value.

Edwin
5921.5This seems to work for me.DV780::BROOKSUse the source Luke!Mon Feb 03 1997 11:5435
    I have been successful in setting the XmNmenuHistory resource of an
    option menu by doing the following:
    
    	Widget FORM_id, menu, opt_button;
                                      
        menu = XtNameToWidget(FORM_id, "*MENU");
        opt_button = XtNameToWidget(FORM_id, "*option_PB");
        n = 0;
        XtSetArg(args[n], XmNmenuHistory, opt_button); n++;
        XtSetValues(menu, args, n);
    
    In this case MENU is the name of the option menu and option_PB is the
    name of the XmPushButton in the XmPulldownMenu.  So the widget
    hierarchy is
    
    	XmForm - FORM_id is the widget ID of the XmForm container
    	    XmOptionMenu - MENU is the name of the option menu in the Form.
    		XmPulldownMenu - this is the pulldown menu attached to the
    				 XmOptionMenu.
    		    XmPushButton - option_PB is the name of the pushbutton
    				   that I want to be shown as selected in
    				   the option menu.  This XmPushButton is
    				   a child of the XmPulldownMenu.
                          .
    			  .
    			  .
    		    List of other XmPushButtons in XmPulldownMenu
    			  .
    			  .
    			  .
    
    This has worked on every platform that I have tried and I am not aware
    of any bugs on DIGITAL platforms.  However, I do most of my work on non
    DIGITAL platforms, so someone more knowledgeable on DIGITAL platform
    will have to speak up if there is a known problem.