button stay pressed

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
vedus
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 153
Joined: Tue Feb 26, 2013 9:23 am

button stay pressed

Post by vedus » Tue Aug 27, 2013 10:18 am

I know somewhere is a answer about this question but i am looking in the forum without result :(
is any trick that >when button is pressed in ipad app to stay pressed?so the user know what is up that moment?
for clarification if the above trick exist can be work with custom made buttons?(i use button changed texture and hilite texture).
thank you.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10367
Joined: Wed May 06, 2009 2:28 pm

Re: button stay pressed

Post by dunbarx » Tue Aug 27, 2013 1:48 pm

Not sure what you mean by "stay pressed".

Do you want, say,the hilite of the button to change after the user clicks on it? This is simple. With a custom button, perhaps one that uses an image, you can do something similar, or change the image itself.

Write back if this is not what you had in mind.

Craig Newman

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: button stay pressed

Post by magice » Tue Aug 27, 2013 3:14 pm

It sounds like you are trying to create a toggle effect on your button, where you turn something on and the button stays hilited. You can then turn it off and the button hilite returns to false. I use this a lot. uncheck auto hilite in your button properties. then put this code in the button.

Code: Select all

on mouseUp
  if the hilite of me is true 
   then 
      set the hilite of me to false
   else
      set the hilite of me to true
   end if
end mouseUp
This effect works well with square buttons, but not with push buttons as their hilite state is less obvious.

vedus
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 153
Joined: Tue Feb 26, 2013 9:23 am

Re: button stay pressed

Post by vedus » Tue Aug 27, 2013 5:31 pm

thank you for the response guys.
Yes i want the button to stay hilited until the user press other buttons.
So if i figure out with custom graphics, is best to set the hilite in the custom hilited image?

Post Reply