[comp.windows.x] Please help me fix a Athena text widget.

chymes@fribourg.csmil.umich.edu (Charles Hymes) (05/26/90)

I h  ave been trying to figure this out for days, without sucess.
I have a program that was written for X11R3 and used the folloing code:
ForceBuildLineTable(ipanel->text) where

ipanel->text = XtCreateManagedWidget("IPANEL",asciiStringWidgetClass,
                                       box, a, XtNumber(a));

I am trying to replace the X11R3 function ForceBuildLineTable with the X11R4
function _XawBuildLineTable. _XawBuildLineTable takes the arguments

	_XawTextBuildLineTable (ctx, position, force_rebuild)
	TextWidget ctx;
	XawTextPosition position;       /* top. */
	Boolean force_rebuild;

The code for old ForceBuildLineTable() in ites entirety is


	void ForceBuildLineTable(ctx)
	    TextWidget ctx;
	{
  	  XtTextPosition position;

	    position = ctx->text.lt.top;
	    ctx->text.lt.top++; /* ugly, but it works */
	    BuildLineTable(ctx, position);
	}


So, to use the new function, I have to provide the parameter position, and get it
 from the TextWidget ipanal->text. I have been unable to access the elements of 
TextWidget. Basicly, I cannot figure out what the elements of a TextWidget are,
and can therefore only guess what my indirect references should be. 
I have tried :
_XawTextBuildLineTable(ip->text,
                         ip->text->lt.top,
                         TRUE);
But my compiler only snorts at me in contempt.

Help!!!!


Charles Hymes

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (06/13/90)

> I have been trying to figure this out for days, without sucess.
> I have a program that was written for X11R3 and used the folloing code:
> ForceBuildLineTable(ipanel->text) where

That is an internal function and shouldn't be used, I assume that what you are
trying to do is to programically force the Text widget to redraw itself.  To do
this you should use XtCallActionProc() to call the Text widget action
"redraw-display".  This is the closest there is to a public interface that will
redisplay the contents of the Text widget.


						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213