[comp.windows.x] carriage_return binding

belk@pyr.gatech.EDU (Eddie) (03/03/90)

Few days ago, someone mentioned carriage_return binding to an OK button
in the dialog box. Could this person or anybody out there drop an example
on how a carriage_return can be binded to a button.

__Thanks__

belk@sybil.gatech.edu

-- 
ED N. BELKEIR
Georgia Insitute of Technology, Atlanta Georgia, 30332
...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!belk

klee@wsl.dec.com (Ken Lee) (03/06/90)

In article <9918@pyr.gatech.EDU>, belk@pyr.gatech.EDU (Eddie) writes:
> Few days ago, someone mentioned carriage_return binding to an OK button
> in the dialog box. Could this person or anybody out there drop an example
> on how a carriage_return can be binded to a button.

If you want to catch a carriage return while focus is on the button,
use a translation to the button's action.  If you want to catch the
carriage return while focus is elsewhere, use an accelerator.  Both
are documented in Chapter 10 of the MIT Xt manual.

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (03/06/90)

> Few days ago, someone mentioned carriage_return binding to an OK button
> in the dialog box. Could this person or anybody out there drop an example
> on how a carriage_return can be binded to a button.

One example of how to do this is in "examples/Xaw/popup.c" on the R4 core
distribution.

						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213