Submitted by Anonymous on Fri, 02/15/2002 - 09:26. Developers
Can somebody comment the below code in Disarm function of ToggleB.c?
/* BEGIN OSF Fix pir 2826 */
/* CR 7803 Suppress redundant redraws. */
if (tb->toggle.set != tb->toggle.visual_set)
Redisplay((Widget) tb, event, (Region) NULL);
/* END OSF Fix pir 2826 */
This causes the following problem
I have a Toggle button with picture label inside radio box. I click on the toggle which is set.
The visual is set to XmUNSET in Arm, but is NOT reset back to XmSET in disarm, and the
toggle is displayed as unset while its status (toggle.set) is still XmSET.
Can I work around this?
Hi all,
It still looks as a bug to me. The two flags are not the same, calling Redisplay, that uses visual_set. That means that the two flags will continue to differ, and the visual state will not the same as the button`s value.
Meanwhile, I`ve found a workaround. I define the disarm callback for the button
void cb_toggleb_disarm(Widget w, XtPointer ClientData, XtPointer cdata)
{
XmToggleButtonCallbackStruct *tbs = (XmToggleButtonCallbackStruct *)cdata;
XmToggleButtonSetState(w, !tbs->set, FALSE);
XmToggleButtonSetState(w, tbs->set, FALSE);
}
XmToggleButtonSetState is called twice to force setting the state and the visual state.
I wonder that nobody has run to this problem, I`ve got it immediately after compiled my code for Motif 2.1 (it was OK in 1.2).