mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 13:30:34 +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
|
||||
|
||||
def Redraw(*args, **kwargs):
|
||||
from .libngpy.meshvis import _Redraw
|
||||
|
||||
def RedrawWithEventHandling(*args, **kwargs):
|
||||
try:
|
||||
if libngpy.meshvis._Redraw(*args, **kwargs):
|
||||
import netgen
|
||||
@ -27,4 +29,4 @@ def Redraw(*args, **kwargs):
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
Redraw = RedrawWithEventHandling
|
||||
|
@ -8,6 +8,10 @@ def handle_arguments():
|
||||
imp.load_module('__main__', pyfile, argv[1], (".py", "r", imp.PY_SOURCE))
|
||||
|
||||
def main():
|
||||
import netgen
|
||||
# Use Redraw without event handling
|
||||
netgen.Redraw = netgen._Redraw
|
||||
|
||||
try:
|
||||
import ngsolve
|
||||
except:
|
||||
@ -16,3 +20,6 @@ def main():
|
||||
th = threading.Thread(target=handle_arguments)
|
||||
th.start()
|
||||
win.tk.mainloop()
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
|
Loading…
Reference in New Issue
Block a user