Page 1 of 1

PostPosted: Tue Feb 20, 2001 2:29 am
by brendan
Does anyone know a way to quit the pocket c shell after the app is finished, so users don't have to hit the x....


PostPosted: Tue Feb 20, 2001 10:48 am
by darwin
hm. What do you mean? The user won't see the Runtime Shell, if you just exec the app file (for example if you copy the .app file zo the startmenu). If you run first the shell and exec then the app, I don't know how to close the shell...

PostPosted: Tue Feb 20, 2001 4:59 pm
by airdrik
If you have the runtime installed on your device, then if you just run the applet, it runs automatically without the shell poping up or anything. Or at least that is what it did on my HPC.

PostPosted: Tue Feb 20, 2001 8:12 pm
by brendan
mmm, I have the .app in the start menu under games.... it runs ok, but when it finishes the shell menu pops up at the top with the file menu (About/show console/exit) and the close button in the other corner.....

PostPosted: Tue Feb 20, 2001 8:33 pm
by airdrik
Use menu_off(). Then when you want to quit use quit(); sleep(0); the sleep(0) is because when you call quit(); it continues running the program until the quit() command is finished closing your program. You use sleep(0) so that it won't do that)

PostPosted: Tue Feb 20, 2001 9:22 pm
by brendan
the menu_off(); command I have run at the start, but putting a sleep(0); command before or after the quit(); does nothing.... I was doing a menu_on(); before the quit;... either way the app won't quit.

PostPosted: Wed Feb 21, 2001 7:47 am
by ajones
I think you need to get out of your event loop. I use a boolean value to get out.

Something like:
<pre id=code><font face=courier size=2 id=code>
main () {
int bQuit, msg;
while(!bQuit) {
msg = event(1);
switch(msg) {
if (guiid() == BTN_X) {
bQuit = TRUE;
} // end switch
} // end while
</font id=code></pre id=code>

I just typed that off the top of my head, but I think it's how my apps work...

Hope it helps, Tony (in Chennai for the moment)

PostPosted: Wed Feb 21, 2001 7:23 pm
by airdrik
You put the sleep(0) after the quit(), otherwise it is pointless to have it there. But I don't know why that wouldn't work, quit() should exit completely and (as long as you add sleep(0) after it) immediately from your program, shell and all. You can add your little breaks and stuff after so that it breaks out of the loops and stuff, but they aren't entirely nessecary.