[comp.windows.x] asciiDiskWidgets and temporary files

dreese@ATHENA.EE.MSSTATE.EDU (Donna Reese) (11/16/89)

I am trying to create a simple text window which I can just write text to.
I don't have a file, but the docs say that if you don't specify XtNfile
it will use tmpnam().  Well, it does, except that it then tries to open
the file with a r+ option which doesn't work because the file doesn't 
exsist.  Short of creating my own tmpnam() opening it and closing it to
make it exist and passing that, is there a way around this.  Is this
a bug, or am I doing something wrong??
                                    _______
                                   /       |
==================================/        |===================================
| Donna S. Reese                 /Starkville                                  |
| Assistant Professor            /       * |   Internet:dreese@cs.MsState.Edu |
| Mississippi State University   \         |   Bitnet:  dreese@MsState.BITNET |
| Post Office Drawer CS           |        |   Phone:   (601) 325-2756        |
| Mississippi State, MS 39762     /        |   FAX:     (601) 325-2298        |
=================================/         |===================================
                                |______    | 
                                      /    | 
                                      \____| 

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (11/17/89)

> I am trying to create a simple text window which I can just write text to.

It sounds like you need an asciiString widget.

Who is doing the writing?  If the user is typing at it then 
you probabally want an editable text widget, and this is not supported
by the asciiDisk widget in R3.  In R3 you need to allocate enough space
for the user to type into, and then pass this buffer into the Text widget
with the XtNstring resource, and the length of this buffer with the XtNlength
resource.

If the application just wants to display a multi-line string then you should
need an asciiString widget anyway.  Am I missing something here?

> Well, it does, except that it then tries to open the file with a r+ option
> which doesn't work because the file doesn't exsist.

Why would you want a read only text widget on a file that doesn't exist?

> Is this a bug, or am I doing something wrong??

The fact that this is so difficult to understand the interface, and that you
have to do so much work to get a simple text widget up and running is a bug.
The R4 interface will go a long way to improving the Text widgtet's API.


						Chris D. Peterson     
						MIT X Consortium 

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