I was able to solve the 2nd of the two problems (dirty pixes reappearing),
by changing the code as follows:
RctInsetRectangle(&listBounds, -1); //to cover list border
saveBits = WinSaveBits(&listBounds, &error);
FrmShowObject(formP, listIndex);
LstDrawList();
while (waiting for lstSelectEvent)
{
pass list related events to LstHandleEvent()...
}
LstEraseList();
FrmHideObject(formP, listIndex);
if (saveBits)
WinRestoreBits(saveBits, listBounds.topLeft.x, listBounds.topLeft.y);
The key was the call to FrmHideObject() which was missing before.
But I am still left with the question: why didn't FrmSave/RestoreActiveState
work instead of the calls to WinSave/RestoreBits in the above code?
Thanks for the help!
Dave
"David M. Lasker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I am an experienced programmer working on my first Palm application.
I created an application which used LstPopupList() to pop-up a list over
a form. This works fine. However, I wanted to be able to handle
keyDownEvents during the time that the list was popped up.
So I changed the original call of LstPopupList() to the following code:
FormSaveActiveState();
LstDrawList();
while (list item not selected)
{
pass list related events to LstHandleEvent()...
}
LstEraseList();
FrmRestoreActiveState();
I found that after the above code had run and the list was erased, there
were still remnants of the list's pixels remaining on the underlying
form. Testing revealed that the above call to FrmRestoreActiveState()
had absolutely no effect.
I removed the calls to FrmSave/RestoreActiveState() and replaced them
with calls to WinSave/RestoreBits(). This solved the immediate problem,
but left me with a 2nd problem:
Right after the above code runs, I bring up a Modal form using
FrmDoDialog(). Before bringing up the dialog, the underlying form is
clean. But after the modal dialog is dismissed, the popup list's pixel
remnants that were cleaned up by the call to WinRestoreBits come back!
I was able to solve the 2nd problem by putting another pair of
WinSaveBits/WinRestoreBits around the FrmDoDialog(). But I don't think I
should need this - the main form is clean before the modal dialog comes
up, and there were no problems in the original application which used
LstPopupList().
So I have the following questions:
1. What is the purpose of FrmSaveActiveState() and should it have worked
for me?
2. When should FrmSave/RestoreActiveState be used vs.
WinSave/RestoreBits?
3. What is the correct restore an underlying form after erasing a
popup-list, i.e. how does the underlying code in LstPopupList() work???
Testing was all done using SDK-5 on POSE w/5.2 ROM. Development
environment is GCC prc-tools/pilrc.
Thanks for the help...
Dave
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/