You are supposed to handle events like button taps in a forms event handler
function. You should not use the While loop to keep the processing focused
on this particular test. You are supposed to let events flow through your
application event loop function where they get picked off by appropriate
event handling routines. The programming paradigm for Palm is a little
different from what you might be used to. Start checking out some of the
books on Palm programming. Neil Rhodes book would be a good start.
> -----Original Message-----
> From: Thomas Ward [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, February 04, 2000 11:54 AM
> To: Palm Developer Forum
> Subject: Modal Form Question
>
> Hi All,
>
> At one of my forms, when the user presses a button, I pop up a small modal
> form. The form contains an input field and OK and CANCEL buttons. Since I
> have to validate the user's input, I have the following loop:
>
> FormPtr dialog = FrmInitForm(my_dialog);
> Word button_selected;
> Boolean success = false;
> Boolean done = false;
>
> while (!done) {
> button_selected = FrmDoDialog(dialog);
> switch (button_selected) {
> case ok_button:
> if (user input was valid) {
> done = true;
> success = true;
> }
> else
> FrmCustomAlert(show error message);
> break;
> case cancel_button:
> done = true;
> break;
> }
> }
> FrmDeleteForm(dialog);
> if (success) // do further processing
>
> This works just fine. The problem is that if the user presses the
> application silk-screen button while the dialog is up, I am in an infinite
> loop. How can I test in my WHILE loop for this condition so that I can
> exit?
>
> Thanks in advance,
>
> Tom Ward
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html