Tk Source Code

View Ticket
Login
Ticket UUID: 219944
Title: focus command not returning correct window
Type: Bug Version: obsolete: 8.0.4
Submitter: welch Created on: 2000-10-31 19:02:54
Subsystem: 65. Generic Window Operations Assigned To: nobody
Priority: 1 Zero Severity:
Status: Closed Last Modified: 2000-11-01 02:02:55
Resolution: Duplicate Closed By: welch
    Closed on: 2000-10-31 19:02:55
Description:
OriginalBugID: 1506 Bug
Version: 8.0.4
SubmitDate: '1999-03-15'
LastModified: '2000-01-06'
Severity: MED
Status: Closed
Submitter: pat
ChangedBy: hobbs
RelatedBugIDs: 1505 2307
OS: AIX
OSVersion: 4.1 and 4.3
Machine: RS6000
ClosedDate: '2000-01-06'


Name:
Anthony Johnson
email:  [email protected]

Extensions:
8.0p2 and 8.0.4, TclX8.0.3, TkX8.0.3

ReproducibleScript:
   focus <-- returns NULL
   toplevel .test
   raise .test
   focus .test
   focus <-- returns NULL
---------------------
   toplevel .test
   raise .test
   focus .test
   update
   focus <--- returns "."
------------------
   update
   toplevel .test
   raise .test
   focus .test
   focus <--- returns .test
-------------------
   update
   toplevel .test
   raise .test
   focus .test
   focus <--- returns NULL
   destroy .test
   toplevel .test
   raise .test
   focus .test
   focus <--- returns NULL
-------------------
   update
   toplevel .test
   raise .test
   focus .test
   focus <--- returns NULL
   destroy .test
   update
   toplevel .test
   raise .test
   focus .test
   focus <--- returns NULL

ObservedBehavior:
Using "update idletasks" instead of "update" has the same affect as omitting it entirely. I cannot use "update" becasue I do not want to start an event loop within my proc. Even when using "update", it doesnt appear to return the correct window I last focused on. Any time a window is destroyed, the focus command returns NULL until update is executed again.

DesiredBehavior:
Focus should return the name of the toplevel window which last had focus.

Tk 8.0.4 Bug

Name:  Anthony Johnson
email:  [email protected]
Support:  None
CVS:  Correction: focus command not returning correct window
Synopsis:  Correction to last portion of test case

ReproducibleScript:
Did not update my comments in the last portion of the test case:
OLD:
   update
   toplevel .test
   raise .test
   focus .test
   focus <--- returns NULL
   destroy .test
   update
   toplevel .test
   raise .test
   focus .test
   focus <--- returns NULL
NEW:
   update
   toplevel .test
   raise .test
   focus .test
   focus <--- returns .test
   destroy .test
   update
   toplevel .test
   raise .test
   focus .test
   focus <--- returns .test