NAME

Tk::GraphItems::TextBox - Display nodes of relation-graphs on a Tk::Canvas

SYNOPSIS

require Tk::GraphItems::Circle;
...
my $node = Tk::GraphItems::Circle->new(canvas => $can,
                                       colour => $a_TkColour,
                                       size   => $pixels,
                                       'x'    => 50,
                                       'y'    => 50);
$node->move(10,0);
$node->set_coords(50,50);
$node->text($node->text()."\nanother_line");
$node->colour('red');

DESCRIPTION

Tk::GraphItems::Circle provides objects to display nodes of relation-graphs on a Tk::Canvas widget.

SEE ALSO

Documentation of Tk::GraphItems::Connector. Examples in Tk/GraphItems/Examples.

METHODS

Tk::GraphItems::Circle supports the following methods:

new(canvas => $a_canvas, colour => $a_TkColour, x => $x_coord, y => $y_coord, size => $pixels<)>

Return a new Circle instance and display it on the given 'Canvas'. The canvas-items will be destroyed with the Circle-instance when it goes out of scope.

set_coords($x,$y)

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.

get_coords

Return the (center)coordinates of this node.

move($d_x,$d_y)

Move the node by ($d_x,$d_y) pixels.

size($size)

Resize the node to $size pixels. Returns the current size, if called without an argument.

colour([$a_Tk_colour])

Sets the Circles colour to $a_Tk_colour, if the argument is given. Returns the current colour, if called without an argument.

bind_class('event',$coderef)

Binds the given event_sequence to $coderef. This binding will exist for all TextBox instances on the Canvas displaying the object, 'bind_class' was called with.The binding will not exist for TextBox-instances, 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.

was_dragged

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'.

AUTHOR

Christoph Lamprecht, ch.l.ngre@online.de

COPYRIGHT AND LICENSE

Copyright (C) 2006 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.