> It doesn't appear that the way fltk is designed that you could ask a widget 
> during a wait loop if it was clicked, double clicked, etc..   So right now, I 
> just have a call back that sets a global structure that flags the widget and 
> type of click, then at the end of the wait loop, the structure is cleared.  
> That is fine for that, but now I have something that I need to add taht is 
> detached from the app, a class that gets passed x,y,w,h area available for it 
> and the buttons the main window has, it has to be able to determine when they 
> are clicked, if the widget held the click state, it be easy, but the only way 
> I see now is for me to have to pass the click structure too.  How is fltk 
> designed to work for deteting clicks when you only know the widget?


Essentually converting a framework that has an event loop (like an fltk wait 
loop) from which can you can query the widgets if clicked, if doubleclicked, if 
changed, if checked, etc..   I have versions for Windows too which of course 
use callbacks with case statement that makes it clear what has happened.  Just 
easier to convert from the other framework since it's much closer to what fltk 
does.  I can make this work by just using the callback data item as the 
structure, then passing that on to the external class which could then check 
the Widget member and click count (1 or 2) to know if it was clicked or double 
click.   Maybe in fltk3 they may want to think about holding a click state on 
widgets that cleared on each wait(); (could be a window level structure 
containg widget and click state and widget->is_clicked() checks with parent 
struct (pointer value/click state) so that clearing is done easily / fast on 
wait();.


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to