The Palm OS maintains a stack of graphics states that it uses while performing
its own drawing. A state is pushed onto the stack with WinPushDrawState and
popped off with WinPopDrawState. This stack is cleared out and re-initialized
each time an application is launched.

Apparently, WinScreenMode is not prepared to change the entire graphics world if
any states remain on the stack. That's why you're getting the error message.

The OS calls WinPushDrawState and WinPopDrawState all over the place. Normally
they're paired up -- one at the beginning of a function that does some drawing,
and the other at the end. Without knowing more about the context in which you're
making your call to WinScreenMode, it's not easy to say if you've managed to
insert yourself between such calls, or you've found a way to unbalance calls to
those functions.

-- Keith Rollin
-- Palm OS Emulator engineer






"Iain Barclay" <[EMAIL PROTECTED]> on 08/02/2000 11:14:32 AM

Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>

Sent by:  "Iain Barclay" <[EMAIL PROTECTED]>


To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/US/PALM)
Subject:  Window Draw State Stack error



Hi,

I'm getting a message Window Draw State Stack Not Empty" from POSE running a
3.5EZ debug ROM. The error comes when I start my app from the launcher and
points to the code:

    WinScreenMode(winScreenModeGet, 0, 0, &depth, 0);
    if (depth<8)
    {
      //Are we running an EZ processor - i.e. can we do gray?
     UInt32 id, chip;
     Err err;
     UInt16 revision;

     err = FtrGet(sysFtrCreator, sysFtrNumProcessorID, &id);
     if (!err)



      UInt32 newDepth=4;

      chip = id & sysFtrNumProcessorMask;
      revision = id & 0x0ffff;

      if (chip==sysFtrNumProcessorEZ)
       WinScreenMode(winScreenModeSet, 0, 0, &newDepth, 0);
     }
    }

Can anyone tell me what I'm doing wrong here?

Thanks,
Iain





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

Reply via email to