[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

835.0. "translation table doesn't callback" by 6240::FARMER () Wed May 24 1989 10:46

	For  the  following  key  translation  set  up when the command
	window is created, the callback routine exit_proc  doesn't  get
	called  when  ^Z  is  typed.   Is  there  something obvious I'm
	missing? 	thx/cliff

    if (widget_num == k_command_window) {
	XtActionsRec actions [] = {"exit_proc", (XtActionProc)exit_proc};

	XtAddActions (actions, XtNumber (actions));
	XtOverrideTranslations (w, 
			XtParseTranslationTable ("Ctrl<Key>Z:exit_proc()"));
        }


T.RTitleUserPersonal
Name
DateLines
835.1LEOVAX::TREGGIARIWed May 24 1989 21:325
    This is just a guess, since I don't have the documentation handy, but
    have you tried "Ctrl<Key>z"  (i.e. lower-case "z")?
    
    Leo

835.2Wild guess time30790::ROSEWed May 24 1989 21:354
    Another wild guess: Is w a window widget? Once upon a time they had a
    bug whereby, since they didn't have any translations to start with, you
    couldn't augment their translations. 

835.36240::FARMERThu May 25 1989 11:564
re .1	Ctrl<Key>Z is the same as Ctrl<Key>z

re .2	I'm using Override, not Augment

835.42520::TREGGIARIThu May 25 1989 13:0713
If "k_command_window" is a toolkit command window widget, then you are
going about this wrong.  It's not the command window's translations that
you want to affect, but one of its children.  Command window has a 
DwtNtTranslation resource to allow you to do this.			

You need to do something like:

XtParseTranslationTable ("#override\n Ctrl<Key>z:exit_proc()"));

and use the result as the value of the DwtNtTranslation resource.

Leo

835.5translation resource was the answer6240::FARMERThu May 25 1989 14:1616
	Wow!  the Translation resource did the trick.  thanks very much!

   XtSetArg (arglist[0], DwtNtTranslation,
             XtParseTranslationTable ("#override Ctrl<Key>z:exit_proc"));
   XtSetValues (w, Arglist, 1);

	Now I'm curious why this doesn't work from UIL?  but I'm glad at
	least the other way works.

    m_exit_button : push_button {
        arguments {
            accelerator_text = 'Ctrl/Z';
            button_accelerator = '#override Ctrl<KeyPress>z:';
            label_label = 'Exit';
            };

835.62520::TREGGIARIThu May 25 1989 16:219
>            button_accelerator = '#override Ctrl<KeyPress>z:';


Accelerators don't support the "#override" syntax.  Try taking that out.
You may already know this, but you also must call XtInstallAccelerators
or XtInstallAllAccelerators to get "button_accelerator"s to work.

Leo

835.7why XtInstallAccelerators?6240::FARMERThu May 25 1989 20:2532
	thanks, Leo.
	I'm learning slowly. could you answer a few more questions 
	about accelerators?

	If I define button accelerators in UIL, why do they have to be
	recompiled at runtime via XtInstallAccelerators?

	Also, why do I get the following errors?  This comes from defining
	button_accelerators in UIL and not calling XtInstallAccelerators.

X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: translation table syntax error: Unknown modifier name:  DWTGADGETACCELERATOR
X Toolkit Warning: translation table syntax error: Unknown modifier name:  DWTGADGETACCELERATOR
X Toolkit Warning: translation table syntax error: Unknown modifier name:  DWTGADGETACCELERATOR
X Toolkit Warning: translation table syntax error: Unknown modifier name:  DWTGADGETACCELERATOR
X Toolkit Warning: translation table syntax error: Unknown modifier name:  DWTGADGETACCELERATOR
X Toolkit Warning: translation table syntax error: Unknown modifier name:  DWTGADGETACCELERATOR
X Toolkit Warning: translation table syntax error: Unknown modifier name:  DWTGADGETACCELERATOR
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions
X Toolkit Warning: Overriding earlier translation manager actions

835.82520::TREGGIARIThu May 25 1989 21:189
    I'm afraid Mike Collins is the toolkit "accelerator" expert, not
    I.  You need to install the acclerator on the widget(s) which will
    have input focus while you want the accelerator to be active.
    
    I don't know why you would get those errors if you don't "install"
    the accelerator...
    
    Leo