On 19.10.2011 03:47, David wrote:
> 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?

Hmm, I don't know whether I understood everything you wrote
(e.g. what is a class that is detached from the app, and how
would it access the main window, if ...?).

Anyway, FLTK (and to my knowledge more or less all GUI toolkits)
are designed to be event-driven, i.e. all activity is always
started by the user or other external events like file or socket
activities, timers, etc. that the toolkit can observe somehow.

If you want to do something that is really low-level, then you
must derive your own class and use the handle() method to do
what you want to do. In your case, this would probably mean to
do some IPC with another process (program) to exchange data
(status information). There's nothing FLTK can do for you in
this area.

However, if you only want to get some less specific information
from the widget, then callbacks might be sufficient. Again, all
you need to do to exchange informations with other apps is up to
you (no direct support withing the GUI toolkit FLTK).

So, to answer your last question more directly: There is no
way in FLTK to detect clicks on widgets from outside of the
application, unless the FLTK app itself detects them (maybe
in handle()) and sends the information to the external app.

But maybe I misunderstood your question completely...

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

Reply via email to