Try looking at what the default button of the form is (set in constructor
for codewarrior).  That is the button ID that is returned in the case that
the app iks quit.  You prolly want to set the default button ID to the ID
of the cancel button.

---

--On Fri, Feb 4, 2000 11:54 AM -0500 Thomas Ward <[EMAIL PROTECTED]>
wrote:

> 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

Reply via email to