767 posts
Posted 16 January 2013 - 09:49 AM
Hello.
i am (still) making my own Operating System, for my single player world… But, im stuck in a side menu IN the start menu .. i can show a picture:
EDIT: i should Properly post the code too. :P/> DERP
http://pastebin.com/tZbUJebQ You can also see the "WORKED" test, and it actually opened the brown arrow, side menu.. but then there, it is bugging…
As you can see the Brown arrow.
Then the popup menu…
But.. now when i clicks at ANY thing on the screen, ALSO the newest, added "exit" if statement, then all of the sudden, it just doesnt do what it should do.
Can anyone see / solve the problem?
or did i explain too bad?
Thanks in Advance
2088 posts
Location
South Africa
Posted 16 January 2013 - 09:59 AM
Is the problem that none of the options in the side menu work?
767 posts
Posted 16 January 2013 - 10:13 AM
Yes
right now i have only made the exit button but it seems like not to work.
2088 posts
Location
South Africa
Posted 16 January 2013 - 06:22 PM
I can't seem to find the problem, but I think it's because you don't have all mouse clicks yields within one function and so it goes to the other functions.
But I did notice this:
x, event1, mButton, xChor, yChor = os.pullEvent()
x is now the event, event1 is the button but you check event1 as "mouse_click", not sure why you were doing this
767 posts
Posted 16 January 2013 - 06:37 PM
That x was added just for testing. But i am calling the other click event, because i want it, if i click on one of the buttons, it will do an action. But its still, not working :(/>/>
edit: derp. Maybe i should read your whole post xD. But i will try to edit that. Wait a few… Still not working…
Current Code:
http://pastebin.com/tZbUJebQ– edited x, event1, mButton, xChor, yChor = os.pullEven()
– and some other stuff
– but still not working.
**When i click at the "EXIT" button, it just returns to the desktop screen, and then it looks like its not even RUNNING the if statement, for the Button. but im not totally sure **
Thanks in advance
2088 posts
Location
South Africa
Posted 16 January 2013 - 09:09 PM
Yeah I also removed it when testing and it did nothing. I also added an error() there for when it is clicked but still nothing.
I think it's because you have so many parallel calls and a function for each step.
Everything should work if you were to combine them into 1 loop instead of calling functions all the time, also makes it neater.
I've seen a lot of OS's but none that use so many parallels.
Although, I know this is only for you but it's still quite messy o.O
767 posts
Posted 17 January 2013 - 02:24 AM
Well.. okay.. i will rewrite everything, and start off from the start, with the helping functions ( limitRead, printCentered, etc.. )
But thank you.
edit: well i think this should be a better look, on the code.. do you think this format is better?
http://pastebin.com/XuxjznLU :D/>
2088 posts
Location
South Africa
Posted 17 January 2013 - 03:14 AM
Yeah, one parallel usage would probably make it much better - lessen the flickering etc.
What's in the input function?
767 posts
Posted 17 January 2013 - 03:28 AM
that input function will be the "MASTER" of the screen function… when i click, ( for example right click, it will turn a "rightMenu" variable to true, and then it displays a rightclick menu.
i will maybe post my code, later :D/>
767 posts
Posted 17 January 2013 - 03:29 AM
ehm and one more question:… When making a right click menu… then i only want to make 1 menu with just "test" but i want it then, to automatically,calculate, the middle of the length of the right click menu, and then write the "test" in the middle… can you help me with that? screen shot is coming in a moment
i dont want to post, code, because i just printed that.. its a "test" . but can you see what i mean… like calculates the "Test" at the bottom, to automatically be in the middle of the right click menu…
i hope you can help me with this, too :D/>