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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
15 matches
Mail list logo