… | |
… | |
456 | my ($widget, $ev) = @_; |
456 | my ($widget, $ev) = @_; |
457 | |
457 | |
458 | if ($ev->{button} == 1) { |
458 | if ($ev->{button} == 1) { |
459 | $edit_macro->($macro), |
459 | $edit_macro->($macro), |
460 | } elsif ($ev->{button} == 2) { |
460 | } elsif ($ev->{button} == 2) { |
461 | $::CONN->macro_send ($macro) if $::CONN; |
461 | execute ($macro); |
462 | } elsif ($ev->{button} == 3) { |
462 | } elsif ($ev->{button} == 3) { |
463 | (new DC::UI::Menu |
463 | (new DC::UI::Menu |
464 | items => [ |
464 | items => [ |
465 | ["Edit" => sub { $edit_macro->($macro) }], |
465 | ["Edit" => sub { $edit_macro->($macro) }], |
466 | ["Invoke" => sub { $::CONN->macro_send ($macro) if $::CONN }], |
466 | ["Invoke" => sub { execute ($macro) }], |
467 | ["Delete" => sub { |
467 | ["Delete" => sub { |
468 | # might want to use grep instead |
468 | # might want to use grep instead |
469 | splice @{$::PROFILE->{macro}}, $idx, 1, (); |
469 | splice @{$::PROFILE->{macro}}, $idx, 1, (); |
470 | $refresh->(); |
470 | $refresh->(); |
471 | }], |
471 | }], |