[comp.windows.x] Dialog Translations

watermaa@cs.Colorado.EDU (Alexander S. Waterman) (04/30/91)

Guys,
	Hello, I have a question concerning binding actions to widgets.
I have an action I want to bind to a dialog widget, I have the translation
declared as:

(A) static String trans =
        "<Key>Return: testcall()\n";

   and the action declared as:

    XtActionsRec actionTable[] = {
        {"test", test},
    };


    After my calls to ( par_tr_tab = XtParseTranslationTable(trans)) and
    XtOverrideTranslations(mydialogbox, par_tr_tab), I add the action
    with XtAddACtions(actionTable, XtNumber(actionTable));

    and this DOESN'T work.
 
   I don't have a problem if instead of declaring as in (A) I 
set the callback as a fallback resource with the line:

        "*Dialog*translations: #override \\n <Key>Return: testcall()",

  BUT I don't want to bind this function to ALL instances of the
dialog widget.  I just want the binding to specific widgets.  Does
anyone have a solution?  I would appreciate any help!!  Thanks in
advance.



  - Alexander S. Waterman
    watermaa@cs.colorado.edu

converse@expo.lcs.mit.EDU (Donna Converse) (04/30/91)

> Guys,

???

> I have an action I want to bind to a dialog widget, I have the translation
> declared as:
> 
> (A) static String trans =
>         "<Key>Return: testcall()\n";
> 
>    and the action declared as:
> 
>     XtActionsRec actionTable[] = {
>         {"test", test},
>     };

Should be {"testcall", test},
Think about it.

> 
>     After my calls to ( par_tr_tab = XtParseTranslationTable(trans)) and
>     XtOverrideTranslations(mydialogbox, par_tr_tab), I add the action
>     with XtAddACtions(actionTable, XtNumber(actionTable));

Add the actions to the application context (XtAddActions or XtAppAddActions)
before you install the translations (XtOverrideTranslations).