[Oberon] WMStandardComponents.Button

Dan Parnete dan.parnete at fastwebnet.it
Sun Oct 30 16:31:49 CET 2005


Dan Parnete wrote:

> Hello,
>
> I'm using a button in toggle mode, so it could be pressed or not. To 
> find out the state of the button I make some tricks. The simplest way 
> should be to have access to the "pressed" variable.
> Could you please put it readable?
>
Having access to the state of the button it's not enough, because the 
button in toggle mode calls Click only when goes in pressed state, but 
not in released state. That limits the double state functionality. If 
there is no other way to mark the release button, I propose "pressed" 
flag readable and Click called on both states:

        PROCEDURE Down;
        BEGIN
            IF ~isToggle.Get() THEN IF ~pressed THEN pressed := TRUE; 
Invalidate; CheckRepeating(TRUE) END;
            ELSE pressed := ~pressed; Click(SELF, userData); Invalidate
            END;   
        END Down;

Thanks,
Dan Parnete


More information about the Oberon mailing list