I'm a newbie so please be patient... :)
def canvas(self):
import qt
self.setCaption('My Canvas')
c = qtcanvas.QCanvas(self) # <- gives the canvas a parent QObject
c.resize(315, 207)
v = qtcanvas.QCanvasView(self)
v.setGeometry(QRect(200,590,321,211))
lay = qt.QVBoxLayout(self)
lay.addWidget(v)
v.setCanvas(c)
l = qtcanvas.QCanvasLine(c)
l.setPen(qt.QPen(qt.Qt.black))
l.setPoints(10,10,390,390)
l.show()
v.show()
c.update()
l1 = qtcanvas.QCanvasLine(c)
l1.setPen(qt.QPen(qt.Qt.red))
l1.setPoints(20,60,10,230)
l1.show()
l2 = qtcanvas.QCanvasLine(c)
l2.setPen(qt.QPen(qt.Qt.blue))
l2.setPoints(10,66,99,310)
l2.show()
c.update()
rec = qtcanvas.QCanvasRectangle(c)
rec.setSize(133,370)
rec.setPen(qt.QPen(qt.Qt.magenta))
rec.show()
c.update()
Some experimental simple code above that works fine in an embedded canvas. What I need to do it take the xy pairs starting with "PD" from a text file (file enclosed) and display them scaled to fit the small canvas. I'm going to use sed to cut into "SP" groups the xy pairs bewteen the colors specified in the text file by "SP1" "SP2" etc. and assign a variable so they can be turned on and off with xxx.show(). I'll be honest I am lost. I've read so much on the web my head is spinning can anyone kind of lay the ground work out for me to get started with?
Thanks very much