>Try this:
>if you handle events of type frmCloseEvent in the event handler for your
>"Main1" form,
>return false whenever you catch one.
I am doing this already.. here, I wrote a two screen example of this
problem.. in the constructor, I've created Main and Main2 .. main has a
label that says "this is form 1" and a push button.. main2 has a label
that says "this is form 2" in a different place than the label on Main and
another push button in a different place than the other button... Both are
set to visible, but not checked for Modal or Save Behind.. Then this source
to flip back and forth between the two screens... What happens is that when
Main 2 appears, Main's controls are still visible.. curiously, when you
click Main 2's button, Main appears normally. This only happens on OS3.5 ..
this code flips back and forth clearing the screen as expected on all
pre-OS3.5 versions I've tested (PalmPilot Pro, OS 3.0, OS 3.3)
#include <Pilot.h>
#include "MainRsc.h"
#include "Main.h"
// prototypes omitted for space...
// application globals deleted for space...
static void ChangeCurrentView(Word newView)
{
CurrentView = newView;
FrmGotoForm(CurrentView);
}
static void EventLoop(void)
{
EventType event;
Word error;
do {
EvtGetEvent(&event, evtWaitForever);
if (! SysHandleEvent(&event))
if (! MenuHandleEvent(CurrentMenu, &event, &error))
if (! ApplicationHandleEvent(&event))
FrmDispatchEvent(&event);
}
while (event.eType != appStopEvent);
StopApplication();
}
DWord PilotMain(Word cmd, Ptr cmdPBP, Word launchFlags)
{
Err err;
if (cmd == sysAppLaunchCmdNormalLaunch)
{
err = StartApplication();
if (err) return err;
FrmGotoForm(CurrentView);
EventLoop();
}
return 0;
}
static void StopApplication()
{
}
static Err StartApplication(void)
{
ChangeCurrentView(MainForm);
return 0;
}
static Boolean ApplicationHandleEvent (EventPtr event)
{
FormPtr frm;
Word formId;
Boolean handled = false;
if (event->eType == frmLoadEvent)
{
formId = event->data.frmLoad.formID;
frm = FrmInitForm(formId);
FrmSetActiveForm(frm);
switch (formId)
{
case MainForm:
case Main2Form:
FrmSetEventHandler(frm, MainFormHandleEvent);
break;
}
handled = true;
}
return handled;
}
static Boolean MainFormHandleEvent(EventPtr event)
{
Boolean handled = false;
FormPtr frm;
frm = FrmGetActiveForm();
switch (event->eType) {
case ctlSelectEvent:
if (CurrentView == Main2Form)
ChangeCurrentView(MainForm);
else
ChangeCurrentView(Main2Form);
handled = true;
break;
case frmOpenEvent:
FrmDrawForm(frm);
handled = true;
break;
}
return(handled);
}
----------
Bradly J. Barton - [EMAIL PROTECTED]
Jenies Technologies Incorporated
(972) 602-1835
JTI.net
PalmInHand.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html