Menu

#833 TK windows lose focus

WinCvs
open-accepted
WinCvs (709)
4
2004-12-06
2004-12-03
CDGS
No

I have created a TK/Python macro that can be called
from the WinCVS macro menu.

The first time the window opens it gets the focus, but if
the macro is closed and called again the window is not in
focus.

Discussion

  • Oliver Giesen

    Oliver Giesen - 2004-12-04

    Logged In: YES
    user_id=158827

    Please post the code of your macro or provide steps to
    reproduce the erroneous behaviour with one of the stock
    macros (i.e. Browse Repository folders, Recursive Add or
    Extended Add).

     
  • CDGS

    CDGS - 2004-12-06

    Logged In: YES
    user_id=1134156

    I have attached a macro to reproduce the erroneous
    behavior. But i guess you could use any TK/Python macro.
    When first one has been loaded, all subsequent TK/Python
    macros will open out of focus within the same WinCVS
    process.

    1: Install the macro
    2: Open WinCVS
    3: Call the macro from the macro menu
    4: Verify that the macro is in focus
    5: Close the macro
    6: Recall the macro from the macro menu
    7: Verify that the macro is no longer in focus when called

     
  • CDGS

    CDGS - 2004-12-06

    Tk/Python Test Macro

     
  • Oliver Giesen

    Oliver Giesen - 2004-12-06
    • priority: 5 --> 4
    • assigned_to: jerzyk --> aubonbeurre
    • status: open --> open-accepted
     
  • Oliver Giesen

    Oliver Giesen - 2004-12-06

    Logged In: YES
    user_id=158827

    OK, I could reproduce this now. I don't see it as much of an
    issue though unless you intend to operate the macro by
    keyboard input. After all, while the macro window is indeed
    not focused initially it is still in front of the WinCvs
    window and thus the difference between "correct" and
    "incorrect" behaviour basically boils down to a different
    color of the title bar. Or is that not what is happening for
    you? I will check back with Alex anyway if there's anything
    he could do on the WinCvs end of things.

    Anyway, please do take a look at the existing Tk macros.
    Your use of Tk is unsafe and might result in breakage of
    existing TCL macros (which might not be an issue to you
    particularly but makes the macro unsuitable for
    redistribution). Therefore it is recommended to make use of
    the cvsgui.SafeTk module.

    BTW: Instead of manipulating sys.argv, you should use the
    keyword argument baseName when instantiating the Tk object,
    e.g.: root = Tk(baseName='dummy')

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.