Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Motif 1.2 porting to Open Motif 2.x

11 views
Skip to first unread message

Chris Beute

unread,
Sep 14, 2009, 8:08:23 PM9/14/09
to
Apologies if this has come up before.

We're porting some 15 year old code which ran on DEC UNIX
(Motif 1.2 code base) to Red Hat Linux V5.3. Current version
of Open Motif looks like 2.x.

In one of the applications, we depend upon getting a selection
event from an XmToggleButton widget, and we check the event to
see what keys were pressed along with the left mouse button
(Button 1). We do one behavior with just a normal selection,
another if the Shift Key has been pressed while pressing the
button, or another action if the Control Key has been pressed.

In going to Motif 2.x, we cannot get a selection event from
the CTRL+ MB1 actions - in fact, the selection won't take
place. Some google searching shows that Motif 2.0 changed
the behavior of CTRL + MB1 to just change the focus, and not
do a selection, in order to be more compatible with Windows
behavior.

So the question for the community is, can I restore the 1.2
behavior for CTRL+MB1 by altering some other setting on
the system?

Thanks,
Chris

Bill

unread,
Sep 15, 2009, 6:45:40 AM9/15/09
to
Perhaps:

static char ToggleTrans2[] =
"c<Btn1Down>: ArmAndActivate()\n";
static XtTranslations toggleTable2 = NULL;

static void override_toggle_translation(Widget w)
{
if (!toggleTable2) toggleTable2 = XtParseTranslationTable
(ToggleTrans2);
XtOverrideTranslations(w, toggleTable2);
}


then when you make a new toggle button:

w = XtCreateManagedWidget(name, xmToggleButtonWidgetClass, parent,
args, n);
override_toggle_translation(w);


(this is extracted from some code -- hopefully I got the relevant
portions).

Chris Beute

unread,
Sep 15, 2009, 7:18:43 PM9/15/09
to
Many thanks, Bill, that worked like a champ.

Regards,
Chris

0 new messages