Is this a good design?
<p>Right now, I'm making a Gui Library for games. The Widgets have several callbacks / listeners for various events. </p>

<p>The thing about it is a listener can consume an event.</p>

<p>The issue comes here. The base class is called with event info. It calls the callbacks for the listeners. Any of them can handle the event.</p>

<p>This means it is up to the user to check if the event has been handled or not.</p>

<p>Ex: </p>

<pre><code>void TextBox::MouseClick(MouseEvent &amp;event)
{
   Widget::MouseClick(event);

    if(!event.isHandled())
    {
       //do stuff
    }

}
</code></pre>

<p>The alternative would be to hide this and have onMouseClick(...) which is the virtual one and not called unless the condition is met. I found this to be rather messy though, and annoying for those who make more events.</p>

<p>Is this a good design? If not what might be better to accommodate this?</p>

<p>Thanks</p>
