|
|
Hi Sanel,
yes, it works for me now, and is much simpler as well :-) Lotsa thanks !!!
I also discovered the articles here on FLTK.org about callbacks - quite interesting that it seems there are quite a few ways to do this!!
Best,
Bjørn
> > As a test, and to learn about FLTK and classes, I am trying to make a
> > dial that control a value input - very simular to the "adjuster" example
> > (part of the FLTK distribution), except that I have put the interface
> > into a class..... >
> Hi,
>
> Here is probable solution.
>
> For example if we have:
>
> Fl_Dial *tempo_dial;
> Fl_Value_Input *tempo_input;
>
> then:
>
> tempo_dial->callback(dial_cb, tempo_input);
>
> where dial_cb is:
>
> void dial_cb(Fl_Widget*, void* ti)
> {
> Fl_Value_Input* tempo_input = (Fl_Value_Input*)ti;
> tempo_input->value(some_global_value);
> }
>
> Now, displayed value inside Fl_Value_Input is controlled by Fl_Dial.
> 'some_global_value' can be set/changed inside dial_cb or somewhere else.
>
> Works ?
[ Direct Link to Message ] | |
|
| |