mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
no tk event handling when starting netgen.__main__
This commit is contained in:
parent
0d4028ea7a
commit
543d1a378a
@ -16,7 +16,9 @@ del os
|
|||||||
|
|
||||||
from . import libngpy
|
from . import libngpy
|
||||||
|
|
||||||
def Redraw(*args, **kwargs):
|
from .libngpy.meshvis import _Redraw
|
||||||
|
|
||||||
|
def RedrawWithEventHandling(*args, **kwargs):
|
||||||
try:
|
try:
|
||||||
if libngpy.meshvis._Redraw(*args, **kwargs):
|
if libngpy.meshvis._Redraw(*args, **kwargs):
|
||||||
import netgen
|
import netgen
|
||||||
@ -27,4 +29,4 @@ def Redraw(*args, **kwargs):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Redraw = RedrawWithEventHandling
|
||||||
|
@ -8,6 +8,10 @@ def handle_arguments():
|
|||||||
imp.load_module('__main__', pyfile, argv[1], (".py", "r", imp.PY_SOURCE))
|
imp.load_module('__main__', pyfile, argv[1], (".py", "r", imp.PY_SOURCE))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
import netgen
|
||||||
|
# Use Redraw without event handling
|
||||||
|
netgen.Redraw = netgen._Redraw
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import ngsolve
|
import ngsolve
|
||||||
except:
|
except:
|
||||||
@ -16,3 +20,6 @@ def main():
|
|||||||
th = threading.Thread(target=handle_arguments)
|
th = threading.Thread(target=handle_arguments)
|
||||||
th.start()
|
th.start()
|
||||||
win.tk.mainloop()
|
win.tk.mainloop()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
|
Loading…
Reference in New Issue
Block a user