Path: utzoo!attcan!utgpu!watmath!iuvax!rutgers!aramis.rutgers.edu!milind From: milind@aramis.rutgers.edu (Milind Deshpande) Newsgroups: comp.windows.x Subject: Questions on popups. Message-ID: Date: 17 Aug 89 14:40:38 GMT Organization: Rutgers Univ., New Brunswick, N.J. Lines: 60 I have been playing with popup menus and I have following questions. Please help me out (for X11R3 and athena widgets). I am still not clear why one needs to use XtTranslateCoords() routine? Why can't one use x_toot and y_root values (instead of x and y values) from event->xbutton structure? *********** Some of the athena widgets have 'actions' [such as set(), highlight()] listed for them. Are there any such actions for shell widgets? (Looks as if MenuPopup() and MenuPopdown() are.) Are there any other? *********** In my program, I have a button A, which when clicked upon, pops a menu. To that end, the button uses the following: popup_actions = XtParseTranslationTable( ": set() move_menu() MenuPopup(menu)\n"); /* move_menu() moves the popup menu shell to the right place */ The popup shell (for the menu) uses following translation: popdown_actions = XtParseTranslationTable( ": MenuPopdown()\n"); and each of the buttons in the menu use the following: button_actions = XtParseTranslationTable( ": set()\n"); All this works alright. The problem is that after the menu pops down, button A still remains in 'active' state (it remains in foreground color...black). I have to RE-ENTER and EXIT that button, to bring it to 'inactive' state. This looks quite confusing for a user. (I have seen this behavior in xpostit program too.) Since the menu pops up in a 'XtGrabExclusive' mode (Am I correct?), the button A never gets a 'LeaveWindow' event (this is needed as per the default action table for the button to execute reset() action). That's why the re-entering is essential. If I want to use translation tables, how can I program this to avoid the "problem"? ************ When I tried to use a XtGrabNonexclusive mode by for the popup menu by using the following: popup_actions = XtParseTranslationTable( ": set() set_pos() MenuPopup(menu)\n"); I got the following warning during execution of the program (the program worked as per the translation table I specified). "X Toolkit Warning: Pop-up menu creation is only supported on ButtonPress or EnterNotify events." What does this mean? ************* Thanks a lot. ilind@alux5.att.com (Milind Deshpande)