on_*_event return



Some widget event handler functions return a boolean value.
on_expose_event is one. I think the return value is supposed to tell the
caller whether this widget handled the event or not. What exactly does
it mean to handle the event?

For example, I have an on_expose_event function set up for my widget
that is subclassed from DrawingArea. It only does something if the
widget is realized, so I put everything in an if(is_realized()) { ... }
block. So should I return false if the widget is not realized when this
function is called? Or is the widget considered to handle the event, but
it just happens to not do anything?

Are there any rules of thumb for when to return true versus false in
these cases?

Thanks.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]