Personal tools
You are here: Home Forum How to use Salome? Dialog windows in Python: how to receive currentSelectionChanged signal

Dialog windows in Python: how to receive currentSelectionChanged signal

Up to How to use Salome?

Dialog windows in Python: how to receive currentSelectionChanged signal

Posted by Goodrone at April 08. 2011

Hello,

I'm developing a SALOME module in Python on Windows. I want to implement an input field in a dialog window to allow users "select" an object in the study object browser. I look into the source code of the "Create Group" dialog in GEOM module.

AFAIU I need to receive currentSelectionChanged() signal from a LightApp_SelectionMgr object, but I can't find it in the Python wrappers. Is it possible to track selection change from Python?

Thank you,
Andrew

Re: Dialog windows in Python: how to receive currentSelectionChanged signal

Posted by Erwan ADAM at May 06. 2011

The attached tarball contains a minimal python GUI module in which selection is tracked.
Extract it, you have now a dir aaa_dir
Define a variable SalomeAppConfig :
setenv SalomeAppConfig full_path/aaa_dir  (for csh like)
export SalomeAppConfig=full_path/aaa_dir  (for sh like)

Now, with runSalome --modules=GEOM,AAA, a module AAA should appear (don't bother the warnings).
Go into GEOM, create something
Go into AAA, change selection, an output should be printed.

Tested with 5.1.5 and it should work with more than one study.

Regards, E.A.

Attachments
Powered by Ploneboard
Document Actions