home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / TextEditors&Viewers / Texteditors / FFRED10.LHA / fpl / AppQuery.FPL next >
Encoding:
Text File  |  1994-09-22  |  620 b   |  21 lines

  1. export int Dropped(string file)
  2. {
  3.   string query = Sprintf("Open %s\ninto a new buffer or\ninsert it at current position?", file);
  4.   int ret;
  5.   ret = Request(query, "AppQuery", "New|Insert");
  6.   if(ret) {
  7.     int id = New();
  8.     int before = GetBufferID();
  9.     CurrentBuffer(id);    /* make it the current */
  10.     if(0>Load(file)) {
  11.       Kill(id);           /* failed loading */
  12.     } else {
  13.       CurrentBuffer(id);    /* make it the current */
  14.       Activate(id);       /* popup a view */
  15.     }
  16.   }
  17.   WindowToFront();
  18.   return ret; /* stop the insert operation if "load" was answered! */
  19. }
  20. Hook("IconDrop", "Dropped");
  21.