My app "Silence" has the same situation. An alarm may occur that wants
to cause the main view to update, and this may happen either while that
view is active, or while a popup form is active. My solution is this:
In the alarm handler I call
FrmUpdateForm(FrmGetActiveFormID(), frmRedrawUpdateCode)
This sends a frmUpdatEvent to either my main form, which handle it by
updating the form, or to my popup form. Since the only reason my popup
form would be getting a frmUpdateEvent is that the alarm handler sent
it one, it handles this event by setting a global variable that it
examines when it is closing, and calls
FrmUpdateForm(mainformID, frmRedrawUpdateCode)
on its way out.
--
Roger Chaplin <[EMAIL PROTECTED]>
Danko Radic wrote:
> My app. has few forms. I've implemented pagercard support (Motorola,
> pagercard for Palm II). Mechanism for receiving and handling pages is
> trigged via special lounch code independently of the rest of app. (running
> is seized while that pager code executes). Now, I have to update the 1st
> form by info received via pager and I'm looking for the most elegant way
> to pass a kind of alarm to the form so that it can grab appropriate data
> and be updated.
> I thought that I might generate a custom event by pager function that
> could be handled by my 1st form event handler.
> But, the page (and my event) can come when the 1st form isn't active, and
> then I'll loose update alarm. So, the overkill soultion would be to set a
> flag by pager function when message is received and then generate custom
> events periodicaly within AppEventLoop while it is not handled. And again
> EvtGetEvent is set to WaitForever mode and I'd like to keep that setting
> because of whole bunch of other events I have to handle.
> So, dear colleagues, what solution would you suggest as the most elegant
> one?
>
> Thanks
>
>
>