Aw: Motion events in a DrawingArea

Dear Dan,
I think the simplest solution would be to use my GooCanvas2 module (see ). The module works exactly as the C Api (it's a pure Glib::IO binding). Therefore is a good starting point... Especially the GooCanvas2::CanvasItem has an item press event and such things:
Perhaps this is helpful...
The Gtk3 canvas element (from which I think DrawingArea inherits its painting capabilities) is hard to handle for event purposes...
Best wishes,
Gesendet: Mittwoch, 16. August 2017 um 14:12 Uhr
Von: "Daniel Kasak" <d j kasak dk gmail com>
An: "gtk-perl mailing list" <gtk-perl-list gnome org>
Betreff: Motion events in a DrawingArea
Hi all.

I'm trying to capture mouse events in a DrawingArea ( in Gtk3 ). I'm
adapting code at ... but when
I go:

[ qw/ exposure-mask

... I get a warning:

Gtk-CRITICAL **: gtk_widget_set_events: assertion
'!_gtk_widget_get_realized (widget)' failed

I've tried putting this later on in the code when I guess the widget
*should* be realized, eg at the end of the render_graph() method which
I hook up thus:

$self->{drawing_area}->signal_connect( draw => sub {
$self->render_graph( @_ ) } );

... but it still gives the same error.

Next I try to connect to a signal handler anyway:

, sub { $self->handle_graph_mouse_move( @_ ) }

... but this handler never gets called.

I guess things have changed in Gtk3? I haven't been able to find an
updated demo, even in C. Any hints as to what I'm missing?

gtk-perl-list mailing list
gtk-perl-list gnome org

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