BadGC with Find dialog
Glynn Clements
glynn.clements at virgin.net
Thu Apr 22 19:41:33 EDT 2004
Jerry James wrote:
> It looks to me like the culprit is this line in RadioExpose (line
> 312 of lwlib/xlwradio.c in current CVS):
>
> /* Command widget may sometimes override the label GC in order
> * to draw inverse video. We don't use inverse video, so we need
> * to restore the label's normal GC.
> */
> rw->label.normal_GC = rw->command.normal_GC ;
I concur.
The code for the Command widget does this as well. But Command belongs
to the same code base as Label, so it can rely upon specific behaviour
from Label.
The same can't be said for xlwradio.c, and I'm fairly sure that the
Athena documentation doesn't specify the behaviour to this level of
detail (and even if it did, I wouldn't rely upon the XFree86 folks to
follow it).
> However, the diamond associated with the selected radio button was not
> visible either before or after making this change. I expected it to be
> drawn filled in. I'm guessing that there is something wrong with one of
> these two lines in DrawDiamond (line 555 of the same file):
>
> gc = XtIsSensitive(w) ? rw->command.normal_GC : rw->label.gray_GC ;
>
> gci = rw->command.set ? rw->command.normal_GC : rw->command.inverse_GC ;
>
> where gc is used to draw the diamond outline, and gci is used to draw
> the inside of the diamond. It looks like gci is always set to
> rw->command.normal_GC regardless of whether the radio button is selected
> or not. Where is the code that should change rw->command.set?
> Apparently it is not doing its job.
The default translations for the Toggle widget (which is xlwradio's
superclass) include:
<Btn1Down>,<Btn1Up>: toggle() notify()";
The "toggle" action is bound to Toggle(), which does:
if (tw->command.set)
class->toggle_class.Unset(w, event, NULL, 0);
else
ToggleSet(w, event, params, num_params);
and ToggleSet() does:
TurnOffRadioSiblings(w);
class->toggle_class.Set(w, event, NULL, 0);
The Set and Unset methods are initialised to the "set" and "unset"
action procedures for the Command class.
I suggest checking whether the command.set field is actually being set
correctly. If it is, the problem is in the redraw code. If it isn't,
the problem is in the event handling.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the XEmacs-Beta
mailing list