NAME

Gtk2::Ex::Geo::Glue - Module for glueing widgets into a GIS.

METHODS

new

$gis = new Gtk2::Ex::Geo::Glue (history=>\@history,
resources=>$resources);

Creates toolbar, entry, model, tree_view and overlay widgets and stores them into the object.

set_event_handler($event_handler,$user_param);

$event_handler is a user subroutine for handling events happening in the overlay widget, it is called with parameters ($user_param, $event, @xy);

set_draw_on($draw_on,$user_param);

$draw_on is a user subroutine for drawing on the overlay widget once the overlay widget has created it, it is called with parameters ($user_param, $pixmap);

toolbar

returns a Gtk2::Toolbar, which is tied to attribute {toolbar} when a new Gtk2::Ex::Geo::Glue object is created, a subroutine is connected to each toolbar button

add_raster

calls Gtk2::FileChooserDialog and if a file of known type is selected, opens it and adds it by calling add_layer

p($something,%options)

an extended print, tries to print the contents of a hash or array nicely

plot($something,%options)

an interface to gnuplot, tries to plot the contents of a hash or array nicely

clip_selected

returns the visible piece of a selected raster

todo: same for vector layers

add_layer($layer,$name,$do_not_zoom_to);

adds $layer with $name to overlay and model

the default behavior is to zoom to the new layer

get_focal($name)

returns a clipped part of a raster layer by its name

todo: same for vector layers

update

updates the tree_view

move_down

moves the selected layer down in the overlay

move_up

moves the selected layer up in the overlay

delete_selected

removes the selected layer from the overlay

get_selected_layer

returns the selected layer

event_handler

eval_entry and shell

eval_entry is called when something happens in the entry, arrow up and down retrieve entries from the history

the entry is given to Perl eval function after

1) the variable names are inspected and found layer names are replaced with pointers to real layers

2) keyword "focal:" in the beginning of an entry is removed and all references to layers are replaced with clipped versions

shell suspends the main Gtk2 window and gives the focus to the text-based terminal with a plain Perl eval loop

SEE ALSO

Gtk2::Ex::Geo

AUTHOR

Ari Jolma, <ajolma at tkk.fi>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Ari Jolma

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.