Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!swrinde!ucsd!ucbvax!is.Morgan.COM!jerryl From: jerryl@is.Morgan.COM (Jerry Liebelson) Newsgroups: comp.windows.x.motif Subject: Problems with adding XmText translations Message-ID: <9105151342.AA10669@10669> Date: 15 May 91 13:42:15 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 107 Hi -- Below is a simple program that has an ApplicationShell containing a BulletinBoard widget which contains a single ScrolledText. I'm trying to add additional, somewhat emacs-like, keyboard translations to the XmText widget. I'm using the following resources: basic*text.editMode: MULTI_LINE_EDIT basic*text.wordWrap: true basic*text.columns: 40 basic*text.rows: 5 basic*text.maxLength: 3000 basic*text.scrollBarDisplayPolicy: AS_NEEDED basic*text.scrollHorizontal: false basic*text.autoShowCursorPosition: true basic*text.translations: #override \ Ctrla: beginning-of-line() \n\ Ctrle: end-of-line() \n\ Ctrlf: forward-character() \n\ Ctrlb: backward-character() \n\ Ctrlv: next-page() move-destination() \n\ Alt Metaf: forward-word() \n\ Alt Metab: backward-word() \n\ Ctrld: delete-next-character() \n\ Alt Metad: delete-next-word() \n\ Ctrlk: kill-to-end-of-line() \n\ Alt Metak: kill-to-start-of-line() \n\ Ctrln: next-line() \n\ Ctrlp: previous-line() \n\ Ctrll: redraw-display() \n\ Ctrlw: cut-clipboard() \n\ Alt Metaw: copy-clipboard() \n\ Ctrlu: unkill() \n\ Ctrly: paste-clipboard() \n\ R9: previous-page() move-destination() \n\ R15: next-page() move-destination() \n\ Alt Metav: previous-page() move-destination() \n\ ShiftR9: beginning-of-file() \n\ ShiftR15: end-of-file() PROBLEM: It seems only the first translation (Ctrl-a or whatever one specifiesfirst) takes affect. The others are ignored. Does anybody see what I'm doing wrong? Thanks. ENVIRONMENT: Motif 1.1 X11R4/18 SunOS 4.11 Sparc2, IPC, SLC. -- |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| | Jerry Liebelson | EMAIL: jerryl@is.morgan.com | | Information Systems | uunet!is.morgan.com!jerryl | | Morgan Stanley, Inc. | VOICE: (212) 703-2409 | | 1633 Broadway 36th Floor | FAX: (212) 703-2371 | | New York, NY 10019 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------- cut here ------------------------------------- #include #include #include #include #include #include Widget AppShell; /***************************************************************************/ int main(argc, argv) int argc; char **argv; { Widget board, text; Arg argList[10]; int i; XtAppContext appContext; Display *displayPtr; char appClass[64]; strcpy(appClass,argv[0]); if (islower(appClass[0])) appClass[0] = toupper(appClass[0]); else if (islower(appClass[1])) appClass[1] = toupper(appClass[1]); AppShell = XtAppInitialize ( &appContext, appClass, NULL, 0, &argc, argv, NULL, NULL, 0 ); board = XtCreateManagedWidget("board", xmBulletinBoardWidgetClass, AppShell, NULL, 0); text = XmCreateScrolledText(board, "text", NULL, 0); XtManageChild(text); XtRealizeWidget(AppShell); XtAppMainLoop(appContext); exit(-1); } ------------------------------- cut here -------------------------------------