Re:Motion events in a DrawingArea

2017-08-17 Thread Eric Cashon via gtk-perl-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_point

Re: Motion events in a DrawingArea

2017-08-19 Thread Eric Cashon via gtk-perl-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 thing

Re: Can't position Gnome2::Canvas within Gtk2::Frame

2017-10-07 Thread Eric Cashon via gtk-perl-list
Hi Les, I am not familiar with the Gnome canvas but you could try this using an event box and drawing on that. That might be easier. Eric #!/usr/bin/perl use strict; use diagnostics; use warnings; use Gtk2 '-init'; use Glib qw(TRUE FALSE); # Draw a Gtk2 window my $window = Gtk2::Window->ne

Re: Can't position Gnome2::Canvas within Gtk2::Frame

2017-10-08 Thread Eric Cashon via gtk-perl-list
Well, first time for me using Gnome canvas. Easy apt-get on Ubuntu and your code works. When you call show all on the top level window it goes through the widgets that have been added to it and does a few things for each widget. You can connect to a callback if you need to do or get somet

Re: Very strange issue with multiple drawing areas

2017-10-09 Thread Eric Cashon via gtk-perl-list
Hi Daniel, OK, I am new to Perl and trying to learn a few things myself. I know GTK and C can get grumpy if you don't send your variables in your signal callbacks correctly. So maybe check that the variables in your callback are what you expect with a little test code. Print to screen or use

Re: Drawing Area issues ( continued, with example )

2017-10-10 Thread Eric Cashon via gtk-perl-list
You might be able to just use one drawing area. Then you don't have to worry about creating and destroying drawing areas, surfaces and contexts. When you want to redraw, just "paint" the drawing area background and start drawing. This approach works well for most drawings. Test out the foll

Re: Drawing Area issues ( continued, with example )

2017-10-11 Thread Eric Cashon via gtk-perl-list
Hi Torsten, This is something that I have had some trouble with at the app level. In GTK3, how drawing is done, has changed a bit between minor versions in GTK3. In order to get CSS, transparency, OpenGL and modern drawing techniques working well,,, things have changed. Here is an article

Re: Drawing Area issues ( continued, with example )

2017-10-12 Thread Eric Cashon via gtk-perl-list
Hi Emmanuele, Thank you for the answer here. Very helpful. There is a code comment in gdkinternals.h that says struct _GdkWindow { ... struct { /* The temporary surface that we're painting to. This will be composited * back into the window when we call end_paint. This is our poor-man

Re: Drawing Area issues ( continued, with example )

2017-10-14 Thread Eric Cashon via gtk-perl-list
Hi Dan, The graph axis can be made dynamic so that each graph is different. That way you can show different ranges side by side. I experimented a little with this by setting a couple of array values that hold the number of tick marks on each graph. It is in C. I think that I need a big sc

Re: Drawing Area issues ( continued, with example )

2017-10-15 Thread Eric Cashon via gtk-perl-list
The Energy Monitor is looking good. Eric ___ gtk-perl-list mailing list gtk-perl-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-perl-list

Re: Scaling an image with Gtk2::Gdk::Pixbuf->scale

2017-11-01 Thread Eric Cashon via gtk-perl-list
Hi Les, See if this works better for the cat. Eric #!/usr/bin/perl package scaleme; use strict; use diagnostics; use warnings; use Gtk2 '-init'; use Glib qw(TRUE FALSE); # Display this image my $path = 'cat.png'; # Open a Gtk2 window with a Gtk2::TextView my $window = Gtk2::Windo

Re: Scaling an image with Gtk2::Gdk::Pixbuf->scale

2017-11-01 Thread Eric Cashon via gtk-perl-list
Hi Les, If you put the pixbuf in an image widget and the image widget in an event box then you can get your mouse clicks from the pixbuf. The event box can then be added to the textview widget. Eric ___ gtk-perl-list mailing list gtk-perl-lis

Re: Scaling an image with Gtk2::Gdk::Pixbuf->scale

2017-11-02 Thread Eric Cashon via gtk-perl-list
Try inserting a widget into the textview and capture the clicks on the widget. In this case, an event box with an image widget and pixbuf. Eric #!/usr/bin/perl package scaleme; use strict; use diagnostics; use warnings; use Gtk2 '-init'; use Glib qw(TRUE FALSE); # Display this image my

Re: Scaling an image with Gtk2::Gdk::Pixbuf->scale

2017-11-03 Thread Eric Cashon via gtk-perl-list
It sounds like some tricky layout features for the textview. Maybe wrapping text around images? Not sure how to go about doing this. One thing to try is putting another textview in there with the image. Then you can size it to the image height and could resize it based on the overall window

Re: GooCanvas2 set_transform method seg faults

2020-11-13 Thread Eric Cashon via gtk-perl-list
This may be similar to a problem that I have been having with rotating pattern images. Some current discussion, bug report and code at https://lists.cairographics.org/archives/cairo/2020-November/thread.html What looks to be happening is that pixman is returning NULL for a pattern that has a