Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: yakumo9275 on February 08, 2012, 04:59:18 PM

Title: file requestor? file list?
Post by: yakumo9275 on February 08, 2012, 04:59:18 PM
I need to add a fille requestor to my app, and I'm going through the intuition manual, it glosses over requestors, googling amiga file requestor does not bring up much at all.

is there an easy way to pop up a box that gives basic file open/request info? I see the same stock type things in any amiga app that does a menu file open type action.

maybe I am not looking in the correct places.

maybe a requestor is not what I want....
Title: Re: file requestor? file list?
Post by: Leffmann on February 08, 2012, 05:16:07 PM
No handy features in either Kick 1 or WB 1, you have to build the whole requester yourself, but in Kick 2 you have the gadtools.library to make that task easier, and as part of WB 2 you have asl.library which can open a complete file requester for you.

There's also the good old reqtools.library on Aminet which can open requesters for you, and should work fine on all Amigas IIRC.
Title: Re: file requestor? file list?
Post by: Thomas on February 08, 2012, 06:28:47 PM
arp.library offers a file requester for kick 1.x along with a lot of other useful functions.
Title: Re: file requestor? file list?
Post by: eb15 on February 08, 2012, 06:47:28 PM
asl file requesters are standard part of AmigaOS 2.x and above.  Before that people used reqtools or otherwise rolled their own file requesters.
Title: Re: file requestor? file list?
Post by: yakumo9275 on February 09, 2012, 02:26:57 AM
I'll be using wb3.1. I'm testing with uae with kick2 on a 'a2000' esque bare bones wb3.1 and an a1200 kick3 wb3.1 style with supped up install.

might have to see if I can find some public domain code or something that close to what I  need... time to dig into fred fish disks...
Title: Re: file requestor? file list?
Post by: Leffmann on February 09, 2012, 01:43:28 PM
Here's a very basic example for ASL, you can find all the details in the RKRM Libraries 3rd edition:

Code: [Select]

#include <stdio.h>
#include <libraries/asl.h>
#include <proto/exec.h>
#include <proto/asl.h>

struct Library* AslBase;

int main()
{
  AslBase = OldOpenLibrary(&quot;asl.library&quot;);

  if(AslBase != NULL)
  {
    struct FileRequester* req = AllocAslRequest(ASL_FileRequest, NULL);

    if(req != NULL)
    {
      AslRequest(req, NULL);
      printf(&quot;%s/%s\n&quot;, req->fr_Drawer, req->fr_File);
      FreeAslRequest(req);
    }

    CloseLibrary(AslBase);
  }

  return 0;
}
Title: Re: file requestor? file list?
Post by: Piru on February 09, 2012, 02:44:45 PM
Quote from: Leffmann;679956
Here's a very basic example for ASL, you can find all the details in the RKRM Libraries 3rd edition:

Code: [Select]

  AslBase = OldOpenLibrary(&quot;asl.library&quot;);

I know this is irrelevant for this requester usage, but OldOpenLibrary has been obsolete for some time now, and even fails with the latest OS versions. You should use OpenLibrary("asl.library", 0) instead.
Title: Re: file requestor? file list?
Post by: bbond007 on February 27, 2012, 11:57:57 PM
Quote from: yakumo9275;679837
I need to add a fille requestor to my app, and I'm going through the intuition manual, it glosses over requestors, googling amiga file requestor does not bring up much at all.

is there an easy way to pop up a box that gives basic file open/request info? I see the same stock type things in any amiga app that does a menu file open type action.

maybe I am not looking in the correct places.

maybe a requestor is not what I want....


I don't know if this is something you are still looking for or not, but I ran across this example and for a file window and I used it in an application I'm working on. It works perfectly for my app. I'm trying to keep it simple and small for my Minimig 1.1 and my application runs in LORES.... so you may hate the requester and making it "pretty" it may be more trouble than its worth...

I added a BOOL option to disable the SAVE/DELETE option and to accomplish that I just altered the NextGadget property of the LOAD gadget. Very simple.

http://aminet.net/package/dev/c/ACM