> I've just searched Articles&FAQs and for some keywords in fltk.general
> but haven't found what I was looking for, so I'll ask here.
>
> I remember that a couple of years ago, one of the regular posters (such
> as dzimmer or cableguy perhaps?) described a system of using fluid to
> provide the bare-bones for a class, but doing the actual implementation
> in normal .h and .cxx files using a standard editor and then marrying the
> two together.
>
> Rather than reinvent the wheel, could someone help refresh my memory?
>
> Cheers
> Duncan
>
> I've been away from doing real program development with fltk for a few
> years and want to get back into it. Unfortunately my old fltk sandboxes
> have bitten the dust during several system reinstallations and I can't
> refer to the various experiments I tried with developing with fluid.
>

The simplest case:

Assuming you have a class, MyClass, that does what you want, the easiest way to 
connect it to an fltk GUI is to add a pointer to it (*pMyClass) as a member 
variable of the fluid-generated UI class.

Fluid automatically sets the user_data_ of a window to the UI class (MyUI), so 
from any callback, the following approach works.

((MyUI*)o->window()->user_data())->pMyClass->do_stuff(o->value())

You will also need to #include "MyClass.H" as extra code in fluid.

Don.





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

Reply via email to