[comp.windows.x.motif] Tanslation tables problem.

ephrem@oakhill.UUCP (Ephrem Chemaly) (12/05/90)

This might be a repost, please excuse the waisted bandwidth if it realy is a repost.

---------------------------------------------------------------------------------

I am having problems with the translation tables.  I am running X11R4 and Motif
1.0 from MIT on a Sun 3/260, and X11R3 from Apple, and Motif 1.0 from Integrated
Computer Solutions on an MacIntosh with A/UX.  The probelm is on both machines.

The problem:  For a widget of the xmPushButtonWidgetClass I am trying to add the
XmNhelpCallback to display some help for this push button.

In my C code I write:
	{
	...
	n = 0;
	HelpCallback[0].callback = HelpProc;
	HelpCallback[0].closure = (caddr_t)"Help string.";
	XtSetArg(args[n], XmNhelpCallback, HelpCallback); n++;
	XtCreateManagedWidget("Name", xmPushButtonWidgetClass, parent, args, n);
	...
	}

In the x resource data base file I write:
...
*Name.translations: #augment\n\
	<Btn3Down>:     Help()\n\
	<Key>F1:        Help()
...

Now if I push the 3rd mouse button, or the F1 key I get the help function.  But I
can not push button 1 and call the XmNactivateCallback function.  #augment is
acting like #replace.  I have also tried, #replace, and #override, they all act
like #replace.

Has anybody seen that problem, or am I doing something wrong.

Please use the address below to reply by e-mail.

Thanks in advance,

Ephrem A. Chemaly

+=========================================================================+
| Motorola Inc.                            Ephrem A. Chemaly              |
|                                          6501 William Cannon Drive West |
|                                          Austin, Texas 78735 U.S.A.     |
|                                          Mail Drop: OE-21               |
|                                          (512) 891-2760                 |
|                                                                         |
| Internal Addr: ephrem@soleil-tx (or at) oakhill!soleil-tx!ephrem        |
| Internet Addr: ...!soleil-tx.sps.mot.com!ephrem                         |
| UUCP Address:  oakhill!soleil-tx!ephrem@cs.utexas.edu                   |
+=========================================================================+

aw@cellar.uucp (Andrew Wason) (12/07/90)

In article <4296@soleil-tx.oakhill.UUCP> ephrem@oakhill.UUCP (Ephrem Chemaly) writes:
>	{
>	...
>	n = 0;
>	HelpCallback[0].callback = HelpProc;
>	HelpCallback[0].closure = (caddr_t)"Help string.";
>	XtSetArg(args[n], XmNhelpCallback, HelpCallback); n++;
>	XtCreateManagedWidget("Name", xmPushButtonWidgetClass, parent, args, n);
>	...
>	}

Make sure your HelpCallback array is NULL terminated.


>                          [...]                                   #augment is
>acting like #replace.  I have also tried, #replace, and #override, they all act
>like #replace.

This is a bug in Motif 1.0.  I don't know if it is fixed in 1.1.
--------------------------------------------------------------------------------
Andrew Wason                                        Bell Communications Research
aw@cellar.bae.bellcore.com                          Piscataway, NJ
bellcore!cellar!aw

lalli@casee.enet.dec.com (12/07/90)

|>
|>>                          [...]                                   #augment
is
|>>acting like #replace.  I have also tried, #replace, and #override, they all
act
|>>like #replace.
|>
|>This is a bug in Motif 1.0.  I don't know if it is fixed in 1.1.
|>-----------------------------------------------------------------
|>Andrew Wason                                        Bell Communications
Research
|>aw@cellar.bae.bellcore.com                          Piscataway, NJ
|>bellcore!cellar!aw
|>

I experienced the same problem augmenting a PushButton translation table, 
using both Motif 1.0 and Motif 1.1. So I don't think it's been fixed yet.

---
Didier Lalli				lalli@casee.enet.dec.com
Digital Equipment,
Centre Technique Europe S.A.R.L		DTN 828-5423
B.P. 129 - Sophia Antipolis 			Tel. +33 92 95 54 23
06561 Valbonne Cedex - France		Fax  +33 93 65 41 58

marbru@attc.UUCP (Martin Brunecky) (12/10/90)

In article <1990Dec7.151845@casee.enet.dec.com> lalli@casee.enet.dec.com () writes:
>is
>|>>acting like #replace.  I have also tried, #replace, and #override, they all
>act
>|>>like #replace.
>|>
>|>This is a bug in Motif 1.0.  I don't know if it is fixed in 1.1.
>|>
>
>I experienced the same problem augmenting a PushButton translation table, 
>using both Motif 1.0 and Motif 1.1. So I don't think it's been fixed yet.
>
   I'd call it a "feature".
   Motif has rather "inovative" approach to translation tables. By default,
   the table is NULL.
   If there is nothing specified (either in resource file, or in args), the
   widget's Initialize finds: Oh, there is NULL in translations, lets use
   our default ones.
   If, however, the translatins have become non-NULL, the default translations
   are NOT used at all. Thus, using #augment, #override or a new table has
   identical effect: defines the new translations. The only way you can
   (I *think*) augment/override Motif's default translations is AFTER
   Initialize, using SetValues.
   Note, however, that Motif managers do play with translation tables as
   well ... so that results are not always easy to predict.


-- 
=*= Opinions presented here are solely of my own and not those of Auto-trol =*=
Martin Brunecky                           {...}sunpeaks!auto-trol!marbru
(303) 252-2499                        (sometimes also:  marbru@auto-trol.COM )
Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404