Skip to content

Commit

Permalink
IDE: Let Drag and Drop work on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
sonoro1234 committed Oct 3, 2019
1 parent 37f289a commit ef4e8f2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lua2SC/lua/ide/ide.lua
Original file line number Diff line number Diff line change
Expand Up @@ -399,18 +399,29 @@ frame:Connect(wx.wxEVT_TIMER,
end)
wakeupidletimer:Start(30,false)
--]]
--[[
-- wrap into protected call as DragAcceptFiles fails on MacOS with
-- wxwidgets 2.8.12 even though it should work according to change notes
-- for 2.8.10: "Implemented wxWindow::DragAcceptFiles() on all platforms."
pcall(function() frame:DragAcceptFiles(true) end)
frame:Connect(wx.wxEVT_DROP_FILES,function(evt)
print"DragandDrop"
local files = evt:GetFiles()
if not files or #files == 0 then return end
for i,f in ipairs(files) do
LoadFile(f,nil,true)
end
end)
--]]
frameDropTarget = wx.wxLuaFileDropTarget();
frameDropTarget.OnDropFiles = function(self, x, y, filenames)
for i = 1, #filenames do
LoadFile(filenames[i], nil, true)
end
return true
end
frame:SetDropTarget(frameDropTarget)

managedpanel = wx.wxPanel(frame, wx.wxID_ANY)

manager = Manager()
Expand Down

0 comments on commit ef4e8f2

Please sign in to comment.