Mail Archives: djgpp/1997/05/10/14:21:41
Gary Cowell (QI'HoS) writes:
>What I want to be able to do is have a button that does not 'stick', I
>just want the button to be 'filled' when the mouse button is down, but
>'cleared' when it is released again.
I'm not 100% clear what you mean by that, but is this something like
what you want? Or have I totally misunderstood your question? (it's not
clear to me whether you are talking about a GUI button object, or
actually reading the mouse button state from your code).
int d_nostick_button_proc(int msg, DIALOG *d, int c)
{
if (msg == MSG_CLICK) {
d->flags ^= D_SELECTED;
show_mouse(NULL);
SEND_MESSAGE(d, MSG_DRAW, 0);
show_mouse(screen);
do {
} while (mouse_b);
if ((d->flags & D_SELECTED) && (d->flags & D_EXIT)) {
d->flags ^= D_SELECTED;
return D_CLOSE;
}
return D_O_K;
}
return d_button_proc(msg, d, c);
}
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.
- Raw text -