From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Q: Allegro GUI Date: Fri, 8 Aug 1997 19:21:05 +0100 Organization: None Distribution: world Message-ID: References: <33EAA397 DOT 6A97 AT bohm DOT anu DOT edu DOT au> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 31 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Alistair Phillips writes: >I was wondering if it was possible to use the GUI functions in Allegro >but instead of having the window drawn as it appears by default you >could set the buttons to display bitmaps I've already drawn and the >windows itself displayed as a bitmap I've already drawn. It is indeed possible. You need to write your own object procedure (a custom equivalent of d_button_proc, d_list_proc, or whatever you are using), which calls the Allegro version for most messages but handles the draw message itself. For example: int funkybutton_proc(int msg, DIALOG *d, int c) { if (msg == MSG_DRAW) { // do fancy graphics code in here. Look at d->x, d->y, d->w, and // d->h for the location of the object, d->fg and d->bg for the // color, etc. If (d->flags & D_SELECTED) is set, the object // should be displayed in it's selected form, and if (d->flags & // D_GOTFOCUS) is set, it should be drawn in whatever manner // indicates that it currently has the input focus. 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.