Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

goo, imageview, windows, oh my!

by deadpickle (Pilgrim)
on Mar 13, 2009 at 23:50 UTC ( #750546=perlquestion: print w/ replies, xml ) Need Help??
deadpickle has asked for the wisdom of the Perl Monks concerning the following question:

Well I am still creating the same app I have been for a long time. Just a repeat, its an app that loads a geotiff and allows the user to click waypoints.

I use Goo::Canvas because it is easy to draw little icon so that I dont have to make them. Currently I load the geotiff as the background image on the canvas. Now that it loads the geotiff and I can spatially reference it its time to get the goodies working.

I would like to pan and zoom. I have heard that using imageview for this is the best and easiest way. And from the looks of it I would agree. But I am building this program on windows. goocanvas (library) was a pain to install onto windows. And now if I use gtkimageview (required by Gtk2::Imageview) I have to install it onto windows. I cant seem to do that, and am not sure how. Thats why I have come to you, monks. Any ideas on either installing gtkimageview onto windows or any ideas on how I can make this canvas within imageview idea better?

Comment on goo, imageview, windows, oh my!
Re: goo, imageview, windows, oh my!
by Anonymous Monk on Mar 14, 2009 at 10:50 UTC
      Well... I have definitely hit a wall. The app I'm building can display a geotiff, and overlay shapefiles after extracting the needed data. But I would like zooming and paning, all the comforts of a geobrowser. And to do this I would like to use inmageview but, using Vista and MSYS, I can't get it installed for the life of me. I could probably get this done in Goo::Canvas but... I'm lazy. Ho Hum.
        Here you go, needs patch, gzip, tar, strawberryperl (or activeperl with 'ppm install MinGW dmake'), WWW::Mechanize
        #!/usr/bin/perl -- $VERSION = '0.0104'; use strict; use warnings; my @gtk_bundle; my @tarball; sub write_file { my( $fname, $fcontent ) = @_; print "Creating $fname \n"; open my $fh, '>', $fname or die $!; print $fh $fcontent; close $fh; } use WWW::Mechanize; sub URI::file { return (shift->path_segments)[-1] } sub Alien_perlGtk2 { my( @dist ) = qw[ http://search.cpan.org/dist/ExtUtils-Depends http://search.cpan.org/dist/ExtUtils-PkgConfig http://search.cpan.org/dist/Cairo http://search.cpan.org/dist/Glib http://search.cpan.org/dist/Pango http://search.cpan.org/dist/Gtk2 http://search.cpan.org/dist/Gtk2-GladeXML http://search.cpan.org/dist/Gtk2-ImageView ]; ## 2009-09-04- 05:02:37 patches patches ( @dist ) = qw[ http://search.cpan.org/dist/ExtUtils-Depends-0.302 http://search.cpan.org/dist/ExtUtils-PkgConfig-1.12 http://search.cpan.org/dist/Cairo-1.061 http://search.cpan.org/dist/Glib-1.222 http://search.cpan.org/dist/Pango-1.221 http://search.cpan.org/dist/Gtk2-1.221 http://search.cpan.org/dist/Gtk2-GladeXML-1.007 http://search.cpan.org/dist/Gtk2-ImageView-0.05 ]; my $ua = WWW::Mechanize->new( autocheck => 1 ); $ua->env_proxy(); for my $dist( @dist ){ $dist = URI->new($dist); $ua->get($dist); my $bundle = $ua->find_link('text' => 'Download')->url_abs; my $filename = $bundle->file; push @tarball, $filename; print "$bundle\n"; $ua->mirror( $bundle, $filename ); print " ", -s $filename, " bytes\n"; $ua->back; } } sub Alien_libglade { my $ua = WWW::Mechanize->new( autocheck => 1 ); $ua->env_proxy(); my $libglade = URI->new("http://ftp.gnome.org/pub/gnome/binaries/w +in32/libglade/2.6/?C=M;O=D"); $ua->get($libglade); my( @links ) = map { $_->url_abs } $ua->find_all_links( text_regex + => qr/^libglade/ ); for my $zip( @links[0,1] ){ $zip = URI->new($zip); my $filename = $zip->file; push @gtk_bundle, $filename; print "$zip\n"; $ua->mirror( $zip, $filename ); print " ", -s $filename, " bytes\n"; $ua->back; } } sub Alien_Gtk2 { my $ua = WWW::Mechanize->new( autocheck => 1 ); $ua->env_proxy(); # http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.20/ $ua->get('http://www.gtk.org/download-windows.html'); my $bundle = $ua->find_link('text' => 'bundle')->url_abs; my $filename = $bundle->file; push @gtk_bundle, $filename; print "$bundle\n"; $ua->mirror( $bundle, $filename ); print " ", -s $filename, " bytes\n"; } #### MAIN use File::Spec; $ENV{GTK_BASEPATH} = File::Spec->rel2abs('gtk_bundle'); my $newpath = File::Spec->catfile($ENV{GTK_BASEPATH}, 'bin'); $ENV{PATH} = "$newpath;$ENV{PATH}"; $ENV{PKG_CONFIG_PATH} = File::Spec->catfile( $ENV{GTK_BASEPATH}, qw' +lib pkgconfig '); print " set GTK_BASEPATH=$ENV{GTK_BASEPATH} set PATH=%GTK_BASEPATH%\\bin;%PATH% set PKG_CONFIG_PATH=%GTK_BASEPATH%\\lib\\pkgconfig "; write_file('gtk_bundle.patch', <<'__PATCH__'); diff -ruN gtk-bundle/lib/pkgconfig/libglade-2.0.pc gtk+-bundle_2.16.4- +20090708_win32/lib/pkgconfig/libglade-2.0.pc --- gtk-bundle/lib/pkgconfig/libglade-2.0.pc 2008-09-23 21:22:00.00 +0000000 -0700 +++ gtk+-bundle_2.16.4-20090708_win32/lib/pkgconfig/libglade-2.0.pc + 2009-07-26 12:33:52.750000000 -0700 @@ -11,7 +11,7 @@ Name: Libglade Description: a library for dynamically loading GLADE interface files Version: 2.6.3 -Requires: gtk+-2.0 libxml-2.0 +#Requires: gtk+-2.0 libxml-2.0 Libs: -L${libdir} -lglade-2.0 Cflags: -I${includedir}/libglade-2.0 __PATCH__ write_file('gtk_bundle.patch', '');#2009-09-04- 04:48:29 warn join ' ', $^X, qw[ -pi.orig -e ], q[s!Requires!#Requires!], 'gtk_ +bundle/lib/pkgconfig/libglade-2.0.pc'; system $^X, qw[ -pi.orig -e ], q[s!Requires!#Requires!], 'gtk_bundle/l +ib/pkgconfig/libglade-2.0.pc'; write_file('Cairo.patch', <<'__PATCH__'); diff -ruN Cairo-1.061/Makefile.PL Cairo-1.061-new/Makefile.PL --- Cairo-1.061/Makefile.PL 2009-03-28 04:19:31.000000000 -0800 +++ Cairo-1.061-new/Makefile.PL 2009-07-26 15:34:38.109375000 -0700 @@ -381,6 +381,10 @@ SvCairoPath ); +my %makefilevars = $dep->get_makefile_vars; +$makefilevars{LIBS}=":nosearch $makefilevars{LIBS}"; # SPECIAL +#use DDS; Dump\%makefilevars; + WriteMakefile ( NAME => 'Cairo', VERSION_FROM => 'lib/Cairo.pm', @@ -390,7 +394,7 @@ FUNCLIST => \@exports, DL_FUNCS => { Cairo=> [] }, - $dep->get_makefile_vars, + %makefilevars, META_MERGE => { configure_requires => \%prereqs, __PATCH__ write_file('ExtUtils-Depends.patch', <<'__PATCH__'); diff -ruN ExtUtils-Depends-0.302/lib/ExtUtils/Depends.pm ExtUtils-Depe +nds-0.302-new/lib/ExtUtils/Depends.pm --- ExtUtils-Depends-0.302/lib/ExtUtils/Depends.pm 2009-07-04 06:30 +:45.000000000 -0700 +++ ExtUtils-Depends-0.302-new/lib/ExtUtils/Depends.pm 2009-07-26 1 +4:27:15.734375000 -0700 @@ -332,7 +332,7 @@ }, map { -d $_ ? ($_) : () } @INC); # only extant dirs if ($matching_file && -f $matching_file) { - push @found_libs, ('-L' . $matching_dir, '-l' . $stem); + push @found_libs, $matching_file; next; } } __PATCH__ write_file('Glib.patch', <<'__PATCH__'); diff -ruN Glib-1.222/Makefile.PL Glib-1.222-new/Makefile.PL --- Glib-1.222/Makefile.PL 2009-07-04 10:22:55.000000000 -0700 +++ Glib-1.222-new/Makefile.PL 2009-07-26 15:37:51.656250000 -0700 @@ -157,6 +157,10 @@ our @exports; require 'Glib.exports'; +my( %makefilevars ) = $glib ? $glib->get_makefile_vars : (); +#use DDS; Dump\%makefilevars; +$makefilevars{LIBS}=":nosearch $makefilevars{LIBS}"; # SPECIAL + WriteMakefile( NAME => 'Glib', VERSION_FROM => 'Glib.pm', # finds $VERSION @@ -175,7 +179,7 @@ }, }, - $glib ? $glib->get_makefile_vars : (), + %makefilevars, ); =unstable __PATCH__ write_file('Gtk2.patch', <<'__PATCH__'); diff -ruN Gtk2-1.221/Makefile.PL Gtk2-1.221-new/Makefile.PL --- Gtk2-1.221/Makefile.PL 2009-05-17 04:59:39.000000000 -0700 +++ Gtk2-1.221-new/Makefile.PL 2009-07-26 15:38:31.968750000 -0700 @@ -268,6 +268,11 @@ our @exports; require 'Gtk2.exports'; +my(%makefilevars)=$gtk2->get_makefile_vars; +#use DDS; Dump\%makefilevars; +$makefilevars{LIBS}=":nosearch $makefilevars{LIBS}"; # SPECIAL + + WriteMakefile( NAME => 'Gtk2', VERSION_FROM => 'Gtk2.pm', # finds $VERSION @@ -283,7 +288,7 @@ no_index => { directory => [qw/tools xs/] }, }, - $gtk2->get_makefile_vars, + %makefilevars, ); =unstable diff -ruN Gtk2-1.221/t/GtkRecentChooser.t Gtk2-1.221-new/t/GtkRecentCh +ooser.t --- Gtk2-1.221/t/GtkRecentChooser.t 2009-05-17 04:59:40.000000000 - +0700 +++ Gtk2-1.221-new/t/GtkRecentChooser.t 2009-07-26 12:50:04.3750000 +00 -0700 @@ -41,9 +41,13 @@ # ------------------------------------------------------------------- +-------- # -use Cwd qw(cwd); -my $uri_one = "file://" . cwd() . "/" . $0; -my $uri_two = "file://" . $^X; +#~ use Cwd qw(cwd); +#~ my $uri_one = "file://" . cwd() . "/" . $0; +#~ my $uri_two = "file://" . $^X; +use URI::file; +my $uri_one = URI::file->new(__FILE__)->abs(URI::file->cwd); +my $uri_two = URI::file->new($^X)->abs(URI::file->cwd); + $manager -> purge_items(); $manager -> add_item($uri_one); __PATCH__ write_file('Gtk2-GladeXML.patch', <<'__PATCH__'); diff -ruN Gtk2-GladeXML-1.007/Makefile.PL Gtk2-GladeXML-1.007-new/Make +file.PL --- Gtk2-GladeXML-1.007/Makefile.PL 2008-09-07 13:05:50.000000000 - +0700 +++ Gtk2-GladeXML-1.007-new/Makefile.PL 2009-07-26 17:34:59.7031250 +00 -0700 @@ -65,13 +65,18 @@ $gladexml->install ('gladexmlperl.h'); $gladexml->save_config ('build/IFiles.pm'); +my(%makefilevars)=$gladexml->get_makefile_vars; +#use DDS; Dump\%makefilevars; +$makefilevars{LIBS}=":nosearch $makefilevars{LIBS}"; # SPECIAL + + WriteMakefile( NAME => 'Gtk2::GladeXML', VERSION_FROM => 'GladeXML.pm', ABSTRACT_FROM => 'GladeXML.pm', PREREQ_PM => \%pre_reqs, XSPROTOARG => '-noprototypes', - $gladexml->get_makefile_vars, + %makefilevars, ); __PATCH__ write_file('Pango.patch', <<'__PATCH__'); diff -ruN Pango-1.220/Makefile.PL Pango-1.220-new/Makefile.PL --- Pango-1.220/Makefile.PL 2009-03-17 08:58:06.000000000 -0800 +++ Pango-1.220-new/Makefile.PL 2009-07-26 15:47:26.265625000 -0700 @@ -184,6 +184,10 @@ # exports list needed for win32, unused on others my @exports = Glib::MakeHelper->read_source_list_file ('pango.exports +'); +my(%makefilevars) = $pango->get_makefile_vars; +#use DDS; Dump\%makefilevars; +$makefilevars{LIBS}=":nosearch $makefilevars{LIBS}"; # SPECIAL + WriteMakefile( NAME => 'Pango', VERSION_FROM => 'lib/Pango.pm', @@ -196,7 +200,7 @@ META_MERGE => { configure_requires => \%PREREQ_PM }, - $pango->get_makefile_vars, + %makefilevars, ); diff -ruN Pango-1.220/pango.exports Pango-1.220-new/pango.exports --- Pango-1.220/pango.exports 2008-11-16 10:57:55.000000000 -0800 +++ Pango-1.220-new/pango.exports 2009-07-26 12:00:56.140625000 -07 +00 @@ -1,2 +1,8 @@ newSVPangoRectangle SvPangoRectangle +gtk2perl_pango_attribute_get_type +gtk2perl_pango_attribute_register_custom_type +gtk2perl_pango_attr_iterator_get_type +gtk2perl_pango_layout_iter_get_type +gtk2perl_pango_layout_line_get_type +gtk2perl_pango_script_iter_get_type __PATCH__ write_file('Gtk2-ImageView.patch', <<'__PATCH__'); diff -ruN Gtk2-ImageView-0.05/Makefile.PL Gtk2-ImageView-0.05-new/Make +file.PL --- Gtk2-ImageView-0.05/Makefile.PL 2009-04-04 14:25:14.000000000 - +0800 +++ Gtk2-ImageView-0.05-new/Makefile.PL 2009-07-27 10:24:22.5156250 +00 -0700 @@ -88,7 +88,8 @@ # my $configure_requires = # Glib::MakeHelper->get_configure_requires_yaml( +%PREREQ_PM); my $configure_requires = get_configure_requires_yaml(%PREREQ_PM); - +my(%makefilevars) = $depends->get_makefile_vars; +$makefilevars{LIBS}=":nosearch $makefilevars{LIBS}"; # SPECIAL WriteMakefile( NAME => 'Gtk2::ImageView', VERSION_FROM => 'ImageView.pm', # finds $VERSION @@ -98,7 +99,7 @@ PREREQ_PM => \%PREREQ_PM, XSPROTOARG => '-noprototypes', MAN3PODS => \%pod_files, - $depends->get_makefile_vars, + %makefilevars, EXTRA_META => qq/ $configure_requires /, __PATCH__ @tarball = grep -e, map glob, qw[ ExtUtils-Depends*gz ExtUtils-Pkg +Config*gz Cairo*gz Glib*gz Pango*gz Gtk2*gz ]; unless( @tarball > 7 ){ print "Downloading neccessary files\n"; Alien_libglade(); Alien_Gtk2(); Alien_perlGtk2(); print "Extracting bundle\n"; for my $tgz ( @gtk_bundle ){ system qw[ unzip -od gtk_bundle ], $tgz; } } chdir 'gtk_bundle' or die sprintf "chdir ($!)(%s)", $!,$!; system qw[ patch -p1 -N --global-reject-file=../global.rejects -i ../g +tk_bundle.patch ]; chdir '..' or die sprintf "chdir ($!)(%s)", $!,$!; for my $tgz ( @tarball ){ system qw[ gzip -dkf ], $tgz; $tgz =~ s/\.gz$//i; system qw[ tar -xvf ], $tgz; $tgz =~ s/\.tar$//i; chdir $tgz or die sprintf "chdir ($!)(%s)", $!,$!; my ( $lepatch ) = $tgz =~ m~^(.+?)\-\d+\.[\d_]+.*$~; $lepatch = "../$lepatch.patch"; system qw[ patch -p1 -N --global-reject-file=../global.rejects -i +], $lepatch; system $^X, qw[ Makefile.PL make=dmake ]; system qw[ dmake test ]; system qw[ dmake install ]; chdir '..' or die sprintf "chdir ($!)(%s)", $!,$!; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://750546]
Approved by almut
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-09-20 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (158 votes), past polls