diff --git a/src/gd_v_express.erl b/src/gd_v_express.erl index d925fe6..2efd23e 100644 --- a/src/gd_v_express.erl +++ b/src/gd_v_express.erl @@ -227,6 +227,8 @@ init({Prefs, {Selected, Keys}}) -> end, ok = gd_v:safe_size(Frame, NewPrefs), + ok = wxPanel:dragAcceptFiles(Panel, true), + ok = wxPanel:connect(Panel, drop_files), ok = wxFrame:connect(Frame, command_button_clicked), ok = wxFrame:connect(Frame, command_choice_selected), ok = wxFrame:connect(Frame, close_window), @@ -297,6 +299,9 @@ handle_event(#wx{event = #wxCommand{type = command_choice_selected}}, State) -> handle_event(#wx{event = #wxCommand{type = command_listbox_doubleclicked}}, State) -> NewState = do_dl(State), {noreply, NewState}; +handle_event(#wx{event = #wxDropFiles{files = Files}}, State) -> + NewState = do_drop(Files, State), + {noreply, NewState}; handle_event(#wx{event = #wxClose{}}, State) -> ok = do_close(State), {noreply, State}; @@ -432,6 +437,14 @@ do_dl(State) -> State. +do_drop([Path], State) -> + ok = tell(info, "Path: ~ts", [Path]), + State; +do_drop(Paths, State) -> + ok = tell(info, "Paths: ~tp", [Paths]), + State. + + do_ul(State) -> ok = tell(info, "Would do_ul."), State.