So I have a modal form, that conatains a table among other form elements,
that I want to disappear when a cell in a table is selected.
Using FrmDoDialog the form can easily be displayed, and it will stay active
until false is returned from a ctlSelectEvent. To to have the tblSelectEvent
event be the one that closes the form I handled that tblSelectEvent, and had
it create a ctlSelectEvent to a hidden button on the form. The event is
being queued ok, but after I return false after handling the ctlSelectEvent
I get a  "read from low memory error".

The code is below, has anyone tried this? successfully?
Or is there another way of doing this?

Thanks
Shane


=======================================================



        FormPtr pform = FrmInitForm (MyFormForm);
        FrmSetEventHandler (pform, MyFormProc);
        returnButton = FrmDoDialog (pform);
        
        FrmDeleteForm(pform);
                

// in my event handler:

                case tblSelectEvent:
                        if (pevent->data.tblSelect.column != 0)
                        {
                          EventPtr pmyEvent;
                          pmyEvent = (EventPtr)MemPtrNew(sizeof(EventType));
                          MemSet (pmyEvent, sizeof(EventType), 0);
                          pmyEvent->eType = ctlSelectEvent;
                          pmyEvent->data.ctlSelect.controlID = MyOKButton;
                          EvtAddEventToQueue(pmyEvent);
                          handled = TRUE;
                          break;
                        }

                case ctlSelectEvent:
                        switch (pevent->data.ctlSelect.controlID)
                        {
                                case MyOKButton:
                                        handled = FALSE;
                                break;
                                }
                        break;



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to