Greg Ercolano wrote:

> Alvin wrote:
>> widgettable source:
>> http://seriss.com/people/erco/fltk/Fl_Table/widgettable.cxx
>> 
>> Everything is working except I am unable to show the selected row. I
>> think it has to do with some kind of redraw() issue.
> 
> Can you send the complete compilable code?
> Hard to tell from snippets.
> 
> Do you find if you resize the window a little it redraws correctly?
> If so, try to tell the window() to redraw, eg. window()->redraw();

Yeah, resizing the window does redraw correctly. For an example of what I
mean, in widgettable.cxx::draw_cell() replace:

   case CONTEXT_CELL:
      return;           // fltk handles drawing the widgets

with:

   case CONTEXT_CELL:
   {
      Fl_Widget *cell = child(R*cols() + C);

      if(row_selected(R))
      {
         printf("R: %d C: %d selected\n", R, C);
         cell->color(FL_YELLOW);
      }
      else
         cell->color(color());

      cell->redraw();
   }
   return;              // fltk handles drawing the widgets

It appears that the widget's are intercepting the mouse click, however,
row_selected(R) is returning true which means the color() of cell is being
set to FL_YELLOW.

To get the yellow to show I have to do one of the following:
1. Double click the row
OR
2. Single click on a row, then minimise and restore the window

I am experiencing this on openSUSE 10.2, using KDE and fluxbox.
-- 
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to