Ignore:
Timestamp:
03/04/12 09:35:01 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

The status icon is now hidden properly when the program quits, and made restarting nicer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/mlx.py

    r36 r38  
    77import os
    88import sys
     9
     10if os.name=="nt":
     11    import win32api
    912
    1013#--------------------------------------------------------------------------------------
     
    2831    config = Config()
    2932    gui = GUI(programDirectory, config)
    30 
     33   
    3134    sys.stdout = StdIOHandler(gui)
    3235    sys.stderr = StdIOHandler(gui)
    3336
    34     gui.build(programDirectory)
     37    try:
     38        gui.build(programDirectory)
     39       
     40        gui.run()
     41    finally:
     42        gui.flushStdIO()
     43        sys.stdout = sys.__stdout__
     44        sys.stderr = sys.__stderr__
    3545
    36     gui.run()
     46    if gui.toRestart:
     47        programPath = os.path.join(os.path.dirname(sys.argv[0]),
     48                                   "runmlx.exe" if os.name=="nt" else "runmlx.sh")
     49        if os.name=="nt":
     50            programPath = win32api.GetShortPathName(programPath)
     51
     52        os.execl(programPath, programPath)
    3753
    3854#--------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.