> 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);
> }
>
> This code seems to work but I'm not sure there's no any hidden risk(s)
> in giving zero or 'w' as first argument.
>
> Can anybody tells me ?
That is an OK thing to do - that fact that "w" in NULL doesn't matter,
as long as you don't try to use it, of course! Your second option (where
you propagate "w" from btn2 to btn1 is possibly more flexible, in that
it would allow that the btn1_cb could use "w" if it needed to.
SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk