The cool thing about Gtk2 is it is designed properly.... most widgets have an eventbox built-in. A word of caution about pixel-zooming...... it will not save as zoomed, unless you grab a screenshot.
#!/usr/bin/perl use warnings; use strict; use Gtk2 '-init'; use Gnome2::Canvas; my $window = Gtk2::Window->new; $window ->signal_connect( 'destroy' => \&delete_event ); my $canvas = Gnome2::Canvas->new(); $canvas->set_size_request(256,256); $canvas->set_scroll_region(0,0,256,256); my $root = $canvas->root(); my $item = Gnome2::Canvas::Item->new($root, "Gnome2::Canvas::Ellipse", x1 => 0, y1 => 0, x2 => 200, y2 => 180, fill_color=>"red", outline_color=>"black" ); $item->signal_connect(event=>sub {print "I got an event!\n"; }); $canvas->signal_connect (event => \&event_handler); $window->add ($canvas); $window->show_all; Gtk2->main; ###########################################################3 sub event_handler{ my ( $widget, $event ) = @_; print $widget ,' ',$event->type,"\n"; if ( $event->type eq "button-press" ) { print 'x->',$event->x,' ','y->',$event->y,"\n"; } } sub delete_event { Gtk2->main_quit; return 0; }

I'm not really a human, but I play one on earth CandyGram for Mongo

In reply to Re^3: geoTiff Application Building by zentara
in thread geoTiff Application Building by deadpickle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.