Paul R wrote:
> Can anybody advise on my best approach to implement a 'table' or chart where
> users can select one at a time.
>
> i mean for example imagine a grid of 'buttons'..
I'd suggest using an Fl_Tile and procedurally adding
the buttons to that with a for() loop.
> I avoided just adding individual buttons set in a tile in fluid
> as i thought it would be a bit unwieldly to add say 26 individual
> button objects but then nobody has to read the code anyhow so...
To make lots of buttons in Fluid is easy..
Make a button, set up the callback and all the properties
you want for that button (color, style, etc).
Then select it and hit ^C then ^V. Now you have two buttons
with the same props.
Highlight the two and ^C/^V so that you have four.
Now highlight the four, hit ^C, then repeatedly hit
^V several times, so that you can quickly place
four buttons at a time quickly into a grid.
Then you can hand tweak each button assigning
a different label to each button and let your call back
look at the widget's label() to determine which button was hit.
Or, just use Fl_Tile and a for() loop.
There's other ways too.
> Basically i can think of a few ways to hancode it, just wondered
> if anything i could whip up with fluid would be available,
> maybe this is a case where you would write a little more code
> in the dialog boxes of Fluid itself?
If its only 26 buttons, I'd make em by hand. Similar
to the keyboard test program, which is a fluid hand-laid-out
interface.
You can either position the buttons yourself, or stick
them into a tile if you truly want a 'grid'.
> i take it fluid is not an interpreter so i cannot expect
> to be able to see the objects defined this way appear
> in my design editor view..
Right, but if you set up Alt-G, you'll find the
code/compile/run cycle will be so fast, that you
can type code and see a working program within seconds.
(See the FLTK Fluid video for how to do this)
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk