Re: Events in custom widgets
- Date: Thu, 14 Jan 2016 09:06:22 +0100
- From: Nicola Fontana <ntd@xxxxxxxxx>
- Subject: Re: Events in custom widgets
Il Thu, 14 Jan 2016 08:41:46 +0100 Jozef Molnar <jv.molnar@xxxxxxxxxxxxxx> scrisse:
> Dear subscribers,
> I want to create a custom widget derived from either GtkDrawingArea or
> GtkLayout (still do not know, which is better for my purpose - I need some
> Nevertheless, if I derive my widget from GtkDrawingArea, I can draw using
> Cairo (the draw callback gets called) but I cannot receive mouse events. I
GtkDrawingArea *can* handle mouse events. From its documentation:
To receive mouse events on a drawing area, you will need to
enable them with gtk_widget_add_events().
so I suspect you are missing that call in your testing code. E.g.
enables you to connect a callback to the "motion-notify-event"
signal of your drawing area.
gtk-list mailing list