It's better to have different buttons at that spot in the resource and then
just enable the
one you need for a particular situation.  The problems with replacing the
text on the button
just aren't worth it.

__________________________
 Kevin O'Keefe
 The Windward Group
 TEL:   (408) 399-8577
 FAX:  (408) 395-9642
 mailto:[EMAIL PROTECTED]
__________________________



> -----Original Message-----
> From: Chris Antos [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 31, 1999 2:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Changing Text on Button: How Programatically
> 
> 
> watch out!  because this sample function uses FrmCopyLabel, 
> if the new label
> is longer than the original label, you will corrupt memory by 
> overwriting
> past the end of the buffer!  it is pretty dangerous to use 
> FrmCopyLabel
> inside such a general function.
> 
> 
> -----Original Message-----
> From: Robert Baglin <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Wednesday, March 31, 1999 2:20 PM
> Subject: Re: Changing Text on Button: How Programatically
> 
> 
> >Michael,
> >This works in my app. Just send it the ID of the Button and 
> the text you
> >wish to have displayed.
> >
> >/************************************************************
> ***********
> > * FUNCTION: LblChangeText
> > * DESCRIPTION: Changes Label Text
> > * PARAMETERS: wID: ID of Label, s: Text String for Label
> > * RETURNED: nil
> > 
> **************************************************************
> *********/
> >
> >void LblChangeText (Word wID, char *s)
> > {
> > FormPtr pForm;
> > Word wIndex;
> >
> > if (s == NULL) // Bad arg, do nothing
> > return;
> >
> > pForm = FrmGetActiveForm();
> > wIndex = FrmGetObjectIndex (pForm, wID);
> > FrmHideObject (pForm, wIndex);
> > FrmCopyLabel (pForm, wID, s);
> > FrmShowObject (pForm, wIndex);
> > }
> 
> 
> 

Reply via email to