FLTK logo

Re: Callback trouble

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Callback trouble Anonymous Apr 28, 2006  
 
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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.