From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Newbie question on Allegro Buttons Date: Sat, 10 May 1997 11:07:24 +0100 Organization: None Distribution: world Message-ID: <7antRSAcjEdzEw78@talula.demon.co.uk> References: <3371e478 DOT 8368557 AT news DOT demon DOT co DOT uk> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 37 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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.