mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 13:50:33 +05:00
fix python import of non-gui builds
This commit is contained in:
parent
ffdb9378b5
commit
81c1d46db0
@ -16,17 +16,19 @@ del os
|
|||||||
|
|
||||||
from . import libngpy
|
from . import libngpy
|
||||||
|
|
||||||
_Redraw = libngpy.meshvis._Redraw
|
if config.USE_GUI:
|
||||||
|
global _Redraw, Redraw
|
||||||
|
_Redraw = libngpy.meshvis._Redraw
|
||||||
|
|
||||||
def RedrawWithEventHandling(*args, **kwargs):
|
def RedrawWithEventHandling(*args, **kwargs):
|
||||||
try:
|
try:
|
||||||
if libngpy.meshvis._Redraw(*args, **kwargs):
|
if libngpy.meshvis._Redraw(*args, **kwargs):
|
||||||
import netgen
|
import netgen
|
||||||
import tkinter
|
import tkinter
|
||||||
cnt = 0
|
cnt = 0
|
||||||
while(netgen.gui.win.tk.dooneevent(tkinter._tkinter.DONT_WAIT) and cnt < 100):
|
while(netgen.gui.win.tk.dooneevent(tkinter._tkinter.DONT_WAIT) and cnt < 100):
|
||||||
cnt += 1
|
cnt += 1
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Redraw = RedrawWithEventHandling
|
Redraw = RedrawWithEventHandling
|
||||||
|
Loading…
Reference in New Issue
Block a user