> The only workaround is to provide a background bitmap of exactly the right
> width, or not to test on debug ROMs.  Or perhaps a new version of Poser
> could suppress error dialogs with this text.  Keith?

Yeah, awright...the next externally released version of Poser will squelch this
message if it's displayed when it shouldn't.

By the way, another way around the The Case of the Erroneous Error is to patch
ErrDisplayFileLineMsg, check the message being passed in, and return
fatalDoNothing if it's the one you don't want to see.  That's pretty much what
Poser does...

But John's suggestion sounds more fun... :-)  (Ack! Aaron! Get away from my
keyboard!)

-- Keith Rollin
-- Palm OS Emulator engineer






John Marshall <[EMAIL PROTECTED]> on 02/14/2001 09:48:55 AM

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

Sent by:  John Marshall <[EMAIL PROTECTED]>


To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/US/PALM)
Subject:  Re: strange error when drawing a slider



John Cundall <[EMAIL PROTECTED]> wrote:
> When using the following code in the FrmOpenEvent handler for my app, I
> get a run-time error dialog from POSE saying "Control.c, Line:1707,
> Background must be at least half as wide as slider":
[...]
> The slider is 80x15 pixels. I haven't specified a background bitmap in
> the slider resource (using Constructor), so [...] the default background
> bitmap will be used.
[...]
> It only happens with the debug runs - the code runs fine on non-debug
> ROMs.

That's so amusing.  I noticed this bug only yesterday.  I've never seen any
other references to it.  Such a coincidence.

If you use a background bitmap which is not exactly the same width as your
slider, the OS will cover the whole slider by tiling it in a limited way:
it renders it twice -- once at the left, and once starting half way along.

To ensure that that covers the whole slider without gaps, debug ROMs check
that your bitmap is at least half the width of the slider.  Unfortunately,
the test is the wrong way around and it gives you the error when your
bitmap *is* wide enough instead of when it's too narrow.

There's actually nothing wrong with your program.  You only need to worry
if you *don't* get the error on a debug ROM.  :-)

The only workaround is to provide a background bitmap of exactly the right
width, or not to test on debug ROMs.  Or perhaps a new version of Poser
could suppress error dialogs with this text.  Keith?

Of course, as an academic exercise, you might like to search the debug ROM
file for "Background must be at least half as wide as slider" and find the
particular byte in the vicinity that is wrong.  Yeah, that might be an
interesting exercise...  :-)

    John

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





-- 
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