>
> Rather than using fluid to build your UI, maybe you can build it
> programmatically, and also keep an array of pointers to all your
> widgets, like...
>
> Fl_Widget *widget_array[200];
> int idx =3D 0;
> :
> :
> Fl_Button *bt1 =3D new Fl_Button(....
> widget_array[idx++] =3D (Fl_Widget *)bt1;
> :
> :
>
> Then your set_widget(130, 50); would perhaps become something like...
>
> set_widget(int id, float val) {
> widget_array[id]->value(val);
> }
>
In fact you can combine this approach (array of widgets) with FLUID.
I have similar problem. I have to put 12 functional keys on screen.
I use fluid, but I arrange them in an array of buttons.
The idea is: use fluid, define and arrange whatever you want, then:
1. make a following 'public' Declaration (I mean "Declaration" from box with
fltk widgets): "fltk::Button *myBottons[12];" (put text without quotes into
textbox).
2. For every button go to its C++ tab an write "myBottons[?] = o;" where ? is
the number of button, and 'o' is a letter 'o' which is used when fluid
generates instance of your object (see generated code).
BTW this could be done easily if you do that for one button, save fl file and
then edit it manually with any text editor, addaing similar definitions for
other buttons.
Then all you need is to use myButtons array.
In this example I describe my solution for 12 buttons. In your case you have to
change it for your widgets.
I use fltk 2, but in my opinion this is applicable to fltk 1.x too.
regards
George
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk