> Hi,
>
> I'm wondering if calling a callback from another callback
> is a safe thing and what to give exactly as first argument.
[..]

> void MyClass::btn1_cb(Fl_Widget *w, void *data)
> {
>   //some code I'll need in the next callback...
> }
>
>
> void MyClass::btn2_cb(Fl_Widget *w, void *data)
> {
>   MyClass *p = (MyClass*)data;
>   p->btn1_cb(0, data);
>  //or even: p->btn1_cb(w, data);
> }

So long as the body of btn1_cb() isn't doing anything
with its first argument you'll be fine.  You could even
remind yourself by declaring it as
  void btn1_cb(Fl_Widget*, void* data)

Of course, if you *do* look at it, you'll have to pass it
something sensible.

Best,
Stan

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

Reply via email to