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/405wJe4TButton API:
http://pastebin.com/n1gKzW9PLine 57 of program 1 is where I register the function, line 71 is where I register the button.
7083 posts
Location
Tasmania (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.
119 posts
Posted 17 November 2015 - 10:57 PM
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/bBcpvY2iI 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 on 18 November 2015 - 08:57 PM