About the special paste buffer APT DRAGDROP PASTEBUF

Brent Hartwig shows how a copy or cut operation fills the special paste buffer _APT_DRAGDROP_PASTEBUF Last Updated: 2006-09-20

Editor's note by Karl Johan Kleist: Note how Brent uses the undocumented feature "set debug==extwin".

package dragdropbuf; function debug(msg) { msg = caller( 1 ). ": " . msg; eval msg output=*debug; } function getDragDropPasteBufferName { # Try to get this name from Epic. if ( defined( main::AptDragDropPasteBufName ) ) { return main::AptDragDropPasteBufName; } else { return "_APT_DRAGDROP_PASTEBUF"; } } function copyCallback( doc, bufferName, op ) { debug( "buffer name = \"$bufferName\" (op=$op)" ); if ( ( op == 2 ) && ( bufferName == getDragDropPasteBufferName ) ) { debug( "Drag and drop event where source is copied." ); } } function cutCallback( doc, bufferName, op ) { debug( "buffer name = \"$bufferName\" (op=$op)" ); if ( ( op == 2 ) && ( bufferName == getDragDropPasteBufferName ) ) { debug( "Drag and drop event where source is cut." ); } } function initPackage { set debug==extwin; doc_add_callback( 0, "copy", "dragdropbuf::copyCallback" ); doc_add_callback( 0, "cut", "dragdropbuf::cutCallback" ); } initPackage;