Bugs item #2443069, was opened at 2008-12-17 15:21
Message generated for change (Comment added) made by dkf
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112997&aid=2443069&group_id=12997Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: 53. [selection]
Group: development: 8.6b2
Status: Open
Resolution: None
Priority: 8
Private: No
Submitted By: Andy Goth (andygoth)
Assigned to: Jan Nijtmans (nijtmans)
Summary: Cannot replace [selection handle] command
Initial Comment:
% package require Tk
% proc report {string args} {return $string}
% selection handle . {report 1}
% selection own .
% selection get
1
% selection get -type UTF8_STRING
1
% selection handle . {report 2}
% selection get
2
% selection get -type UTF8_STRING
1
When replacing the [selection handle] command, the automatically generated UTF8_STRING handler is *not* updated, only the STRING handler. The attached patch fixes Tk_CreateSelHandler() to update both. It also updates the Tk_CreateSelHandler() documentation to describe the automatic UTF8_STRING handler creation, updating, and removal. I tested the patch successfully on X11.
Workaround 1: Use [selection handle -type UTF8_STRING] to explicitly set the UTF8_STRING handler in addition to the STRING handler.
Workaround 2: Use [selection handle $win ""] to clear the handler before changing it.
----------------------------------------------------------------------
>Comment By: Donal K. Fellows (dkf)
Date: 2012-06-09 09:37
Message:
Those tests look like bystanders, with the thing tested for (equality of
target list) being a proxy for what is interesting (TEST present in target
list or not). Just update the expected test results. :-)
----------------------------------------------------------------------
Comment By: Jan Nijtmans (nijtmans)
Date: 2012-06-09 00:33
Message:
committed to branch bug-2443069
Looks good to me. The only problem with the
patch is that it causes two test failures (see below),
so those have to be fixed first before it can
be merged to trunk.
==== clipboard-5.1 Tk_ClipboardClear procedure FAILED
==== Contents of test case:
clipboard append -t TEST "test"
set result [lsort [clipboard get TARGETS]]
clipboard clear
list $result [lsort [clipboard get TARGETS]]
---- Result was:
{MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING}
{MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING}
---- Result should have been (exact matching):
{MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE
TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}
==== clipboard-5.1 FAILED
==== clipboard-5.2 Tk_ClipboardClear procedure FAILED
==== Contents of test case:
clipboard append -t TEST "test"
set result [lsort [clipboard get TARGETS]]
selection own -s CLIPBOARD .
lappend result [lsort [clipboard get TARGETS]]
clipboard clear
clipboard append -t TEST "test"
lappend result [lsort [clipboard get TARGETS]]
---- Result was:
MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING
{MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS
TEST TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING}
---- Result should have been (exact matching):
MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW {MULTIPLE TARGETS
TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TEST TIMESTAMP
TK_APPLICATION TK_WINDOW}
==== clipboard-5.2 FAILED
----------------------------------------------------------------------
Comment By: Andy Goth (andygoth)
Date: 2012-06-08 16:12
Message:
This has been hanging out for three to four years. Please, somebody have a
look at it. I still need to manually apply this patch to get my
application to work.
----------------------------------------------------------------------
Comment By: Andy Goth (andygoth)
Date: 2011-04-17 18:38
Message:
I fixed some typos in the patch.
----------------------------------------------------------------------
Comment By: Donal K. Fellows (dkf)
Date: 2010-08-18 01:16
Message:
It would be nice to be able to do this.
----------------------------------------------------------------------
Comment By: Andy Goth (andygoth)
Date: 2009-01-06 10:05
Message:
Tiny amendment to the patch: Replace "but" with "that" in the line
"existing STRING handler is also being replaced but has a different" in the
patch for doc/CrtSelHdlr.3 .
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112997&aid=2443069&group_id=12997------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
Tcl-Bugs mailing list
Tcl-Bugs@...
https://lists.sourceforge.net/lists/listinfo/tcl-bugs