I want to have a button that has two states like a checkbox.
But I want the icon to change to make it obvious that it is selected.
I tried to use the code below but it didn't work.
on mouseUp
if variable = 0 then
put "4" into variable
set the armed of me to "true"
else
put "0" into variable
set the armed of me to "false"
end if
end mouseUp
Making a button like a checkbox with icons for on and off.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Making a button like a checkbox with icons for on and of
Hi kunoir,
You can
set the icon of me to image ID 1025 --use an image id for the 2 different states
or
set the highlight of me to false --This uses the buttons icon you've set up.
Simon
You can
set the icon of me to image ID 1025 --use an image id for the 2 different states
or
set the highlight of me to false --This uses the buttons icon you've set up.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Making a button like a checkbox with icons for on and of
Hi.
Or just go to the inspector and in the icon pane, select one for hilite and one for "normal" (icon). Note that most buttons do not toggle their hilites, rather only changing while the mouse is held down, though checkboxes and radioButtons do. But you can always do this with any button style by:
set the hilite of me to not the hllite of me
Craig Newman
Or just go to the inspector and in the icon pane, select one for hilite and one for "normal" (icon). Note that most buttons do not toggle their hilites, rather only changing while the mouse is held down, though checkboxes and radioButtons do. But you can always do this with any button style by:
set the hilite of me to not the hllite of me
Craig Newman
Re: Making a button like a checkbox with icons for on and of
Hi kunoir,
I just found your post searching for similar solution and worked out a way to toggle text fields and buttons just like checkboxes (you have to use a checkbox for this).
See the attached stack.
keram
I just found your post searching for similar solution and worked out a way to toggle text fields and buttons just like checkboxes (you have to use a checkbox for this).
See the attached stack.
keram
- Attachments
-
- toggle hilite of the text field.zip
- (718 Bytes) Downloaded 206 times
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit