When I look at Fl_Table::handle(), I see this...case FL_UNFOCUS:
_stop_auto_drag();
ret = 1;
break;which makes me think it is handling the FL_UNFOCUS event and not passing it down -- which would mean I should over-ride handle(), take care of FL_UNFOCUS and then call Fl_Table::handle() for everything else.Or, perhaps the FL_UNFOCUS handling here should also call damage_zone() by default.Am I missing something? Is there a better way to get the spreadsheet to redraw when losing focus?
On 6/12/24 16:57, Rob McDonald wrote:
When I look at Fl_Table::handle(), I see this...case FL_UNFOCUS:
_stop_auto_drag();
ret = 1;
break;
which makes me think it is handling the FL_UNFOCUS event and not passing it down
No -- not true.
I think you're missing what's at the top of the
Fl_Table::handle() method:
_____________________________________________
/**
Handle FLTK events.
*/
int Fl_Table::handle(int event) {
PRINTEVENT;
int ret = Fl_Group::handle(event);
// let FLTK group handle events first
[..]
_____________________________________________
It lets children handle all the events first.
-- which would mean I should over-ride handle(),
take care of FL_UNFOCUS
..and FL_FOCUS, yes.
and then call Fl_Table::handle() for everything else.
Or, perhaps the FL_UNFOCUS handling here should also call damage_zone() by default.
Well, because you're changing the look of the widget during
focus changes,
then you should called damage() or redraw().
Fl_Table's default behavior does not change its appearance
during focus changes, so it's default behavior should not call
damage() or redraw() unless it did.
In your case, since you're adding behavior that changes the
appearance on focus changes, it makes sense you should also
trigger damage or redraw.
Am I missing something?
Is there a better way to get the spreadsheet to redraw when losing focus?