Top Document: Motif FAQ (Part 4 of 9) Previous Document: 86) How do XmTextField and a single line XmText widget differ? Next Document: 88) Can you reuse the return value from XtParseTranslationTable? See reader questions & answers on this topic! - Help others by sharing your knowledge happens using Motif 1.0 when I have a text widget inside a bulletin board (or form) inside a dialog shell. (In Motif 1.1 it is fixed for both text and list widgets.) Answer: In single line mode, pressing the <return> key usually invokes the activate() action, and in multi-line mode, the newline() action. However, whenever a widget is the child of a bulletin board widget which is the child of a dialog shell, the bulletin board forces all of its children to translate <return> to the bulletin board action Return() which is usually associated with the default button of the dialog. To restore the text actions of activate() or newline(), you need to overide the Return() action of the bulletin board. /* declarations */ /* for a single line widget */ char newTrans[] = "<Key>Return : activate()"; /* for a multi line widget */ char newTrans[] = "<Key>Return : newline()"; XtTranslations transTable; /* in executable section */ transTable = XtParseTranslationTable(newTrans); /* after creating but before managing text widget */ XtOverrideTranslations(textWidget, transTable); User Contributions:Top Document: Motif FAQ (Part 4 of 9) Previous Document: 86) How do XmTextField and a single line XmText widget differ? Next Document: 88) Can you reuse the return value from XtParseTranslationTable? Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page [ Usenet FAQs | Web FAQs | Documents | RFC Index ] Send corrections/additions to the FAQ Maintainer: kenton@rahul.net (Ken Lee)
Last Update March 27 2014 @ 02:11 PM
|
Comment about this article, ask questions, or add new information about this topic: