Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!apple!snorkelwacker!bloom-beacon!DEMON.SIEMENS.COM!atul From: atul@DEMON.SIEMENS.COM (Atul Sharma) Newsgroups: comp.windows.x Subject: (none) Message-ID: <9008151926.AA12257@demon.siemens.com> Date: 15 Aug 90 19:26:40 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 64 I am using Athena Text Widgets and am facing some problem. the behaviour I want is a very simple one: On pressing Button1 a menu should pop-up. and there should be scrollbars. I tried to use the default scrollbars of a textwidget. But the problem was I would get this menu popped up when I would want to do forward scrolling by pressing Button1. Then I tried to get hold of the scrollbars of the text widget and change their translations. But pretty soon i got enough evidence to make me assume that the scrollbars of a textwidget are not widgets. ( Is my assumption correct ). So I tried to write my own action where I can do scrolling or pop menu as and when I want. I wrote this routine, but new problem arose and that was now the menu-entries couldnot be selected. The menu would pop-up but no entry was highlighted upon moving the cursor. I tried to do this in two ways: 1: par[0]=(char *) malloc ( sizeof(char) * 5); par[0] = "menu"; XtCallActionProc(paned,"XawPositionSimpleMenu",event,&par[0],number); XtCallActionProc(paned,"XtMenuPopup",event,&par[0],number); /* I could reason out that this is not working as XtCallActionProc doesnot generate events. So I tried to do things which XtMenuPopup is supposed to do : */ XtRegisterGrabAction(XtMenuPopupAction,True, ButtonPressMask|ButtonRelea seMask, GrabModeAsync, GrabModeAsync); XtPopupSpringLoaded(menu); /* But even that didnot work */:w 2:( the second way I tried - ) /* in my own action change the translations for , i.e. */ String trans5 = ":XawPositionSimpleMenu(menu)MenuPopup(menu)"; translations = XtParseTranslationTable(trans5); XtOverrideTranslations(shell,translations); XtDispatchEvent(event); /* So first I changed the translations to the action routines provided by Athena Widgets for popping up menus viz: XawPositionSimpleMenu, followed by MenuPopup. Then, after changing the translations, I dispatched this event again. But it didnot work. */ I know the behaviour I want probably can be got by using viewport widget, but i don't want to spend more time on it as this is not my original project. Shall appreciate your prompt help. Sincerely Atul