home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / windows / x / 15428 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  2.1 KB

  1. Xref: sparky comp.windows.x:15428 comp.windows.x.motif:5707
  2. Path: sparky!uunet!kithrup!stanford.edu!agate!overload.lbl.gov!lll-winken!mesa.llnl.gov!mark
  3. From: mes@llnl.gov (Mark Spruiell)
  4. Newsgroups: comp.windows.x,comp.windows.x.motif
  5. Subject: Global translations
  6. Message-ID: <133914@lll-winken.LLNL.GOV>
  7. Date: 19 Aug 92 23:28:31 GMT
  8. Sender: usenet@lll-winken.LLNL.GOV
  9. Reply-To: mes@llnl.gov
  10. Followup-To: comp.windows.x
  11. Organization: Lawrence Livermore National Laboratory
  12. Lines: 42
  13. Nntp-Posting-Host: mesa.llnl.gov
  14.  
  15.  
  16. I am in a situation where I would like to respond to a keypress, the F7
  17. key for example, by displaying a child dialog.  However, this action is
  18. not universally available throughout the application, it only makes
  19. sense when the user is in certain fields.
  20.  
  21. This is all well and good, but I would also like to give some feedback
  22. to the user when they've hit the key but the action isn't available in
  23. their current context.  This means I need something like a "default"
  24. event handler or action procedure which catches all of the F7
  25. keypresses that child widgets aren't interested in.
  26.  
  27. My first attempt at a solution involved a simple addition to the app-defaults
  28. file:
  29.  
  30.     MyApp*translations:    #override <Key>F7:  UnavailableAction()
  31.  
  32. the idea being that every widget would have this translation, and the
  33. ones that were really interested in it would override it (again) with
  34. a new action procedure.
  35.  
  36. However, this had the unfortunate effect of completely REMOVING
  37. translations for some widgets.  According to comp.windows.x.motif FAQ
  38. #116, the only way you can augment/override a Motif widget's default
  39. translations is AFTER the widget's Initialize method, i.e.
  40. XtSetValues (fixed in 1.2???).
  41.  
  42. I may be able to accomplish the same goal through the application's
  43. interface; in other words, give some visual clue when it's OK to press
  44. the F7 button, but I'd still like to find out if there's another way
  45. to do this.
  46.  
  47. BTW: DECstation 5000, Ultrix 4.2, Motif 1.1.1, X11R4
  48.  
  49. Ideas anyone?
  50.  
  51. Thanks alot
  52.  
  53. -----------------------------------
  54. Mark Spruiell (mes@llnl.gov)
  55. who works at but does not represent
  56. Lawrence Livermore National Laboratory
  57.