<div dir="ltr">Hi Jonathan - <div><br></div><div>That widget emits a signal when changed [1], which you can get with the coordinates property [2]. In python this is available as a string, so you'll need to parse that to make use of the values.</div><div><br></div><div>Here's an example that shows a dialog when the values are changed. You can just paste it into the slicer python console.<br><div><br></div><div><div>c = ctk.ctkCoordinatesWidget()</div><div>c.show()</div><div>c.connect('coordinatesChanged(double*)', lambda cc: qt.QMessageBox.information(None, 'coordinates', c.coordinates))</div></div></div><div><br></div><div><br></div><div>HTH,</div><div>Steve</div><div><br></div><div><br></div><div>[1] <a href="http://www.commontk.org/docs/html/classctkCoordinatesWidget.html#a0de7bec85eadf564e911d5c97679f4b9">http://www.commontk.org/docs/html/classctkCoordinatesWidget.html#a0de7bec85eadf564e911d5c97679f4b9</a><br></div><div><br></div><div>[2] <a href="http://www.commontk.org/docs/html/classctkCoordinatesWidget.html#af5509939618967dfd9515dc7637990c7">http://www.commontk.org/docs/html/classctkCoordinatesWidget.html#af5509939618967dfd9515dc7637990c7</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 8, 2015 at 8:00 PM, Perdomo, Jonathan <span dir="ltr"><<a href="mailto:jonathan_perdomo@med.unc.edu" target="_blank">jonathan_perdomo@med.unc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><span style="font-size:10pt">Hello everyone,</span><br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div><br>
</div>
<div>I hope this question has not been asked before, but I am just trying to add an observer to my CTK coordinates widget, so that I know whether or not the values have been modified by the user. I am writing this in Python as an extension for 3D Slicer. Any
example of how to add an observer to a widget in Python would be very helpful, as well as any sample code you may have, or resources you know of!</div>
<div><br>
</div>
<div>Thank you for your help,</div>
<div><br>
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma">
<div style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
<div name="divtagdefaultwrapper" style="margin:0px">
<div style="font-size:16px;font-family:Calibri,Arial,Helvetica,sans-serif;margin-top:0px;margin-bottom:0px">
</div>
<div style="margin-top:0px;margin-bottom:0px">
<div style="font-size:16px;margin-top:0px;margin-bottom:0px;background-color:rgb(255,255,255)">
<span style="font-size:10pt">Jonathan Perdomo<br>
</span></div>
<div style="margin-top:0px;margin-bottom:0px;background-color:rgb(255,255,255)">
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>_______________________________________________<br>
Ctk-developers mailing list<br>
<a href="mailto:Ctk-developers@public.kitware.com">Ctk-developers@public.kitware.com</a><br>
<a href="http://public.kitware.com/mailman/listinfo/ctk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/ctk-developers</a><br>
<br></blockquote></div><br></div>