Thanks for the quick response!
The reason that I considered not handling the event is the fact that
I've got the pop-up trigger associated with a non-active list. If I
don't try to make a new label on the form (or simply don't handle the
popSelectEvent) the system takes care of changing the label on the
pop-up trigger for me. Do you know why I might need to take care of it
manually with the CtlSetLabel() after I've used FrmNewLabel to add
something to the form?
Paul Taylor wrote:
>
> Eric,
>
> You'll probably have to use CtlSetLabel like this:
>
> CtlSetLabel (GetObjectPtr (PopUpTrigger), ListOfNames[selection]);
>
> Where "ListOfNames" is your string array of names, and "PopUpTrigger" is
> whatever the name of the particular Trigger you want to change the label
> of...
>
> I think that'll accomplish what you want...
>
> Paul
>
> > In response to a user picking an option from a pop-up list, I'd like to
> > dynamically add some widgets (in this case, a label) to a form. In my
> > form's event handler, I've inserted the following code:
> >
> >
> > case popSelectEvent:
> > frmP = FrmGetActiveForm();
> > theLabelPtr = FrmNewLabel( &frmP, 5000, "Wowza", 20, 100, stdFont);
> > FrmDrawForm( frmP);
> > handled = true;
> > break;
> >
> > This in fact adds the new label to the form, and even shows it, but the
> > label on the pop-up list doesn't change, since I've claimed to have
> > handled the event. However, when I don't return true (i.e. I leave
> > 'handled' false) the debugger first tries to find MacStubs.c (in order
> > to show the offending source, I assume) and (when I decline to provide
> > that file) posts the following message:
> >
> > File: MemoryMgrNew.c, Line: 4023, Invalid chunk ptr
> >
> >
> > I even added a (what I assume is a useless call)
> >
> > FrmSetActiveForm( frmP);
> >
> > just before the FrmDrawForm call, but still get the error.
> >
> > What am I missing? Any ideas?
> >
> > Many thanks,
> >
> > Erik Steinmetz
> > [EMAIL PROTECTED]
> >