Tk::GraphItems::TextBox - Display nodes of relation-graphs on a Tk::Canvas
require Tk::GraphItems::TextBox; require Tk::GraphItems::Connector; ... my $node = Tk::GraphItems::TextBox->new( canvas=> $can, text => "new_node", font => ['Courier',8], x => 50, y => 50 ); $node->move( 10, 0 ); $node->set_coords( 50, 50 ); $node->text( $node->text()."\nanother_line" ); $node->colour( 'red' );
Tk::GraphItems::TextBox provides objects to display nodes of relation-graphs on a Tk::Canvas widget.
Tk::GraphItems::TextBox supports the following methods:
Return a new TextBox instance and display it on the given 'Canvas'. The canvas-items will be destroyed with the TextBox-instance when it goes out of scope.
Set the (center)coordinates of this node. If two references are given as argumnents, the referenced Scalar-variables will get tied to the coordinates properties of the node.
Return the (center)coordinates of this node.
Move the node by ( $d_x, $d_y ) points.
Sets the displayed text to $a_string, if the argument is given. Returns the current text, if called without an argument.
Sets the background to $a_Tk_colour, if the argument is given. Returns the current colour, if called without an argument.
Binds the given 'event' sequence to $coderef. This binding will exist for all TextBox instances on the Canvas displaying the invoking object. The binding will not exist for TextBox items that are displayed on other Canvas instances. The TextBox 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.
Returns a true value in case a <B1-Motion> occured after the last <B1>. You may want to check this when binding to <B1-Release>, to make sure the action was a 'click' and not a 'drag'.
Documentation of Tk::GraphItems::Connector. 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.