I've been playing around with this because it's something I'll want too.
(And I found this thread in the mail-archive.com web site so I don't know if 
this reply will put this in the thread where I want it to go because I have no 
header, only a subject line.)

function Main()
  FRAME=wx.wxFrame(wx.NULL,-1,"Drag And 
Drop",wx.wxDefaultPosition,wx.wxSize(200,100),wx.wxDEFAULT_FRAME_STYLE)
  FRAME:DragAcceptFiles(true)
  FRAME:Centre()  FRAME:Show(true)
  FRAME:Connect(wx.wxEVT_DROP_FILES,DragDrop)
end

function DragDrop(E)
  local P,F,L=E:GetPosition(),E:GetFiles()
  L="Files dropped at "..P.x..","..P.y..":\n\n"
  for _,f in ipairs(F)  do
    L=L..f.."\n"
  end
  print(L)
end

Main()


That's a complete working example, unlike the one I saw, and it also adds a get 
position example for the drop.

There's definitely something wrong though, if you run this and drag a lot of 
files, some bizarrely large co-ordinates are reported, and sometimes it will 
even crash wxLua (Shell32.dll in W98 SE running W95 shell, (W98-Lite)). I can 
repeat the errors but I have no idea what it is about the file names or file 
counts, or positions on screen, or anything else that might be causing the 
trouble. It seems to work fine for up to ten files or so.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to