Skip to content

Instantly share code, notes, and snippets.

@run4flat
Created November 16, 2011 20:05
Show Gist options
  • Save run4flat/1371188 to your computer and use it in GitHub Desktop.
Save run4flat/1371188 to your computer and use it in GitHub Desktop.
Basic Callbacks with Prima
use strict;
use warnings;
use Prima qw(Application);
my $wDisplay = Prima::MainWindow-> create(
text => 'Mouse Test',
onMouseDown => sub {
print "onMouseDown got args [", join('], [', @_), "]\n";
},
onMouseMove => sub {
print "onMouseMove got args [", join('], [', @_), "]\n";
},
onMouseUp => sub {
print "onMouseUp got args [", join('], [', @_), "]\n";
},
onMouseWheel => sub {
print "onMouseWheel got args [", join('], [', @_), "]\n";
},
);
run Prima;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment