matthiasm wrote: > > On 02.01.2008, at 15:12, Alvin wrote: > >> Alvin wrote: >> >>> Alvin wrote: >>> >>>> Short of not popping up another window on a FL_PASTE (via DND), >>>> what can >>>> I do? >>> >>> I figured out a workaround/solution. > > You found the correct solution. Not returning from FL_PASTE will > eventually cause the dnd operation to time out, leaving all mouse > states undefined. Also, the timeout is a good method to solve this, > but for clarity, an "idle" callback would do the same as a timeout > with 0.0 time. > >> I would like to write an article with example concerning DND in >> fltk. I >> would like to cover DND receiving first since I think its the >> easiest of >> the two (the other being DND sending) initially understand. I would >> include >> my Fl_DND_Box widget. Would this be useful or should I not bother? > > > Yes, that would be very useful. Although there was a lot of theory > written about DND, you got into a much more practical lesson wich > would be great for everyone else to learn by and from. > > When we wrote the DND code quite a while ago, we saw the the FL_PASTE > shoudl return quickly, but I never anticipated that someone would > open up a dialog during FL_PASTE, so I never warned about the > consequences. I should really add a warning (or your article as a new > chapter when you are done writing it). > > Matthias > > ---- > http://robowerk.com/
Thanks for the confirmation. I will update my code to use add_idle(). Right now I'm in the process of finshing two simply examples. (1) Loading an image into a Fl_Box by using DND from a file browser. When the user "drops" the file only the widget, a prompt will appear asking for confirmation. (2) Moving widgets around in a Fl_Double_Window and dropping them into and removing them from Fl_Groups. I coding is pretty much done, but right now I'm trying to simplify them as much as possible. The 2nd example doesn't really use DND, so I may omit that one. -- Alvin _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

