Requesters

From Amiga Development Wiki
Jump to: navigation, search

Requesters

The asl.library supports three different requester types: file requester, font requester and screen mode requester.

File requester tags

Control tags

Tag Description
ASLFR_AcceptPattern Accept files matching this pattern.
ASLFR_DoDrawersOnly When set true only drawers are displayed.
ASLFR_DoMultiSelect When set true the user can select multiple files.
ASLFR_DoSaveMode When set true the requester is used for saving.
ASLFR_RejectIcons When set true icon files are not displayed.
ASLFR_RejectPattern Reject files matching this pattern.

Other tags

Tag Description
ASLFR_NegativeText The text for the "Cancel" button.
ASLFR_PositiveText The text for the "OK" button.
ASLFR_TitleText Requester title text.
ASLFR_UserData User data for fr_UserData field.

Example

#include <libraries/asl.h>
#include <proto/asl.h>
#include <proto/dos.h>
 
int main()
{
   struct FileRequester *req = AllocAslRequestTags(ASL_FileRequest, ASL_Dir, "S:", ASL_File, "Startup-Sequence", TAG_DONE);
 
   if (fr)
   {
      if (AslRequestTags(req, TAG_DONE))
      {
         Printf("Selected path:\n%s\n", req->rf_Dir);
         Printf("Selected file:\n%s\n", req->rf_File);
      }
 
      FreeAslRequest(req);
   }
 
   return 0;
}