Example #1
0
 def __init__(self, style, width, height, ii=None):
     Style.from_param(style)
     err = Error()
     iip = None
     if ii:
         iip = ii._as_parameter_
     canvas = gtlib.gt_canvas_cairo_file_new(style._as_parameter_,
             GRAPHICS_PNG, width, height, iip, err._as_parameter_)
     if canvas == None:
         gterror(err)
     self.canvas = canvas
     self._as_parameter_ = self.canvas
Example #2
0
 def __init__(self, style, width, height, ii=None):
     Style.from_param(style)
     err = Error()
     iip = None
     if ii:
         iip = ii._as_parameter_
     canvas = gtlib.gt_canvas_cairo_file_new(style._as_parameter_,
                                             GRAPHICS_PNG, width, height,
                                             iip, err._as_parameter_)
     if canvas == None:
         gterror(err)
     self.canvas = canvas
     self._as_parameter_ = self.canvas
Example #3
0
    def from_index(feature_index, seqid, rng, style):
        from ctypes import byref
        FeatureIndex.from_param(feature_index)
        Style.from_param(style)

        err = Error()
        if rng.start > rng.end:
            gterror("range.start > range.end")
        diagram = gtlib.gt_diagram_new(feature_index._as_parameter_, seqid,
                byref(rng), style._as_parameter_, err._as_parameter_)
        if err.is_set():
            gterror(err)
        return Diagram(diagram)