[Gtk-sharp-list] Label not responding to mouse clicks

Christopher David Howie me at chrishowie.com
Tue Sep 14 02:01:26 EDT 2010

On 09/13/2010 11:15 PM, Agro Rachmatullah wrote:
> Hello. I tried to make a program that outputs text to a console when
> a label is clicked.

Labels have no window of their own; they paint text on their parent
window.  Therefore, the label cannot receive mouse events, since there
is no window on which to capture such events.

You can fix this by wrapping the Label widget in an EventBox widget.
Then attach your handler to the EventBox instead of the Label.

Chris Howie

If you correspond with me on a regular basis, please read this document:

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5


This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.

More information about the Gtk-sharp-list mailing list