Hmm. I have an idea about your problem.

First, it does work for me :
dell: {93} matrix2
Yow prev_text(Meters) verify(c)
Yow prev_text(Metersc) verify(x)

The second field is printing cbp->verify->text->ptr as you say.

The hunch I have is that not all of Motif's stuff is NULL-terminated
when the structure contains not only a char * but also a length
field.

Could you build simple code to use only the first "length" bytes
of "ptr" ? Or verify in your favourite debugger that this is
the problem ?

        Danny

Mike Accolla wrote:
> 
> Hi Danny,
> 
> Thanks for the code change... it worked great....   BUT... there seems to be a 
>similar problem with the
> verify->text->ptr   value.  When I check the dereferenced character value in the 
>callback, it's always
> NULL.
> 
> If you come across anything please let me know.... Thanks, I appreciate it.
> 
> Regards,
> Mike
> 
> Danny Backx wrote:
> 
> > I do have a different result, but that doesn't matter.
> >
> > Careful rereading of xbaeModifyVerifyCB() reveals a silly bug.
> > The line
> >         call_data.prev_text = ((XmTextRec*)w)->text.value;
> > is simply wrong. It, and the following lines, should read :
> >
> >     call_data.prev_text = XmTextGetString(TextChild(mw));
> >
> >     XtCallCallbackList((Widget) mw, mw->matrix.modify_verify_callback,
> >                        (XtPointer) & call_data);
> >
> >     XtFree((char *)call_data.prev_text);
> >
> > Can you make that change in Methods.c around line 1860 and check whether
> > this makes your application work ?
> >
> > I've just committed this to CVS so it'll be in the next release.
> >
> >         Danny
> >
> > Mike Accolla wrote:
> > > Thanks for your prompt response.  However, I tried your new file, and it still 
>core dumped when I
> > > printed out
> > > cbp->prev_text   (i.e.  printf("Prev Text = [%s]\n", cbp->prev_text); ). I 
>noticed in your gdb output
> > > that prev_text doesn't contain a value, it is a NULL string.  I need the 
>previous value to do some
> > > field validation. I believe if you add the above line to your code, it will core 
>dump as well on your
> > > system.
> > >
> > > If you have a different result, please let me know.
> > >
> > > Thanks again,
> > > Mike
> >
> > --
> > Danny Backx ([EMAIL PROTECTED] [EMAIL PROTECTED])
> > Home page :     http://users.skynet.be/danny.backx
> > Projects:       LessTif (http://www.lesstif.org)
> >                 Oleo    (http://www.gnu.org/software/oleo/oleo.html)

-- 
Danny Backx ([EMAIL PROTECTED] [EMAIL PROTECTED])
Home page :     http://users.skynet.be/danny.backx
Projects:       LessTif (http://www.lesstif.org)
                Oleo    (http://www.gnu.org/software/oleo/oleo.html)

Reply via email to