Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!agate!ucbvax!osf.org!dbrooks From: dbrooks@osf.org Newsgroups: comp.windows.x.motif Subject: Re: insert/replace resource for XmText Message-ID: <9102271501.AA11787@osf.osf.org> Date: 27 Feb 91 15:01:46 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 33 On motif-talk, Nico wrote: > People in our tutorials ask me so often why there is > no resource for XmText widgets to switch between > insert and replace mode. > It would really make a lot of sense to introduce it. > > Are there any planings to have it in the future ? > > Are there any workarounds to have it now ? > (XmText patches and/or workarounds for application side) Oh, you want a *workaround*. Well, this is a basis of a workaround for one-line text widgets. You'll probably have to add sophistication to taste; I could imagine using the userData to control a mode switch. XtAddCallback(text, XmNmodifyVerifyCallback, tcb, NULL); ..... /*ARGSUSED*/ void tcb(w, d1, mvcb) Widget w; caddr_t d1; XmTextVerifyCallbackStruct *mvcb; { if (mvcb->text->length == 1) { XtCallActionProc(w, "delete-next-character", mvcb->event, "", 0); } } David Brooks Systems Engineering Open Software Foundation