Programación Web y Scripting > Perl
Ayuda Con Perl Gnome_canvas
su -:
EN este momento lo he arrglado :P
--- Código: Text ---sub event_mouse { my ($can,$event) = @_; if ($event->type eq 'button-press') { if ($event->button == 1 and $drag == 1) { if($band == 0) { $lx1 = $event->x; $ly1 = $event->y; $band = 1; } else{ $lx2 = $event->x; $ly2 = $event->y; $band = 0; my $item = Gnome2::Canvas::Item->new ( $root, 'Gnome2::Canvas::Line', points => [$lx1, $ly1, $lx2, $ly2], fill_color => 'red', first_arrowhead => TRUE, last_arrowhead => TRUE ); $drag = 0; } } }}
Asi debe ser esa funcion...
Teniendo en cuenta esto:
--- Citar ---sub toogle_activation{
my $doit = shift;
if (defined $doit) {
$drag = TRUE;
$canvas->signal_connect(event => \&event_mouse);
}
else {
$drag = FALSE;
}
}
--- Fin de la cita ---
Navegación
[*] Página Anterior
Ir a la versión completa