Menu

#577 Tk windows are not modal

WinCvs
open
WinCvs (709)
4
2004-01-09
2003-05-12
Anonymous
No

I got to show a Tk/Python window in WinCVS with a
small workaround.

If the user clicks anywhere in WinCVS while the Tk
window is shown, the Window goes behind WinCVS
(thus hiding it) and then if the user do any action that
trigs a macro (showing the Admin Menu for example),
WinCVS completely hangs.

The problem, I think, is that the Tk Window is not a
Modal Dialog (or maybe I am just doing it wrong?). We
could maybe workaround this by "disabling" almost
everything to at least prevent a Script Engine-re-entry so
it doesn't hang, etc.

I think WinCVS would become much more customizable
if we could allow the use of the powerful Tk set.
Currently, in macros, the only interfaces choices are:
menu item text (and checkbox), message boxes, and a
prompt that includes a single line textbox.

Try it for yourself. Dump this TkTest.py in the
<wincvs>/Macros directory: (file also attached)

Bernard Poulin
bernard@acm.org

-----------------------cut here--------------------------
from cvsgui.Macro import *
from Tkinter import *

class GUITest(Macro):
def __init__(self):
Macro.__init__(self, "Hello World",
MACRO_SELECTION,
0, "Tk Tests")

def OnCmdUI(self, cmdui):
return

def Run(self):

# workaround to keep Tk happy
(??)
sys.argv = ("base");

root = Tk()

w = Label(root, text="Hello,
world!")
w.pack()

root.mainloop()
return

GUITest()

Discussion

  • Nobody/Anonymous

    Tk Test Python Macro

     
  • Jerzy Kaczorowski

    • assigned_to: jerzyk --> nobody
    • milestone: 126723 -->
    • labels: 379714 -->
     
  • Jerzy Kaczorowski

    • milestone: --> 125726
    • assigned_to: nobody --> jerzyk
    • labels: --> 388877
     
  • Oliver Giesen

    Oliver Giesen - 2003-05-16
    • milestone: 125726 -->
    • labels: 388877 -->
    • assigned_to: jerzyk --> nobody
    • summary: Tk would be sooooooo useful to create powerful macros --> Tk windows are not modal
     
  • Oliver Giesen

    Oliver Giesen - 2003-05-16

    Logged In: YES
    user_id=158827

    This is indeed a known bug. The Tk-window only becomes modal
    as soon as you invoke cvs.Run and even then not under all
    circumstances AFAICT.

    FWIW, there already is a Tk-enabled macro in the package
    since b11, namely my Recursive Add macro (in the Macros|CVS
    submenu). I have also written one other Tk-enabled macro
    which I haven't donated yet. It is available from
    http://people.freenet.de/ogiesen/readme.html .

    Also, if you're intending to share your Tk-enabled macros
    with people who still use TCL macros, make sure you're using
    the SafeTk module as shown in my macros, otherwise TCL
    macros will no longer work if your macro is loaded.

    Feel free to contact me directly if you have any questions
    about this:
    Mail: ogware@gmx.net
    ICQ: 18777742

    [Reclassified as Bug and changed Summary accordingly]

     
  • bernard

    bernard - 2003-12-12

    Logged In: YES
    user_id=929505

    With a recent build (b14+), it is easier to reproduce than
    ever: (no need for the attached macro)
    Just go: Admin macros -> Browse Repository Folders
    and start clicking around.

     
  • Jerzy Kaczorowski

    • labels: --> WinCvs
    • assigned_to: nobody --> jerzyk
    • priority: 5 --> 4
    • milestone: --> WinCvs
     

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.