Mintoris

Author Topic: Problem with Back in a List  (Read 2466 times)

gianfry56

  • Full Member
  • ***
  • Posts: 15
Problem with Back in a List
« on: Apr 06, 2017, 07:26 AM »
Hello everyone, this is my first post in this forum :)

I have a problem I can not solve, and wonder if anyone has a solution:
I use onBack subroutine to intercept pressing the 'Back' button, and it works; In one case don't work: within a list generated with the 'List' command: in this case the 'Back' pressure is not intercepted by onSub, and the application closes without control.
Is there a solution?

Thanks in advance
(sorry me for my bad english :)

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Problem with Back in a List
« Reply #1 on: Apr 06, 2017, 11:12 AM »
Thanks for reporting this problem. I will release an update in the next few days with the fix

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Problem with Back in a List
« Reply #2 on: Apr 06, 2017, 11:13 AM »
I just released Basic Version 7.5.9. Once it becomes available and you get it, the back button interrupt will work with all the dialog boxes.

gianfry56

  • Full Member
  • ***
  • Posts: 15
Re: Problem with Back in a List
« Reply #3 on: Apr 06, 2017, 11:49 AM »
Wonderful, thank you!

gianfry56

  • Full Member
  • ***
  • Posts: 15
Re: Problem with Back in a List
« Reply #4 on: Apr 06, 2017, 01:29 PM »
I'm sorry, but perhaps there is still a problem ...
In this simple code by pressing 'Back' the onBack function is executed (show pop-up) and then regularly return control to the Do ... Loop cycle,
but if, with a tap, I open list and press 'Back' the program crashes (freezes) why?
I wish the control still return to the Do ... Loop cycle, but can not find a solution.   :-[

Code: [Select]
Dim menulist$(2) = "First", "Second", "Exit"

SetOnBackButtonSub onBack()

Do
Print FormatTime$(Time(), "hh:mm:ss")
TouchEvent action, idx, x, y, 1000
If action = 0 Then
List menulist$(), choose$
Print choose$
If choose$ = "Exit" Then Exit Do
Endif
Loop

Sub onBack()
Popup "onBack subroutine"
End Sub

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Problem with Back in a List
« Reply #5 on: Apr 06, 2017, 07:18 PM »
I need to think about this over night. I think the problem is that the list box is being hidden when you press back, then it never gets restored. I don't think I should be hiding the dialog boxes when back is pressed. It should just execute in the background.

gianfry56

  • Full Member
  • ***
  • Posts: 15
Re: Problem with Back in a List
« Reply #6 on: Apr 06, 2017, 10:18 PM »
OK, but if the problem is difficult to solve think it's better to return to the previous situation (ver. 7.5.8 ), to be able to still use sub onBack, although it was not perfect.
Good job
« Last Edit: Apr 07, 2017, 09:25 AM by gianfry56 »

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Problem with Back in a List
« Reply #7 on: Apr 07, 2017, 08:58 AM »
It will only take a little while. I have to get it fixed.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Problem with Back in a List
« Reply #8 on: Apr 07, 2017, 01:38 PM »
I released 7.5.10. I think it works right now. I wasn't testing it the way you are using it.

gianfry56

  • Full Member
  • ***
  • Posts: 15
Re: Problem with Back in a List
« Reply #9 on: Apr 08, 2017, 09:05 AM »
Thanks Chuck. With this new upgrade now it works well.
 :)

gianfry56

  • Full Member
  • ***
  • Posts: 15
Re: Problem with Back in a List
« Reply #10 on: Apr 08, 2017, 10:08 AM »
Question: when viewing a menu list by pressing Back jump to the subroutine onBack, ok;
Within onBack there is a way to close the list (by code) without selecting anything?
I think not, but I ask the same...

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Problem with Back in a List
« Reply #11 on: Apr 08, 2017, 03:10 PM »
Well, no. That's kind of why I had it dismiss the dialog boxes in the first release.