Clicking A Button With An Icon

Jim Ault JimAultWins at yahoo.com
Thu Nov 16 02:39:14 EST 2006


On 11/15/06 9:49 PM, "Bridger Maxwell" <bridgeyman at gmail.com> wrote:

> Hey,
>   I noticed that the mouseUp message is not sent to an image when the user
> clicks on a part of the image that is transparent.  However, when the user
> clicks on a transparent-type button with its icon set to the same image, the
> mousUp message is sent regardless of the transparency of the pixel.  Is
> there any way to apply that behavior of the image to the button?  Right now
> I have a set of icons that are all 32 x 32, but if the actual colored
> portion of the icon is smaller (which it often is), I don't want the button
> the receive the mouseUp message.  Is there a way to do this?  Another
> possible solution would be to resize the buttons according to the size of
> the painted portion of the icon, but I don't know if that is possible
> either.

 A button is an object that is always a rectangle,
put the rect of btn startSomething into msg

 so if you are trying to get an irregular transparent 'hit' area, an icon
won't work.  Actually, human interface guidelines say it is unfair to give a
human 'holes' that mean a mouse click does not register., even though they
click inside the rectangular area.

There used to be some programs that put icons on the desktop that did the
same thing.  Very annoying to double-click to launch, but nuttin' happened.
Also, drag and drop a file on the icon and you could put the dragged-file
icon behind the larger app icon, thus more messing around, since now you
have relocated your file on the desktop behind another icon.

Why not just use the icon as an image? and give it a mouse up handler

Jim Ault
Las Vegas





More information about the use-livecode mailing list