Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Tcl::pTk right-click macOS

by IB2017 (Pilgrim)
on Jun 02, 2018 at 10:40 UTC ( [id://1215727]=note: print w/replies, xml ) Need Help??


in reply to Re: Tcl::pTk right-click macOS
in thread Tcl::pTk right-click macOS

Having the same issue. Unfortunately neither <<ContextMenu>> nor <<Contextual>> produce any action in my script. Even worse: using <2> it produces a strange, undesired effect. The popup appears correctly, but if a word has been selected in the widget before calling the popup, the same word is copied and pasted (with an undefined time lag, from a few ms to a few s)This can be reproduced simply by the following:

#!/usr/bin/perl use strict; use warnings; use Tcl::pTk; use Tk::Text; my $mw = MainWindow->new(); my $text = $mw->Text()->pack(); $text->bind('<2>', [sub {print "something"}, Ev('X'), Ev('Y'), ]); MainLoop;

I am on macOS Highsierra and using Tcl/Tk 8.5

Replies are listed 'Best First'.
Re^3: Tcl::pTk right-click macOS
by kcott (Archbishop) on Jun 03, 2018 at 09:31 UTC

    I think my macOS is the same version; fairly sure Tcl/Tk was 8.6.

    My current work has taken me away from home for some time; and, I wasn't going to lug a Mac Pro around with me. I'll be back in about two months. I can check code, versions, etc. then: sorry, but that's the best I can do at the moment.

    — Ken

Re^3: Tcl::pTk right-click macOS
by IB2017 (Pilgrim) on Jun 02, 2018 at 10:54 UTC

    I start to thing it is a bug. If I use <Key-F2> as event, just an example, it works if no text has been previously selected. Otherwise the following error is prompted :

    Tcl::pTk::Error: Can't call method "_retListContext" without a package + or object reference at /Users/xxx/perl5/perlbrew/perls/perl-5.24.4/l +ib/site_perl/5.24.4/Tcl/pTk/Widget.pm line 2842. while executing "if {$catchVal != 0} { if { $retVal != "_TK_BREAK_\n" } { # BREAK ret +urns are not errors return..." (command bound to event)

      This particular error is a bug. It was reported in RT #125460 and was fixed in Tcl::pTk 0.93. It was because of a missing use Text::Tabs; statement in one of its modules, but the error it gave was unusual because rather than an "Undefined subroutine" error, the reliance on AUTOLOAD by Tcl::pTk means it was mistaken for Tcl/Tk functionality, so some other error appears instead.

Re^3: Tcl::pTk right-click macOS
by chrstphrchvz (Scribe) on Sep 21, 2018 at 07:59 UTC

    IB2017’s issue has since been reported as RT #127120. The cause is that the global <<PasteSelection>> (using middle-click to paste currently selected text) event in older versions of Tcl/Tk (prior to 8.5.16 and 8.6.1) is incorrectly bound to the right mouse button. While the responsible code is in Tcl/Tk itself (not Tcl::pTk), it can effectively be patched at runtime, so a future Tcl::pTk version will likely do this automatically if an affected Tk version is detected.

    Update: Tcl::pTk 0.95 includes the runtime patch for older Tcl/Tk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1215727]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found