Page 1 of 1

How to create a PyQt Context Browser?

Unread postPosted: Fri Feb 07, 2020 7:14 pm
by mhamid3d
I am trying to create a context browser to use with a PyQt application. When I even try to access the class I get an error that GuiBrowser does not exist:

Code: Select all
browser = ix.api.GuiBrowser()

>>> Traceback (most recent call last):
>>>  File "<string>", line 3, in <module>
>>> AttributeError: 'module' object has no attribute 'GuiBrowser'


This also brings up a point that a lot of the classes in the Clarisse SDK seem to throw errors that they do not exist. Is there some workflow I'm missing here?

Re: How to create a PyQt Context Browser?

Unread postPosted: Tue Feb 11, 2020 4:24 pm
by anemoff
Hi,

Sorry but GuiBrowser is not available in Python. However, there are built-in helpers to workaround this voluntary limitation.

If you just want to show a context browser and get the selected context, check this other topic: viewtopic.php?p=22632#p22632

Note that there is a variant "pick_contexts" if you need to select multiple contexts.
See documentation here: https://www.clarissewiki.com/4.0/sdk/cl ... b7cc5a55ec

For information, currently, Python bindings are not 100% complete compared to the C++ API. We have chosen to not expose all C++ classes in Python, yet, because some C++ APIs need polishing and/or simplifications to be more Python friendly and simpler once exposed.

Cheers,