Re: gtk-perl-list Digest, Vol 26, Issue 19



Dear Ofey,
I tried what you asked to do, but I got the error messege:
*** unhandled exception in callback:
***   Can't locate object method "get_pixbuf" via package "Gtk2::EventBox" at HPlot.pm line 232, <READ> line 6.
***  ignoring at HPlot.pm line 162, <READ> line 6.

*** unhandled exception in callback:
***   Can't locate object method "get_child" via package "Gtk2::Ex::Graph::GD" at HPlot.pm line 230, <READ> line 6.
***  ignoring at HPlot.pm line 162, <READ> line 6.

The man pages for: Gtk2::Image and Gtk2::Gdk::Pixbuf are properly loaded. I can't understand why I am getting the error messeges.
Plaese Help

On 6/26/06, gtk-perl-list-request gnome org < gtk-perl-list-request gnome org> wrote:
Send gtk-perl-list mailing list submissions to
        gtk-perl-list gnome org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.gnome.org/mailman/listinfo/gtk-perl-list
or, via email, send a message with subject or body 'help' to
        gtk-perl-list-request gnome org

You can reach the person managing the list at
        gtk-perl-list-owner gnome org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gtk-perl-list digest..."


Today's Topics:

   1. Re: Gtk2 perl graph saving (ofey aikon)


----------------------------------------------------------------------

Message: 1
Date: Sun, 25 Jun 2006 13:28:15 -0500
From: "ofey aikon" <ofey aikon gmail com>
Subject: Re: Gtk2 perl graph saving
To: gtk-perl-list gnome org
Message-ID:
        <17dc6b00606251128v4caa4b55xacd47c4c86b12b91 mail gmail com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 6/24/06, Subhrangshu Supakar <ssupakar gmail com> wrote:
>  I am a newbie to Gtk2 perl, Iam not being able to save a graph generated by
> Gtk2::Ex::Graph::GD.

I can tell you how to save the "image" that is being generated.

The $graph->get_image($data) actually gives you a Gtk2::EventBox with
a Gtk2::Image inside it. I took this approach because I wanted the
graph to respond to 'events' (mouse movements etc) and the Gtk2::Image
itself did not do that.

I think what you can do is as follows.

$graph = Gtk2::Ex::Graph::GD(.......);

# Get the Gtk2::Eventbox out
my $eventbox= $graph->get_image($data);

# Now pull the Gtk2::Image from inside the $eventbox.
my $image = $graph->get_child;

# Now I pull the Gtk2::Gdk::Pixbuf from inside the Gtk2::Image
my $pixbuf = $image->get_pixbuf();

# Now I can write that pixbuf to a file
$pixbuf->save($filename, 'jpeg', quality => '100');

But of course, all this just helps you to save the image alone. Once
you revive the image, you will lose the hotspots in the graph etc.

What are you trying to achieve ? If you can give more insight into
your problem, may be I can help more. Please send me an email off this
list.

Regards,

_Ofey.


------------------------------

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


End of gtk-perl-list Digest, Vol 26, Issue 19
*********************************************



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