On Windows XP (SP2) the following Tk command displays a dialog with the "detail" followed by a string of random characters.
tk_messageBox -message Hello -detail "Pleased to meet you"
The following command, with a longer "detail" argument, displays correctly.
tk_messageBox -message Hello -detail "Pleased to meet you and your kin"
Logged In: YES
user_id=988604
Originator: YES
Version involved is:
% package require ActiveTcl
8.5.0.0.272633
Logged In: YES
user_id=988604
Originator: YES
Actually, it's not so simple. The lengths of the "detail" that are displayed correctly and the lengths of the "detail" that have some garbage appended are intimately interspersed.
set detail ""
for {set i 0} {$i<60} {incr i} {
append detail [string index $i end]
tk_messageBox -message Count -detail $detail
}
I'm not even convinced it only depends on the length. But it's not right, anyhow.
Logged In: YES
user_id=146959
Originator: NO
I see this on 8.5a6, Windows XP SP2 as well, compiled from source. Seems almost like it axes the terminating '\0' in the detail string before display.
Logged In: YES
user_id=146959
Originator: NO
Update: this relates to win/tkWinDialog.c:2146. Tcl_DStringAppend() is given a length argument there, Tcl_DStringLength(&detailString). Changing this to "Tcl_DStringLength(&detailString)+1" APPEARS to fix the problem. (Using "-1" does not.) I'm not an expert regarding DStrings, 16-bit unicode, termination, and Windows peculiarities, but some interaction between these is at fault.
Logged In: YES
user_id=202636
Originator: NO
Changed to code to avoid this problem and extended to test suite to check for this issue in the future.