Hey everyone! In my AppHandleEvent function, I have this chunk of code...

<pre>
case winDisplayChangedEvent:
{
        UInt32 Version;
        Err Error = FtrGet( pinCreator, pinFtrAPIVersion, &Version );
        if( Error == errNone && Version >= pinAPIVersion1_0 )
        {
                if( PINGetInputAreaState() != pinInputAreaUser ) 
PINSetInputAreaState( pinInputAreaUser );
                
                if( Version >= pinAPIVersion1_1 )
                {
                        if( FrmGetDIAPolicyAttr( Form ) != frmDIAPolicyCustom ) 
FrmSetDIAPolicyAttr( Form, frmDIAPolicyCustom );
                        if( PINGetInputTriggerState() != pinInputTriggerEnabled 
) PINSetInputTriggerState( pinInputTriggerEnabled );
                        if( SysGetOrientation() != sysOrientationUser ) 
SysSetOrientation( sysOrientationUser );
                        if( SysGetOrientationTriggerState() != 
sysOrientationTriggerEnabled ) SysSetOrientationTriggerState( 
sysOrientationTriggerEnabled );
                }
        }

        RectangleType NewBounds;
        WinGetBounds( WinGetDisplayWindow(), &NewBounds );
        WinSetBounds( FrmGetWindowHandle( Form ), &NewBounds );
                        
        FrmDrawForm( Form );
        
        Handled = true;
} break;
</pre>

The point of this code is to see when the see when the display was changed, and 
then change it back to what it is supposed to be.

And the line that says
<pre>
if( PINGetInputAreaState() != pinInputAreaUser ) PINSetInputAreaState( 
pinInputAreaUser );
</pre>
is making an infinite loop in the OS 5.4 simulator (not on the real palm 
though). What I think is happening is that when I press the button to open or 
close the DIA, it runs the code and sees that the area state isn't what the 
user specified (which it is, because i'm the one who opened or closed it). Once 
it sees this, it changes the area state to what the user last specified. There 
shouldn't BE a change though, because the last change of the area state in this 
case was by the user. Anyway, when I call PINSetInputAreaState, it sends 
another winDisplayChangedEvent, and this chunk gets called again. Whats weird 
is that it keeps going. I mean, if I just set it to pinInputAreaUser, shouldnt 
it see that it is STILL at pinInputAreaUser?

My question is: Why doesn't PINGetInputAreaState return pinInputAreaUser, when 
I just set it to pinInputAreaUser with PINSetInputArea state? Or if my code is 
completely screwed up, how can I set the screen to what it's supposed to be... 
without infinte loops?

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

Reply via email to