[comp.windows.x] Shed some light....

dsseewe@SUPER.ORG (Daniel Seewer) (07/21/89)

	How about shedding some light on a subject that has been in the 
dark for me for a while.  TextWidgets!!!!  What are the necessary steps
to have the following actions take place:

		1)  Take an existing file and use it as a "source" for
			the text widget. (I believe source is the correct term)

		2)  Have it so the text of the file is "Editable".

	These steps seem relatively simple.  I am at the point where I can
actually pop a window up that contains the contents of the file but they are
not editable using the asciiDiskWidgetClass.  I can also pop up a window using
the asciiStringWidgetClass that is editable (after allocating the memory for
the string).  Must I read in the entire file into a buffer and then create
an asciiStringWIdgetClass?  I looked at the xedit program which does just what
I want to do but it seemed to use the private header file for TextSrcP.h and
this caused me some concern.  I have RTFMd the intrinsics and Athena 
documentation until I am blue in the face.  Any help in further explaining 
the concept of source and sinks or pointers to GOOD examples would be 
priceless!!!!!!  Thanks in advance.

			Just sitting in the Dark!
		
				Dan Seewer (dsseewe@super.org)

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (07/26/89)

> 	How about shedding some light on a subject that has been in the 
> dark for me for a while.  TextWidgets!!!!  What are the necessary steps
> to have the following actions take place:

> 		1)  Take an existing file and use it as a "source" for
> 			the text widget. (I believe source is the correct term)

asciiDiskWidgetClass will do this, but it will not be fully editable.

> 		2)  Have it so the text of the file is "Editable".

Wait for R4 I have added an editable disk source to Xaw.  If you can't wait
the you can load the file into a string, and use a string source, or you
can attempt to use the EDiskSource from xmh, but it is pretty lean and mean.

> Any help in further explaining  the concept of source and sinks or pointers to
> GOOD examples would be  priceless!!!!!!  Thanks in advance.

This has been a much overlooked topic, I promise things will be much better
in R4.  Patience is a virtue :-)

						Chris D. Peterson     
						MIT X Consortium 

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