|
|
FWIW, I could not resist to convert Greg's example to use the new (still alpha) Fl_Grid widget rather than a normal Fl_Group - which was more meant as a test for Fl_Grid rather than to help with the original problem. However, since it works well, here's the relevant code part with Fl_Grid :
// Create a grid that we want to be inside the item
Fl_Grid *grid = new Fl_Grid(0, 0, 110, 25);
grid->layout(1, 4, 0, 0);
// X Y W H L
// - - -- -- ----
Fl_Button *b1 = new Fl_Button(0, 0, 60, 20, "B1"); b1->labelsize(8);
Fl_Button *b2 = new Fl_Button(0, 0, 30, 20, "B2"); b2->labelsize(8);
grid->end();
grid->box(FL_FRAME); // give the grid a border so we can see its edges
// Assign the buttons to the grid
// widget, R, C, Span, Alignment
grid->widget(b1, 0, 0, 1, 2, FL_ALIGN_LEFT | FL_GRID_VERTICAL);
grid->widget(b2, 0, 3, 1, 1, FL_ALIGN_RIGHT | FL_GRID_VERTICAL);
// Assign the grid (with its children) to the item
myitem->widget(grid);
... and a screenshot:
The full code can be viewed and tested by pulling from my development fork, branch Fl_Grid in file test/grid_in_tree.cxx. Note that this is alpha software and work in progress. Widget and cell resizing code is not yet complete. See also #256.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
[ Direct Link to Message ] | |
|
| |