[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

2479.0. "<< Popup Menu Positioning >>" by WONDER::COMMO (I&#039;ll find no bug before its time!) Tue Mar 20 1990 09:07

I seem to be having a problem with positioning a popup menu.  The menu is
described in a UIL, complete with all possible choices.  It is meant to
be used in two user-configurable modes.

Mode 1:		Unallowed choices are grayed out.  This works well.

Mode 2:		Unallowed choices are unManaged and therefore do not
		appear in the menu.

The problem is that even though I have set DwtNmenuHistory to be the
top-most pushbutton in the menu (which is always present and whose
position never changes) the menu will not come up at that position.
For example...  The last menu popup had 7 entries and the 7th was picked
by the user.  The current choice only has three entries, so DwtNmenuHistory
is set to the top-most widget's id.  When the menu is popped, it comes
up as though it had 7 entries with the 7th entry under the pointer.

The code fragments for doing this is (approximately... since the system
is down and I can't pull in the direct source code)

	.
	.
	.
	/* force resize... */
	SetSomething(popupMenuW,DwtNwidth,0);
	SetSomething(popupMenuW,DwtNheight,0);
	GetSomething(popupMenuW,DwtNmenuHistory,&lastSelection)

	/* do we need to reset the menu... */
	if (lastSelection  &&  !XtIsManaged(lastSelection)
		SetSomething(popupMenuW,DwtNmenuHistory,topEntryW);
	

	/* position the menu */
	DwtPositionMenu(popupMenuW,myEvent)
	.
	.


Any hints will be greatfully accepted.

- norm
T.RTitleUserPersonal
Name
DateLines
2479.1TLE::D_SMITHThu Mar 22 1990 08:344
I remember having problems with menuHistory a while back.  My recollection is
that the toolkit didn't actually save the menuHistory, but instead saved the
'y' value of the menu entry.  This 'y' value was not accessible from an 
application.
2479.2And an approachDECWIN::KLEINThu Mar 22 1990 10:2110
>I remember having problems with menuHistory a while back.  My recollection is
>that the toolkit didn't actually save the menuHistory, but instead saved the
>'y' value of the menu entry.  This 'y' value was not accessible from an 
>application.

... and the workaround is to have the application always keep track of the
menu history (by keeping track of the last selected entry in a static variable)
and always set the menu history before popping up the menu.

-steve-