Re: Scrollable Table Not Rendering Child Widgets Correctly
Greg Ercolano
Jun 11, 2021
On Friday, June 11, 2021 at 4:04:08 PM UTC-7 caroli...@gmail.com wrote:
Hello all,
I'm experiencing an issue when using the table widget. If you add enough widgets to make the table widget turn into a scrollable table, then it seems like the buttons do not render correctly. When you push on a button in the table, the button seems to redraw in the correct location.
Steps to reproduce:
Create a Table Widget
Put enough buttons in it to make the scroll bars appear
Click on the buttons in the table
I think most of us can't read rust, but offhand it looks like you're creating the buttons in the table's draw code which I wouldn't recommend: the table's draw function only triggers for visible items, and are called repeatedly during redraws.
Please look at the example program examples/table-as-container which creates button and input widgets that extend beyond the window borders, where scrollbars appear and work normally during scrolling and column/row resizing.
Note that you may not actually NEED an Fl_Table widget if you're just making one widget per 'cell' in the table. You could just use an Fl_Scroll and create the table of buttons in the needed positions and that should work fine. You might only need an Fl_Table if you need e.g. resizable rows/columns or something.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.