Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: novice question - flashing Athena Widgets? Message-ID: <8911131620.AA18354@expo.lcs.mit.edu> Date: 13 Nov 89 16:20:53 GMT References: <3160@qiclab.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 66 > What is the preferred method for changing the set() and unset() actions > for a commandWidget? I would like to prevent the default selection flash > when the pointer button is pressed and released. Try adding this to your resource database: *Command.translations: #replace \n\ : highlight() \n\ : reset() \n\ : InvertButton() \n\ : InvertButton() notify() This will remove the invert semantics from the Command widget. And call the application defined action InvertButton. This action can invert the other button on button down, and flip it back on button up. *** Don't forget to register this action with XtAppAddActions. *** Here is one possible implementation of InvertButton, I just threw this together so if it doesn't build... /* ARGUSED */ void InvertButton(w, event, params, num_params) Widget w; /* We don't use any of these arguements. */ XEvent * event; String * params; Cardinal * num_params; { Widget command; Arg args[2]; Cardinal num_args; Pixel fg, bg; /* Somehow get the command widget to highlight. */ /* * Get the foreground and background colors. */ num_args = 0; XtSetArg(args[num_args], XtNforeground, &fg); num_args++ XtSetArg(args[num_args], XtNbackground, &bg); num_args++ XtGetValues(command, args, num_args); /* * Swap them. */ num_args = 0; XtSetArg(args[num_args], XtNforeground, bg); num_args++ XtSetArg(args[num_args], XtNbackground, fg); num_args++ XtSetValues(command, args, num_args); } I hope this is enough to get you moving again. Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213