Hi, I'm writing a perl app that uses mouse events, however i'm stuck trying to get the delta value for the MouseWheel event, supposedly it should be accessible through Tkx::Ev('%D'); however all that it prints is differing array refs, ie Tcl::Ev=ARRAY(0x335715c). Is there anyway i can extract the delta value for mouseevents, here is a cutdown version of the offending code:
use Tkx;
$mw = Tkx::widget->new(".");
$canvas = $mw->new_tk__canvas;
$canvas->g_grid(-column=>0, -row=>0, -sticky=>"nwes");
$mw->g_grid_columnconfigure(0, -weight=>1);
$mw->g_grid_rowconfigure(0, -weight=>1);
$canvas->g_bind('<Enter>' => sub { Tkx::focus($canvas); });
$canvas->g_bind("<1>", sub { print "Button 1\n"; });
$canvas->g_bind("<Double-1>", sub { print "Button 1x2\n"; });
$canvas->g_bind("<2>", sub { print "Button 2\n"; });
$canvas->g_bind("<3>", sub { print "Button 3\n"; });
$canvas->g_bind("<Double-3>", sub { print "Button 3x2\n"; });
$canvas->g_bind("<MouseWheel>", sub { print Tkx::Ev('%D') . "\n";
+});
Tkx::MainLoop();
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.