[comp.windows.x] Command Widget Question

mcintyre@turing.cs.rpi.edu (David McIntyre) (03/07/89)

I have a question about the command widget:

I want to disable/enable buttons.  By disabling I mean setting the
foreground to grey, and removing the ability to call the callback
functions.  I do this by:

	String newTranslations = "";

	trans = XtParseTranslationTable(newTranslations);

	XtSetArg(arg[0],XtNforeground,grey);
	XtSetArg(arg[1],XtNlabel,text);
	XtSetValues(widget,arg,2);
	XtOverrideTranslations(widget,trans);

This works nicely.  The label business is used to force a redraw
of the widget.  However, when I try to re-enable the widget by:

	String newTranslations = 
                "<Btn1Down>:        set() \n\
                 <Btn1Up>:          notify() unset() \n\
                 <EnterWindow>:     highlight() \n\
                 <LeaveWindow>:     unset(NoRedisplay) unhighlight()";

	trans = XtParseTranslationTable(newTranslations);

        XtSetArg(arg[0],XtNforeground,black);
        XtSetArg(arg[1],XtNlabel,text);
        XtSetValues(widget,arg,2);
        XtOverrideTranslations(widget,trans);

something funny happens.  The color change works ok.  However, from
this point on the button is always highlighted!  That is, the border
of the command widget is thickened all the time, even when the
cursor is not in the button.

Can someone tell me what is going on?  Oh yes, this is using X11R2
on a Sun 3/60.

				Thanks,
				  Dave

Dave "mr question" McIntyre     |      "....say you're thinking about a plate
mcintyre@turing.cs.rpi.edu      |       of shrimp.....and someone says to 
office : 518-276-8633		|	you `plate,' or `shrimp'......"
home   : 518-271-6664		|