FLTK logo

[fltk.general] Re: Scrollable Table Not Rendering Child Widgets Correctly

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

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.



--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/e6bb57a0-7852-482f-a79f-356100d566e8n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.