[comp.windows.x] Help with HP TextEdit widget and DiskSrc

keith@prism.gatech.EDU (Keith Edwards) (05/07/90)

I'm trying to use the HP TextEdit widget to display a file from disk.  Seems
like it ought to be simple.

Here's a fragment of the code I'm using:

	n=0;
	XtSetArg( args[n], XtNsourceType, XwdiskSrc );		n++;
	XtSetArg( args[n], XtNfile, "/tmp/foo" );		n++;
	XtSetArg( args[n], XtNeditType, XwtextRead );		n++;
	text = XtCreateManagedWidget( "text", XwtextEditWidgetClass, form,
		args, n );

From a little handy work with dbx and the Xw sources it looks like the thing
is dying after it tries to load the subresources associated with DiskSrc.
The first thing it does after the XtGetSubresources() is a strcmp() on
data->filename (data should have been filled from the XtGetSubresources()
call).  It's dying in this strcmp().

The documentation I have lists another Arg name called XtNsource, but this
doesn't seem to exist.  Some more digging in the source reveals that there is
a beast called XtNtextSource which looks like it may be the same thing.  I
tried setting it to "DiskSrc," XwdiskSrc, NULL, and a few other values, but
to no effect.

Doug Young's book offers no help with using TextEdit to view a file from
disk.

Has anyone out there accomplished such a feat?  Am I doing something incredibly
stupid?  I'm running X11R4 on a SparcStation1 (SunOS 4.0.3).

-keith

-- 
keith edwards -- the software engineering research center / multimedia group
  internet:  keith@dali.gatech.edu                          georgia tech
    uucp:  {the_known_world}!gatech!dali!keith              atlanta, ga
      next:  kedwards@next.com	                            30332-0280