-
-
Save wu/e90670b47aca7ad315c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# interactive gnuplot terminal | |
use Hook::LexWrap; | |
wrap 'Chart::Gnuplot::_execute', | |
pre => sub { my ( $self ) = @_; | |
# if this isn't an x11 terminal, there's nothing to do | |
return unless $self->{terminal} eq "x11"; | |
# add 'pause' command to script to keep image from immediately disappearing | |
open(GPH, ">>$self->{_script}") || confess("Can't write $self->{_script}"); | |
print GPH "\npause mouse button1\n"; | |
close(GPH); | |
# output is not a file, delete the 'output' param or we'll get an error in _execute | |
delete $self->{output}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment