[net.micro.amiga] Requesting a filename

hsgj@batcomputer.TN.CORNELL.EDU (Dan Green) (06/10/86)

I would like to have the user enter a filename from my C program.
I have been looking at Requesters, but it appears that they are 
only used for yes/no input.  The Requesters structure seems to
just have pointers to positive and negative text, and the Request()
and AutoRequest() look like they just return a true/false depending
on whether the user's response is DoIt or Cancel.  Please, please
correct me if I am wrong, but that's the way it looks to me.
   So the only way I can think of requesting a filename is to
generate a window that is one text line high, and attach a console
to it in raw mode.  Then I would just watch the input of the usre,
and when I see a CarriageReturn then I would have the filename, and
could close the window.  This seems like a lot of work, especially
since I would probably have to do my own backspace and ^X processing.
   So, is theere a function that I am missing that puts up a standard
get_file_name request?  If not, is the way I am thinking about doing
it the only/best way to go?  Any responses here would be helpful.
-- 
Dan Green    ARPA:    hsgj@vax2.ccs.cornell.edu
~~~~~~~~~    BITNET:  hsgj@cornella
             UUCP:    {decvax,ihnp4,allegra}!cornell!batcomputer!hsgj

higgin@cbmvax.UUCP (06/12/86)

In article <419@batcomputer.TN.CORNELL.EDU> hsgj@batcomputer.TN.CORNELL.EDU (Dan Green) writes:
>I would like to have the user enter a filename from my C program.
>I have been looking at Requesters, but it appears that they are
>only used for yes/no input.

I too found the documentation a little unclear about this when I first
read it, but you have misunderstood whatever they were TRYING to say.

The AutoRequest() function does indeed allow easy yes/no or ok/cancel type
of Boolean requesters, but application-defined ones can have any gadgets and
images, etc they like on them.  So for a filename, you would probably put a
string gadget on it, and maybe display the directory in the requester's
rastport (easy, but icky) or via one huge gadget, or many filename sized
gadgets (hard).

>So the only way I can think of requesting a filename is to
>generate a window that is one text line high, and attach a console
>to it in raw mode.  Then I would just watch the input of the usre,
>and when I see a CarriageReturn then I would have the filename, and
>could close the window.  This seems like a lot of work, especially
>since I would probably have to do my own backspace and ^X processing.

It might be a lot of work, but believe it or not, it's far more flexible
for the program, although I know this comment dismays C-A who are trying
to get developers to use requesters.  I personally find requesters amazingly
time consuming to develop (all those damned structures) and the fact that
they block input to the window, the string gadgets aren't active --to mention
a few gripes-- are why I dislike requesters.  But HEY, these things ARE
fixed in 1.2 if you want to develop under that.

        Hope this helps,
                Paul Higginbottom

Disclaimer: I do not work for Commodore and my opinions are at least my own.