GLBasic forum

Main forum => FAQ => Topic started by: ggindlesperger on 2010-Jul-07

Title: How to handle a button for iPhone.
Post by: ggindlesperger on 2010-Jul-07
I am stuck on something that is probably easy,but I can not figure it out. I want to make a simple button. The button should call a routine when touched. My problem is that once it is touched it continues to keep calling the routine until you touch somewhere else outsidre the button. I've tried setmouse to set the mouse outside the area once the routine is called, but that does not seem to do it on the iPhone. Setmouse works as I expected when I compile and run in GLBasic, but when I compile for iPhone and and test it just continues going to the routine until you touch somewhere else on the screen.

Any thought or idea on what I am missing?

Thanks so much for any help.

I am using the Premium SDK if that matters.
Title: Re: How to handle a button for iPhone.
Post by: trucidare on 2010-Jul-07
Code (glbasic) Select

WHILE TRUE
   MOUSESTATE mx,my,b1,b2
   IF b1 = 0 THEN pressed = 0

   IF b1 AND pressed = 0
      Call_yout_function()
      pressed = 1
   ENDIF
   SHOWSCREEN
WEND

Title: Re: How to handle a button for iPhone.
Post by: ggindlesperger on 2010-Jul-07
Thanks very much. I will try that out when I get home.