Hi all,

I am a beginner, so I hope not to post too trivial question, but I am 
trying to understand how to do the following: assume I have defined two 
ROIs and I set the event to print "Hi" when I finish to move a ROI.
I am able to print "Hi" when I move ANY of the two ROIs, but how can 
recognize WHICH ROI I moved? Like printing "Hi I moved ROI N. 1" or "Hi I 
moved ROI N. 2" ?

Here a simple code to explain better my question:

import pyqtgraph as pg

app = pg.mkQApp("Examples")
win = pg.GraphicsLayoutWidget(show=True, size=(800,800), border=True)
win.setWindowTitle('ROI Example')

plot = win.addPlot()
plot.setXRange(0,10)
plot.setYRange(0,10)

rois=[]
rois.append(pg.ROI(pos=[3,5],size=[1,1]))
rois.append(pg.ROI(pos=[7,5],size=[1,1]))

for roi in rois:
    plot.addItem(roi)
    roi.sigRegionChangeFinished.connect(lambda: print('Hi'))

pg.exec()

Thanks in advance for any help
Salvatore

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/b77307cb-e46c-46b9-8e2c-44a8c92ee588n%40googlegroups.com.

Reply via email to