[comp.windows.x.motif] text widget beeps

carl@quad1.quad.com (Carl Priddy) (08/16/90)

Hello,
 For those of you concerned about flaky text widget actions, here is a
 response I received from someone who actually bought the source!
carl.

Hi, 

I read your question concerning Motif Text Widget beeps.  I dont have
any experience with Text Widgets in particular (I'll soon get some :-), 
but as its very challenging to debug such a big... thing..., here's
what I see:

I see the "real" Text is accessed via some kind of object, pointed to
by widget.text.source.  Source has Methods, just like a widget.
One of them, "Replace", it is the basic function for modifying text.

Replace calls the ModifyVerifyCallback to check whether it may 
alter the text, with reason XmCR_MODIFYING_TEXT_VALUE.  If
that callback fails (doit is set to false), the whole thing
returns EditReject.

Replace is called by Routines from TextIn.c. The Calls look like this:

    if ((*widget->text.source->Replace)(widget->text.source, from, to, &text)
       != EditDone) {

	XBell(XtDisplay(widget), 42);
    }

-- and that's why it beeps. You say: the text may not be modified; ok,
so the user must have made an ERROR!  Terrible thing!  Beeeep!!! :-)

I guess there is no way to turn this off.  Oh well, as you already
noticed the text widget is of no use as a "real" editor anyway...

Sigh.
	:-) Jutta Degener