> Greg wrote:
> >> Ya, I wasn't sure what the purpose of recording the event
> >> value was, or why the timer callback didn't just directly
> >> call dnd_open(), ie:
>
Ian wrote:
> IIRC, Alvin wanted to pop a confirmation dialog box, and doing that in
> the callback was messing with the DnD badly - so the timeout was a way
> to handle the DnD then pop the dialog safely outside the callbacks
> context.
Right, it's clear the why the timer was needed.
I just wasn't sure why the indirection through the widget's
own callback was needed.
Alvin wrote:
> I think calling dnd_open() directly prevents having
> multiple Fl_DND_Box widgets in the same app since the callback is static?
> For example, I have an app where I have two Fl_Scrolls. Each scroll has its
> own Fl_DND_Box. This way I can load a file in each using DND.
Yes, I think I see what you're after; reusability.
(I was thinking of the app as a demo instead of an actual widget.)
Yes, for the widget to be reusable, it's good to use the widget's
callback() so that the user can just set the callback on a per-widget
basis to handle the drop as it needs. Makes sense.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk