Re: Events in custom widgets
- From: Nicola Fontana <ntd entidi it>
- To: Jozef Molnar <jv molnar googlemail com>
- Cc: gtk-list gnome org
- Subject: Re: Events in custom widgets
- Date: Thu, 14 Jan 2016 09:06:22 +0100
Il Thu, 14 Jan 2016 08:41:46 +0100 Jozef Molnar <jv molnar googlemail com> 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
advice).
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
Hi Jozef,
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.
gtk_widget_add_events(drawing_area, GDK_POINTER_MOTION_MASK);
enables you to connect a callback to the "motion-notify-event"
signal of your drawing area.
Ciao.
--
Nicola
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]