Proposal for "Gtk_FileDrop"

» Metadata » Status
» Description
The class provides an easy way to equip Gtk widgets with file drop functionality. One can specify a list of mime types and file extensions which shall be accepted, and when a drop occurs the file name will be put in the text field of the widget. Additionally, it is possible to specify a callback which is run when the drop with accepted files has happened.

It all comes down to just one line, and the class handles the rest:
Gtk_FileDrop::attach( $widget, array( 'text/plain', '.dat'));
» Dependencies » Links
  • MIME_Type
» Timeline » Changelog
  • First Draft: 2004-10-18
  • Proposal: 2004-10-18
  • Call for Votes: 2004-10-25
  • Christian Weiske
    [2004-10-21 11:11 UTC]

    I changed some things according to Alan's and Scott's comments:
    - Fixed some PEAR CS issues
    - renamed factory method from "prepareFileDrop" to "attach"
    - instantiating an object now instead of using static calls only (for the callback, all other static functions make sense statically)