> The syncNotify message isn't sent using a thread that has access
> to the user interface system.

Oh, I see! Is that true only for the sysAppLaunchCmdSyncNotify launch code or 
also for some other launch codes, and, if the latter - for which ones?

> The way to do UI is to have your syncNotify handler set an alarm
> for the near future, then in the alarm handler do UI, since
> the alarm handler will actually switch to your application and
> give it appropriate context.

I thought about this but it wasn't worth the effort for the trivial 
proof-of-concept thing I was writing, so I ended up displaying a messages by 
writing directly to the screen:

void DisplayString (Char *str)
{
    Coord width, height, x, y;
    WinHandle win;
    RectangleType rect;
    Err err;
    Int16 len;

    len = StrLen (str);
    width  = FntCharsWidth (str, len) + 8;
    height = FntCharHeight () + 6;
    x = (160 - width)  / 2;
    y = (160 - height) / 2;
    RctSetRectangle (&rect, x, y, width, height);
    win = WinSaveBits (&rect, &err);
    WinEraseRectangle (&rect, 0);
    WinDrawRectangleFrame (dialogFrame, &rect);
    WinDrawChars (str, len, x + 4, y + 3);
    SysTaskDelay (SysTicksPerSecond () * 5);
    WinRestoreBits (win, x, y);
}

However, for other parts of my real application I need to know during which 
other launch codes (and maybe event notifications?) I am not allowed to use the 
user interface - so, could you please elaborate on that or point me to some 
source that describes it? Thanks in advance.

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

Reply via email to