StringRequest() keeps showing dialog box on amiga

Discuss any general programming issues here

StringRequest() keeps showing dialog box on amiga

Postby peceha » Fri Dec 30, 2016 6:21 pm

Hi
take a look at the following:
Code: Select all
Function ask(title,body,min,max)
   PauseTimer(20)
        /* I removed here nonesential parts and changed a little the rest - so just you can easy reproduce the problem*/
   a = Limit(Val((StringRequest(title,body,1,#NUMERICAL))),min,max)
   ResumeTimer(20)
EndFunction


StartTimer(20)
While quit = False
   If IsKeyDown("F1")   Then ask("","blabla1",3,20)
   If IsKeyDown("F2")   Then ask("","blabla2",3,20)
   If IsKeyDown("F3")   Then ask("","blabla3",1,20)
   WaitTimer(20,80)
Wend


On PC everything works like expected - whenewer I press F1/F2/F3 the requester shows up and when I write my numbers it goes away after pressing ENTER/ESC or OK/CANCEL.
On Amiga (wb3.1) the dialog box is comming back in fraction of second just after I dismiss it.
Am I doing something wrong?

Thank You.
peceha
 
Posts: 110
Joined: Tue Dec 13, 2016 9:39 am
Location: Poland

Re: StringRequest() keeps showing dialog box on amiga

Postby airsoftsoftwair » Tue Jan 03, 2017 10:49 pm

Try calling ResetKeyStates() after StringRequest(). Like this:

Code: Select all
Function ask(title,body,min,max)
   PauseTimer(20)
        /* I removed here nonesential parts and changed a little the rest - so just you can easy reproduce the problem*/
   a = Limit(Val((StringRequest(title,body,1,#NUMERICAL))),min,max)
   ResetKeyStates
   ResumeTimer(20)
EndFunction


Does it help?
User avatar
airsoftsoftwair
 
Posts: 2202
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: StringRequest() keeps showing dialog box on amiga

Postby peceha » Wed Jan 04, 2017 3:49 pm

So far so good - it is working now.
Thank you.
peceha
 
Posts: 110
Joined: Tue Dec 13, 2016 9:39 am
Location: Poland

Re: StringRequest() keeps showing dialog box on amiga

Postby airsoftsoftwair » Wed Jan 04, 2017 11:17 pm

Alright, so this was actually a bug in Hollywood. Fixed now.

Code: Select all
- Fix: StringRequest(), ListRequest(), ColorRequest(), and PathRequest() didn't reset the
  key states which could lead to keyboard events still being triggered after those requesters
  were closed
User avatar
airsoftsoftwair
 
Posts: 2202
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany


Return to General programming

Who is online

Users browsing this forum: No registered users and 3 guests