Welcome, Guest. Please login or register.

Author Topic: file requestor? file list?  (Read 4638 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Leffmann

  • Full Member
  • ***
  • Join Date: Feb 2011
  • Posts: 119
    • Show all replies
Re: file requestor? file list?
« 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.
 

Offline Leffmann

  • Full Member
  • ***
  • Join Date: Feb 2011
  • Posts: 119
    • Show all replies
Re: file requestor? file list?
« Reply #1 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;
}