Hi all,
I made a button out of custom icons, basically a simple white square, and as down-state a grey square. On top of that button I have place 2 labels. One big one that covers 2 thirds of the button, one small one underneath that. I then grouped these 3 objects. When I test it however, the button only responds to my mouse when the mouse is over a part of the button that has no text on top of it.
So my problem is, the whole group should act as the button. I cannot seem to find how to prevent LiveCode from giving focus to the labels. I could of course just make different images in photoshop, but later on I will have to make an onscreen keyboard too, which should change the available characters according to the selected language, so I would really like to be able to create my buttons like this...
Any help is, as always, greatly appreciated!
Johan
text over button prevents button from working |SOLVED|
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
text over button prevents button from working |SOLVED|
Last edited by Johan_VH on Fri Jul 04, 2014 4:32 pm, edited 1 time in total.
Re: text over button prevents button from working
-edit your group
-"send back" your label (via properties size&position)
-set your button/icon to not opaque
-"send back" your label (via properties size&position)
-set your button/icon to not opaque
Re: text over button prevents button from working
Hallo Johan,
So instead of setting the HILITE icon of the one button you do all thsi stuff by script, something like this in the group script:
You get the picture
Best
Klaus
yep, that is intended behavior.Johan_VH wrote:...When I test it however, the button only responds to my mouse when the mouse is over a part of the button that has no text on top of it.
Is this a BUTTON object you are using for this and you set its HILITE-ICON?Johan_VH wrote:I made a button out of custom icons, basically a simple white square, and as down-state a grey square.
The trick for "custom controls" (which are groups in fact) is to script the GROUP to do what you want.Johan_VH wrote:So my problem is, the whole group should act as the button.
So instead of setting the HILITE icon of the one button you do all thsi stuff by script, something like this in the group script:
Code: Select all
on mousedown
set the icon of btn "your button name here" of me to 1006
## Replace 1006 with the ID of the image YOU are using!
## Same for MOUSEUP below
end mousedown
on mouseup
set the icon of btn "your button name here" of me to 1005
## See above :-)
## Do your stuff here...
end mouseup
on mouserelease
set the icon of btn "your button name here" of me to 1005
end mouserelease

Best
Klaus
Re: text over button prevents button from working
Hi,
I just wanted to come here to say I figured it out myself by changing the icon from a script, but you beat me to it.
thanks!
Johan
I just wanted to come here to say I figured it out myself by changing the icon from a script, but you beat me to it.

thanks!
Johan