delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/02/01:22:21

From: "Chris La Mantia" <lamantia AT gte DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro GUI Problem
Date: 29 Jul 1997 21:04:55 GMT
Organization: gte.net
Lines: 36
Message-ID: <5rlltn$ots$1@gte1.gte.net>
References: <3 DOT 0 DOT 32 DOT 19970729144506 DOT 00693058 AT m1 DOT 261 DOT telia DOT com>
NNTP-Posting-Host: 1cust110.tnt1.columbia.mo.da.uu.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Daniel Mattsson <daniel DOT mattsson AT gavle DOT mail DOT telia DOT com> wrote in article
<3 DOT 0 DOT 32 DOT 19970729144506 DOT 00693058 AT m1 DOT 261 DOT telia DOT com>...
> 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

Here's the problem: according to your code, you want the pushed button
bitmap to appear when the object's D_SELECTED flag is set.  To get the
result you want, you would have to clear the D_SELECTED flag after the
mouse button is released, meaning you would have to write your own handler
for MSG_CLICK.

However, there is a more fundamental problem here: if you _do_ de-select
the button after clicking it, what effect is it going to have?  What is
this button meant to do?

Perhaps a better solution is to set the D_EXIT flag on the object, causing
the dialog to exit when the button is pushed.  Then, process the button and
re-enter the dialog.  When the dialog reappears, the button will be
deselected again, and you will get the effect you are looking for. 

--Chris

---------------------------------------------------------------------------
Chris La Mantia / lamantia AT gte DOT net
Current Project: Infinite Worlds, an RPG with a dynamic world
http://home1.gte.net/lamantia/infinite
NO UNSOLICITED COMMERCIAL E-MAIL ACCEPTED

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019