From: Reini U. <ru...@x-...> - 2006-03-11 23:40:51
|
2006/3/9, Jeremy White <jez...@ho...>: > >And I wonder if we should not support a higher level interface, by filli= ng > >the needed properties of this object on creation, with the files > >and the mousepoint automatically. > >Then none of the 4 DragDrop functions would be needed and the > >event would be much simplier to use. > > Yeah, I think that would be a better interface - how "easy" would that be= to > implement? I just did that for the CustomDraw object, which passes a struct to the event, which really should be accessed as tied object, a la WindowProps. When I got that finished, I will port DragDrop to pass such an object to the event also. The main XS machinery is already there. CreateObjectbyHandle() ... It's very easy to make terrible mistakes in the XS part. Devel::LeakTrace helps. I don't like leaks in MessageLoop events. > In the end I guess you would end up with an event handler like: > > sub { > my $xpos=3Dshift; #the X cor of the mouse when dropped > my $ypos=3Dshift; #the Y cor of the mouse when dropped > foreach $myfile (@_) { > #for each file dropped on the window > ... > } > } No, more like: -onDragDrop =3D> sub { my ($win, $drag) =3D @_; # dragged to win print "Mouse: ", join(", ", $drag->MousePosition), "\n"; print "Files: ", join(", ", $drag->Files), "\n"; } -- Reini Urban http://phpwiki.org/ http://spacemovie.mur.at/ http://helsinki.at/ |