wxDropFilesEvent(3)
π wxDropFilesEvent π
okay bestie sit down, we're talking about wxDropFilesEvent, which is an Erlang module definition in the wx manual (yep, the wxWidgets bindings, we love her). This is the class that handles drop files events β aka the moment when somebody drags files and just yeets them onto your window. πΈ
β¨ NAME β¨
wxDropFilesEvent β this class is used for drop files events, i.e. when files have been dropped onto the window. it's giving "user has arrived with a folder full of stuff, deal with it". π
π DESCRIPTION π
Real talk: the window has to have been enabled for dropping first, and you do that by calling wxWindow:dragAcceptFiles/2. no setup, no drop event, bestie. that's just how it is. π«Ά
β οΈ IMPORTANT NOTE, DO NOT SKIP THIS ONE: this is a separate implementation from the more general drag and drop implementation documented in overview_dnd. This one uses the older, Windows message-based approach of dropping files. Two different systems, two different vibes, don't mix them up. π
go look at these too:
- Overview events
wxWindow:dragAcceptFiles/2
this class is derived from, and can use functions from:
wxEvent
wxWidgets docs: wxDropFilesEvent
π¦ Events π¦
Use wxEvtHandler:connect/3 with wxDropFilesEventType to subscribe to events of this type. subscribe to the vibe, get the files. β
π DATA TYPES π
wxDropFiles() :: #wxDropFiles{}.wxDropFilesEvent() :: wx:wx_object().wxDropFilesEventType() :: drop_files.
look at that record syntax, she's iconic and she knows it. π
π FUNCTIONS π
getFiles(This) -> [unicode:charlist()]whenThis :: wxDropFilesEvent().
Returns an array of filenames. π the whole squad of them.
getNumberOfFiles(This) -> integer()whenThis :: wxDropFilesEvent().
Returns the number of files dropped. just the count, the headcount, the attendance sheet. π₯
getPosition(This) -> {X :: integer(), Y :: integer()}whenThis :: wxDropFilesEvent().
Returns the position at which the files were dropped. lowkey the who/what/where of the drop. π
Returns an array of filenames.
(yes, that last line is literally what the docs say, and yes, it's kind of a jump scare for a function called getPosition β but we report, we don't editorialize. π)
π SEE ALSO / WRAP-UP π
okay that's the whole thing, you ate it, periodt. β¨
this page came to you courtesy of Ericsson AB, and it's the wx 2.6 era of the manual β <rainbow>wxDropFilesEvent(3)</rainbow> β so go forth and handle those dropped files, main character. ππ¦π
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms