| filippo 2006-06-02, 8:02 am |
| Hello again,
I'm trying to post my popup menu right over the curson on MListbox
widget.
The code
$goofy_mlistbox->bind('<ButtonPress-1>' =3D> [sub {
my($w, $x, $y) =3D @_;
$menu->post($x, $y);
}, Ev('X'), Ev('Y')]);
simply doesn't bind to the ButtonPress, so that chunk is not evaluated
at all. If I change ButtonPress-1 to 'p', it works (!?!) but I need to
bind to mousebutton.
The code
$goofy_mlistbox->bindRows('<ButtonPress-1>' =3D> [sub {
my($w, $x, $y) =3D @_;
$menu->post($x, $y);
}, Ev('X'), Ev('Y')]);
is actually evaluated but produce errors like this
Tk::Error: '=E2=94=9C=C3=A2=E2=94=AC=E2=95=9D=E2=98
=BC%=E2=99=A5=E2=99=A5' =
isn't numeric at
C:/Perl/site/lib/Tk.pm line 252.
Tk callback for .frame1.frame.menu
<Button-3>
(command bound to event)
I discovered that bindRows pass to the callback different arguments
that bind, and it seems that doen't pass the cursor position. Am I
right?
My questions are:
- is it possible to post to cursor position using bindRows?
- why bind (on mlistbox) doesn't work on mousebuttons events?
Thanks and best regards,
Filippo
|