home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / motif / 8202 < prev    next >
Encoding:
Text File  |  1992-12-23  |  2.1 KB  |  55 lines

  1. Newsgroups: comp.windows.x.motif
  2. Path: sparky!uunet!ulowell!koverber
  3. From: koverber@cs.ulowell.edu (Kurt Overberg)
  4. Subject: Re: How to break "Return" laws in a Text widget...
  5. Message-ID: <BzpxBw.4Iq@ulowell.ulowell.edu>
  6. Originator: koverber@bigmax.ulowell.edu
  7. Sender: usenet@ulowell.ulowell.edu (News manager - ulowell)
  8. Organization: University of Massachusetts at Lowell Computer Science
  9. References:  <1992Dec23.002819.593@bostech.com>
  10. Date: Wed, 23 Dec 1992 15:21:31 GMT
  11. Lines: 42
  12.  
  13.  
  14. Unfortunately, Motif has no way to break the translations. You 
  15. have to drop down to the Xt level.  Using translations you can
  16. remap keys to specific action routines.  It would look 
  17. something like this (this could go in your .Xdefaults file:
  18.  
  19. myApp*textfield.translations: #override \n\
  20.         <Key>Return: process-tab()
  21.  
  22. You just want to tell  your application that when Return gets
  23. pressed in this field, you want to do a tab instead of 
  24. process-return() (which normally gets called).  If your text
  25. widget is in a Bulletin Board, you MIGHT have to set
  26. XmNautoUnmanage to False, but Im not sure, because I always
  27. set it to False.
  28.  
  29. As for your other problem, I too have had great difficulty 
  30. making sure that the keybindings in Motif always did what
  31. they were supposed to do.  I have had my keybindings stop 
  32. working in the middle of running the program!  They just
  33. all stopped working!  Wierd stuff.  I have had the most 
  34. luck just setting all the translations explicitly by hand.
  35. I would advise getting the Motif Programmer's Reference
  36. book, because it gives all the default action routines 
  37. that get called for all the keys (del, backspace, pgup, etc).
  38. Just setting them explicitly has worked better than relying
  39. on Motif to set them for me.  (although this only works 1/2 of
  40. the time!)  Welcome to the wonderful world of Motif KeyBindings!
  41. Good luck!
  42.  
  43. Happy Holidays!
  44.  
  45.                     peace out.
  46.  
  47.  
  48.                         kurt
  49.  
  50. -- 
  51. Kurt Overberg            | Opinions expressed here are MINE!           
  52. U of Mass, Lowell        | "Poke a double-decker on a Llama taboot,       
  53. koverber@cs.ulowell.edu  |  Llama taboot, taboot!"      -Phish
  54.  
  55.