mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@111 39dd0a4e-7c14-0410-91b3-c4f2d318f732
25 lines
649 B
Python
25 lines
649 B
Python
"""
|
|
A number of function that enhance PySol on MacOSX when it used as a normal
|
|
GUI application (as opposed to an X11 application).
|
|
"""
|
|
import sys
|
|
from Tkinter import Menu, Text, TclError
|
|
|
|
def runningAsOSXApp():
|
|
""" Returns True iff running from the PySol.app bundle on OSX """
|
|
return (sys.platform == 'darwin' and 'PySol.app' in sys.argv[0])
|
|
|
|
def hideTkConsole(root):
|
|
try:
|
|
root.tk.call('console', 'hide')
|
|
except TclError:
|
|
pass
|
|
|
|
def setupApp(app):
|
|
"""
|
|
Perform setup for the OSX application bundle.
|
|
"""
|
|
if not runningAsOSXApp(): return
|
|
|
|
hideTkConsole(app.top)
|
|
#overrideRootMenu(root, flist)
|