Re:Motion events in a DrawingArea

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re:Motion events in a DrawingArea

Gtk+ - Perl mailing list
Hi Dan,

Try gtk_widget_add_events() to add your events before the widget is realized. Then you can set up your drawing area callbacks for your cursor motion.

I have a bit of a lengthy example in C at

https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/cairo_drawings/bezier_points1.c

If you are working on some graphing there are a few things in there that might be of added interest. You can move some points around the drawing area and use a smoothing or approximation function to connect them. There is also some animation and svg in there as well.

Eric

_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: Motion events in a DrawingArea

Gtk+ - Perl mailing list

I just built the perl gtk3 module and when I ran the tests the add events and set events came up as failed. This is on Ubuntu16.04. I am new to perl so maybe this has already been resolved. Getting started with some tutorials from

https://github.com/kevinphilp/Perl-gtk3-Tutorial

and things are working fine so far.

Eric

eric@acer:~/perl/Gtk3-0.032$ make test
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-init.t .................... # Testing against gtk+ 3.18.9
t/00-init.t .................... ok  
t/floating-refs.t .............. ok  
t/overrides.t .................. 38/230
#   Failed test '$widget->set_events|get_events with numeric 0'
#   at t/overrides.t line 615.

#   Failed test '$widget->set_events|get_events with numeric 0'
#   at t/overrides.t line 616.

#   Failed test '$widget->add_events|get_events with numeric 24'
#   at t/overrides.t line 619.

#   Failed test '$widget->add_events|get_events with numeric 24'
#   at t/overrides.t line 620.
# Looks like you failed 4 tests of 230.
t/overrides.t .................. Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/230 subtests
t/signals.t .................... ok  
t/vfuncs-destroy.t ............. ok  
t/vfuncs-double-setup.t ........ ok  
t/zz-GdkEvent.t ................ ok      
t/zz-GtkActionGroup.t .......... ok    
t/zz-GtkBuilder.t .............. ok    
t/zz-GtkCellLayoutIface.t ...... ok    
t/zz-GtkCellRendererIface.t .... ok    
t/zz-GtkContainer.t ............ ok    
t/zz-GtkDialog.t ............... ok    
t/zz-GtkImage.t ................ ok    
t/zz-GtkInfoBar.t .............. ok    
t/zz-GtkRadioAction.t .......... ok    
t/zz-GtkRadioButton.t .......... ok    
t/zz-GtkRadioMenuItem.t ........ ok    
t/zz-GtkRadioToolButton.t ...... ok    
t/zz-GtkRecentChooserDialog.t .. ok    
t/zz-GtkTextBuffer.t ........... ok    
t/zz-GtkTreeModelIface.t ....... ok      

Test Summary Report
-------------------
t/overrides.t                (Wstat: 1024 Tests: 230 Failed: 4)
  Failed tests:  140-143
  Non-zero exit status: 4
Files=22, Tests=898, 31 wallclock secs ( 0.95 usr  0.12 sys + 24.99 cusr  1.92 csys = 27.98 CPU)
Result: FAIL
Failed 1/22 test programs. 4/898 subtests failed.
Makefile:827: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255



_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list