Tk::GraphItems::Connector - Display edges of relation-graphs on a Tk::Canvas
require Tk::GraphItems::TextBox; require Tk::GraphItems::Connector; my $conn = Tk::GraphItems::Connector->new( source => $a_TextBox, target => $another_TextBox, ); $conn->colour( 'red' ); $conn->arrow( 'both' ); $conn->width( 2 ); $conn->detach; $conn = undef;
Tk::GraphItems::Connector provides objects to display edges of relation-graphs on a Tk::Canvas widget.
Tk::GraphItems::Connector supports the following methods:
Create a new Connector instance and display it on the Canvas of 'source' and 'target'. If 'autodestroy' is set to a true value, the Connector will get destroyed when its reference goes out of scope. This is recommended for easy use with Graph.pm or other models which allow to store objects for their edges. See gi-graph.pl for an example. The default for 'autodestroy' is 0. That means the Connector will stay 'alive' until either one of its source/target nodes gets destroyed or Connector->detach is called and references to Connector are deleted.
Sets the colour to $a_Tk_colour, if the argument is given. Returns the current colour, if called without an argument.
Sets the style of the Connectors line-endings. Defaults to 'target'.
Sets Connectors linewidth in points. Defaults to 1.
Binds the given 'event' sequence to $coderef. This binding will exist for all Connector instances on the Canvas displaying the invoking object. The binding will not exist for Connectors that are displayed on other Canvas instances. The Connector instance which is the 'current' one at the time the event is triggered will be passed to $coderef as an argument. If $coderef contains an empty string, the binding for 'event' is deleted.
Detach the Connector instance from its source and target so it can be DESTROYED. - It will however stay 'alive' as long as you hold any references to it. If you do not hold a reference to 'Connector' (you don't have to, unless you want to change it's properties...), it will be DESTROYED when either of its 'source'- or 'target'-nodes is destroyed.
Documentation of Tk::GraphItems::TextBox . Examples in Tk/GraphItems/Examples
Christoph Lamprecht, firstname.lastname@example.org
Copyright (C) 2007 by Christoph Lamprecht
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.7 or, at your option, any later version of Perl 5 you may have available.