Tk Source Code

View Ticket
Login
Ticket UUID: 2479603
Title: winfo [v]root[xy] is zero after window gets moved. Mac OSX 10.3.9
Type: Bug Version: obsolete: 8.5.5
Submitter: uwe_hollerbach Created on: 2008-12-31 20:50:23
Subsystem: 66. Aqua Window Operations Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2017-12-13 20:30:37
Resolution: Works For Me Closed By: fvogel
    Closed on: 2017-12-13 20:30:37
Description:
Listbox aim is off after window gets moved:

I'm using 8.5.6 on Mac OSX 10.3.9 on an old iMac G3. I have an app with a listbox, and I've noticed that the listbox reports (and highlights) the wrong entry after I have moved the app window. Initially, if I have not moved the window, the aim is correct, but afterwards the wrong entry is highlighted and reported. It looks as if there is a mapping between screen coordinates relative to the origin of the app window and absolute coordinates, and that mapping gets lost when the window is moved. I have a small test of this which I'm attaching.

Uwe Hollerbach
User Comments: fvogel added on 2017-12-10 19:45:29:

This seems to be fixed. Os macOS, here is the output I get for "geo.tcl":

window geometry is 84x22+5+28
window rootx is 5
window rooty is 50
window vrootx is 0
window vrooty is 0
window x is 5
window y is 28
[dialog moved here]
window geometry is 84x22+530+222
window rootx is 530
window rooty is 244
window vrootx is 0
window vrooty is 0
window x is 530
window y is 222

Also, with your original script "listbox.tcl", the output I get is OK:

button released at 92, which is translated to 5 -> 6 Months
button released at 148, which is translated to 8 -> 5 Years
[dialog moved here]
button released at 62, which is translated to 3 -> 1 Month
button released at 134, which is translated to 7 -> 2 Years


fvogel added on 2016-01-19 20:59:13:
I see no issue on Windows Vista with Tcl/Tk trunk (more or less 8.6.5) or core-8-5-branch (more or less 8.5.18), with both scripts you provide.

Also, on Linux Debian 6.0 with trunk I see no problem with both scripts.

This issue must be specific to Mac OSX, and as you noted, seems to be more a wm/winfo thing than a listbox issue.

uwe_hollerbach added on 2009-01-01 05:39:20:

File Added - 307345: geo.tcl

This may not be a listbox-specific issue. I've done a bit more investigating with just printing out various [winfo] items, and I get what seems to be similar results: the following is the output from running the second attachment, geo.tcl: first printout from when the app is initially created, second output after it's been moved:

lupus:~/programs/utilities% ./geo.tcl 
window geometry is 122x28+5+27
window rootx is 5
window rooty is 49
window vrootx is 0
window vrooty is 0
window x is 5
window y is 27
window geometry is 122x28+0+-22
window rootx is 0
window rooty is 0
window vrootx is 0
window vrooty is 0
window x is 0
window y is -22

File Added: geo.tcl

uwe_hollerbach added on 2009-01-01 03:50:23:

File Added - 307337: listbox.tcl

Attachments: