home *** CD-ROM | disk | FTP | other *** search
- export int Dropped(string file)
- {
- string query = Sprintf("Open %s\ninto a new buffer or\ninsert it at current position?", file);
- int ret;
- ret = Request(query, "AppQuery", "New|Insert");
- if(ret) {
- int id = New();
- int before = GetBufferID();
- CurrentBuffer(id); /* make it the current */
- if(0>Load(file)) {
- Kill(id); /* failed loading */
- } else {
- CurrentBuffer(id); /* make it the current */
- Activate(id); /* popup a view */
- }
- }
- WindowToFront();
- return ret; /* stop the insert operation if "load" was answered! */
- }
- Hook("IconDrop", "Dropped");
-