Al Smith wrote:
Thanks Matt,
do you happen to have any simple examples how to do this task.
no, but it's easy.
when you decide you want to go to a new form, call
FrmGotoForm( YourNewForm );

Then in your AppHandleEvent() function that should be in Starter.c, just set the form event handler to the handler you want to use for that form. Something more or less like this:

static Boolean AppHandleEvent(EventPtr eventP) {
UInt16 formId;
FormPtr frmP;

if (eventP->eType == frmLoadEvent) {
// Load the form resource.
formId = eventP->data.frmLoad.formID;
frmP = FrmInitForm(formId);
FrmSetActiveForm(frmP);

// Set the event handler for the form. The handler of the currently active form is called by FrmHandleEvent each time is receives an event.

switch (formId) {
case YourNewForm:
FrmSetEventHandler(frmP, YourHandler());
break;

default:
ErrFatalDisplay("Invalid Form Load Event");
break;
}
return true;
}

return false;
}


--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/


Reply via email to