Message-Id: <3.0.32.19970729144506.00693058@m1.261.telia.com> Date: Tue, 29 Jul 1997 14:45:12 +0200 To: djgpp AT delorie DOT com From: Daniel Mattsson Subject: Allegro GUI Problem Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Precedence: bulk I have started playing with the GUI routines and I'm trying to write my own button_proc, but it doesn't work as i want. Here is the custom proc: int my_button_proc(int msg, DIALOG *d, int c) { if (msg==MSG_DRAW) { button = (BITMAP *)gui_data[normal_button].dat; blit(button, screen, 0, 0, d->x, d->y, button->w, button->h); if ((d->flags & D_SELECTED) && (d->flags & D_GOTFOCUS) && (d->flags & D_GOTMOUSE)) { button = (BITMAP *)gui_data[pushed_button].dat; blit(button, screen, 0, 0, d->x, d->y, button->w, button->h); } return D_O_K; } return d_button_proc(msg, d, c); } When i run this the button behaves kinda like a checkbox, when the mouse is clicked over it it changes to the pushed_button bitmap. How do i make work like a normal button, so that the pushed_button bmp is displayed when the button is clicked and then when the button is released it will be overwritten with the normal_button bmp? /Daniel Mattsson PS. Thanks to DJ Delorie and Shawn for an outstanding programming enviroment.