Jump to content




Button does not work


  • You cannot reply to this topic
2 replies to this topic

#1 Twijn

  • Members
  • 119 posts

Posted 16 November 2015 - 09:51 PM

I have tried for hours (yes, hours) on how to fix this problem but for some reason I cannot find it! The problem I have is that none of the buttons I'm registering do not work for unknown reasons, when the same button api works with other things I have made.

This may be a bit confusing to put all together because this will be a part of a OS.
Program 1:
http://pastebin.com/405wJe4T
Button API:
http://pastebin.com/n1gKzW9P

Line 57 of program 1 is where I register the function, line 71 is where I register the button.

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 17 November 2015 - 04:36 AM

Seems you're neglecting to call buttonapis.startLoop() - at a glance, adding it to your parallel.waitForAll() call down the bottom may do the trick.

#3 Twijn

  • Members
  • 119 posts

Posted 17 November 2015 - 10:57 PM

View PostBomb Bloke, on 17 November 2015 - 04:36 AM, said:

Seems you're neglecting to call buttonapis.startLoop() - at a glance, adding it to your parallel.waitForAll() call down the bottom may do the trick.

Sorry, I forgot to mention, it is ran on startup here:
http://pastebin.com/bBcpvY2i
I run the file(to create the function) then I run the startLoop function at the bottom.

Additionally, I have found that this for some reason is not registering the button. I checked by printing all of the table in the button api, and it worked with all other programs beside this one.

I have also checked to make sure that I am not removing all buttons somehow right after making them by having it print something then waiting a second each time the buttons were cleared.

EDIT: I believe I may have found the problem, however I have not found a way to fix it just yet.

In the startLoop function and with the menu I currently have with my OS, the button api calls a function which then runs the file. The file will not return though because the parallel.waitForAll is stopping it because the "scroll" function does not return ever. Because the file never returns, the startLoop function will never continue. It will also not work if you terminate the program because that terminates the startLoop function.
Can anyone think of a way to bypass this problem?

Edited by Twijn, 18 November 2015 - 09:57 PM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users