update gl.py to show how to add an annotation
[mussa.git] / py / gl.py
index 450b1bd0e4f5e9f690894b66d96807d8ba5769e1..a068a414dc873d0fc8decc49e4eac5702ad21f9f 100644 (file)
--- a/py/gl.py
+++ b/py/gl.py
@@ -13,10 +13,15 @@ class pyMussaGL:
     # make up a simple sequence
     self.s = "AAGGCCTT" * 5
     self.seq = mussa.Sequence(self.s)
+
+    # add our annotation
+    annot = mussa.annot(0, 5, "name", "type")
+    self.seq.add_annotation(annot)
+
     # AnnotationColors is required, even though it'd be nice
     # if it were optional
     self.glseq = mussa.GlSequence(self.seq, mussa.AnnotationColors())
-    assert len(self.s) == self.glseq.length
+    assert len(self.s) == self.glseq.size
 
     # set up opengl buffer
     glutInit(sys.argv)