Programación Web y Scripting > Perl

 Ayuda Con Perl Gnome_canvas

<< < (4/4)

su -:
EN este momento lo he arrglado  :P  


--- Código: Text ---sub event_mouse {  my (&#036;can,&#036;event) = @_;  if (&#036;event-&#62;type eq 'button-press') {    if (&#036;event-&#62;button == 1 and &#036;drag == 1) {      if(&#036;band == 0) {        &#036;lx1 = &#036;event-&#62;x;        &#036;ly1 = &#036;event-&#62;y;        &#036;band = 1;      }      else{  &#036;lx2 = &#036;event-&#62;x;  &#036;ly2 = &#036;event-&#62;y;  &#036;band = 0;        my &#036;item = Gnome2::Canvas::Item-&#62;new   (    &#036;root, 'Gnome2::Canvas::Line',    points =&#62; [&#036;lx1, &#036;ly1, &#036;lx2, &#036;ly2],    fill_color =&#62; 'red',    first_arrowhead =&#62; TRUE,    last_arrowhead =&#62; TRUE  );  &#036;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

[0] Índice de Mensajes

[*] Página Anterior

Ir a la versión completa