Hi Loïc,

The SmpleGui.py module is an improvement over the previous wxSamplesGui that
enables multiple graphical backends. For instance, if you decide whether to
use SimpleGui to manage the display, you first have to set the graphical
backend to use. Fos instance:

set_backend('wx') #if you want to use wxPython
set_backend('qt') #if you want to use pyQt
set_backend('X') #if you want to use python-xlib (Linux/MacOSX up to
SL64bit)

All the samples are not sync yet with the newest developments I made. In
ordrer to make the scripts work, you first have to insert the 2 lines:

from OCC.Display.SimpleGui import *

display, start_display, add_menu, add_function_to_menu = init_display()

The graphical backend used by default will be the one available on your
machine. If you have both wxPython, PyQt and python-xlib installed, then the
default one will bis 'wx'.

Best,

Thomas

2009/12/2 Simon Loic <simon1l...@gmail.com>

> Hi thomas,
> I've seen that you made a many commits recently relative to SimpleGUI, I
> have updated pythonOcc trunk to the last revision. It seems that many
> samples have don't work anymore.
> To be accurate if for example I call
> >>python Level2/PAF/test_box.py
> it wil throw me
> ""
> from OCC.Display.SimpleGui import start_display, display
> ImportError: cannot import name start_display
> ""
> the same for Level1/Mesh/simple_mesh.py Level1/Animation/animation.py and I
> guess many others (didn't try all of them).
>
> I also have a related problem with other scripts like
> Level1/Dimensions/dimensions.py where there si first a statement:
> >> from OCC.Display.SimpleGui import *
> and then at some point
> >> display.Context.Display(ais7.GetHandle())
> Then I get the following error:
> ""NameError: name 'display' is not defined""
>
> Are the samples uptodate and I simply did something wrong?
> Cheers,
> Loïc
>
> _______________________________________________
> Pythonocc-users mailing list
> Pythonocc-users@gna.org
> https://mail.gna.org/listinfo/pythonocc-users
>
>
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to