home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.windows.x:15428 comp.windows.x.motif:5707
- Path: sparky!uunet!kithrup!stanford.edu!agate!overload.lbl.gov!lll-winken!mesa.llnl.gov!mark
- From: mes@llnl.gov (Mark Spruiell)
- Newsgroups: comp.windows.x,comp.windows.x.motif
- Subject: Global translations
- Message-ID: <133914@lll-winken.LLNL.GOV>
- Date: 19 Aug 92 23:28:31 GMT
- Sender: usenet@lll-winken.LLNL.GOV
- Reply-To: mes@llnl.gov
- Followup-To: comp.windows.x
- Organization: Lawrence Livermore National Laboratory
- Lines: 42
- Nntp-Posting-Host: mesa.llnl.gov
-
-
- I am in a situation where I would like to respond to a keypress, the F7
- key for example, by displaying a child dialog. However, this action is
- not universally available throughout the application, it only makes
- sense when the user is in certain fields.
-
- This is all well and good, but I would also like to give some feedback
- to the user when they've hit the key but the action isn't available in
- their current context. This means I need something like a "default"
- event handler or action procedure which catches all of the F7
- keypresses that child widgets aren't interested in.
-
- My first attempt at a solution involved a simple addition to the app-defaults
- file:
-
- MyApp*translations: #override <Key>F7: UnavailableAction()
-
- the idea being that every widget would have this translation, and the
- ones that were really interested in it would override it (again) with
- a new action procedure.
-
- However, this had the unfortunate effect of completely REMOVING
- translations for some widgets. According to comp.windows.x.motif FAQ
- #116, the only way you can augment/override a Motif widget's default
- translations is AFTER the widget's Initialize method, i.e.
- XtSetValues (fixed in 1.2???).
-
- I may be able to accomplish the same goal through the application's
- interface; in other words, give some visual clue when it's OK to press
- the F7 button, but I'd still like to find out if there's another way
- to do this.
-
- BTW: DECstation 5000, Ultrix 4.2, Motif 1.1.1, X11R4
-
- Ideas anyone?
-
- Thanks alot
-
- -----------------------------------
- Mark Spruiell (mes@llnl.gov)
- who works at but does not represent
- Lawrence Livermore National Laboratory
-