You'll find the technical reference to the Gnome canvas at this URL: http://www.gnome.org/devel/docs/libgnomeui/gnome-objects.html And attached are the Python bindings to the canvas classes. If you want a Python example, the Loci Workspace I have been working on is probably one of the most complete. I think Mavric may also be a good place to look. :-) Jeff "Alan J. Williams" wrote: > > Yeah, I've already checked those out. I was just wondering if there was > any tutorals or annotated docs on the canvas. I haven't found any and it > would seem that at this point the only way to get to know how to program > the canvas would be to look at other source code. > > On Tue, 22 Jun 1999, J.W. Bizzaro wrote: > > > Does anyone know of any good references on the Gnome Canvas? > > > > Do you mean documentation, as in whitepapers? There is a page at the Gnome site > > with just about all of the information that is available: > > > > http://www.gnome.org/devel/canvas/ > > ************************************************************************ > Alan Williams > ------------------------------------------------------------------------ > University of California, Riverside "Where observation is concerned, > Dept. of Botany and Plant Sciences chance favors the prepared mind." > Alan at TheWilliamsFamily.org -- Louis Pasteur > ************************************************************************ > > _______________________________________________ > pipet-devel maillist - pipet-devel at bioinformatics.org > http://bioinformatics.org/mailman/listinfo/pipet-devel -- J.W. Bizzaro mailto:bizzaro at bc.edu Boston College Chemistry http://www.uml.edu/Dept/Chem/Bizzaro/ -- -------------- next part -------------- class GnomeCanvas(_gtk.GtkLayout): get_type = _gnomeui.gnome_canvas_get_type def __init__(self, aa=_gtk.FALSE, _obj=None): if _obj: self._o = _obj; return if aa: self._o = _gnomeui.gnome_canvas_new_aa() else: self._o = _gnomeui.gnome_canvas_new() def root(self): return GnomeCanvasGroup( _obj=_gnomeui.gnome_canvas_root(self._o)) def set_scroll_region(self, x1,y1, x2,y2): _gnomeui.gnome_canvas_set_scroll_region(self._o, x1,y1, x2,y2) def get_scroll_region(self): return _gnomeui.gnome_canvas_get_scroll_region(self._o) def set_pixels_per_unit(self, n): _gnomeui.gnome_canvas_set_pixels_per_unit(self._o, n) def set_size(self, width, height): print "GnomeCanvas.set_size deprecated -- use set_usize" self.set_usize(width, height) def scroll_to(self, cx, cy): _gnomeui.gnome_canvas_scroll_to(self._o, cx, cy) def get_scroll_offsets(self): return _gnomeui.gnome_canvas_get_scroll_offsets(self._o) def update_now(self): _gnomeui.gnome_canvas_update_now(self._o) def get_item_at(self, x, y): ret = _gnomeui.gnome_canvas_get_item_at(self._o, x, y) if (ret): return _obj2inst(ret) return None def request_redraw(self, x1,y1, x2,y2): _gnomeui.gnome_canvas_request_redraw(self._o, x1,y1, x2,y2) def w2c(self, wx, wy): return _gnomeui.gnome_canvas_w2c(self._o, wx, wy) def c2w(self, cx, cy): return _gnomeui.gnome_canvas_c2w(self._o, cx, cy) def get_color(self, spec): return _gnomeui.gnome_canvas_get_color(self._o, spec) def set_stipple_origin(self, gc): _gnomeui.gnome_canvas_set_stipple_origin(self._o, gc) _gtk._name2cls['GnomeCanvas'] = GnomeCanvas class GnomeCanvasItem(_gtk.GtkObject): get_type = _gnomeui.gnome_canvas_item_get_type def __init__(self, _obj=None): if _obj: self._o = _obj; return def set(self, **args): _filtprops(args) _gnomeui.gnome_canvas_item_set(self._o, args) def move(self, dx, dy): _gnomeui.gnome_canvas_item_move(self._o, dx, dy) def affine_relative(self, affine): _gnomeui.gnome_canvas_item_affine_relative(self._o, affine) def affine_absolute(self, affine): _gnomeui.gnome_canvas_item_affine_absolute(self._o, affine) def raise_(self, positions): _gnomeui.gnome_canvas_item_raise(self._o, positions) def lower(self, positions): _gnomeui.gnome_canvas_item_lower(self._o, positions) def raise_to_top(self): _gnomeui.gnome_canvas_item_raise_to_top(self._o) def lower_to_bottom(self): _gnomeui.gnome_canvas_item_lower_to_bottom(self._o) def show(self): _gnomeui.gnome_canvas_item_show(self._o) def hide(self): _gnomeui.gnome_canvas_item_hide(self._o) def grab(self, mask, cursor, event_time): _gnomeui.gnome_canvas_item_grab(self._o, mask, cursor, event_time) def ungrab(self, event_time): _gnomeui.gnome_canvas_item_ungrab(self._o, event_time) def reparent(self, new_group): _gnomeui.gnome_canvas_item_reparent(self._o, new_group._o) def grab_focus(self): _gnomeui.gnome_canvas_item_grab_focus(self._o) def get_bounds(self): return _gnomeui.gnome_canvas_item_get_bounds(self._o) def w2i(self, x, y): return _gnomeui.gnome_canvas_item_w2i(self._o, x, y) def i2w(self, x, y): return _gnomeui.gnome_canvas_item_i2w(self._o, x, y) _gtk._name2cls['GnomeCanvasItem'] = GnomeCanvasItem class GnomeCanvasGroup(GnomeCanvasItem): """has arguments 'x' and 'y'. eg you can go new_item('group', x=4)""" get_type = _gnomeui.gnome_canvas_group_get_type def add(self, tp, **args): types = { 'item': _gnomeui.gnome_canvas_item_get_type, 'group': _gnomeui.gnome_canvas_group_get_type, 'icon_text':_gnomeui.gnome_icon_text_item_get_type, 'image': _gnomeui.gnome_canvas_image_get_type, 'line': _gnomeui.gnome_canvas_line_get_type, 'polygon': _gnomeui.gnome_canvas_polygon_get_type, 're': _gnomeui.gnome_canvas_re_get_type, 'rect': _gnomeui.gnome_canvas_rect_get_type, 'ellipse': _gnomeui.gnome_canvas_ellipse_get_type, 'text': _gnomeui.gnome_canvas_text_get_type, 'widget': _gnomeui.gnome_canvas_widget_get_type } if type(tp) == type('string'): tp = types[tp]() _filtprops(args) return _obj2inst(_gnomeui.gnome_canvas_item_new(self._o, tp, args)) def new_item(self, tp, **args): print "I renamed this func to GnomeCanvasGroup.add" return apply(self.add, (tp,), args) _gtk._name2cls['GnomeCanvasGroup'] = GnomeCanvasGroup class GnomeCanvasImage(GnomeCanvasItem): """has arguments 'image', 'x', 'y', 'width', 'height', 'anchor'""" get_type = _gnomeui.gnome_canvas_image_get_type _gtk._name2cls['GnomeCanvasImage'] = GnomeCanvasItem class GnomeCanvasLine(GnomeCanvasItem): """has arguments 'points', 'fill_color', 'width_pixels', 'width_units', 'cap_style', 'join_style', 'first_arrowhead', 'last_arrowhead', 'smooth', 'spline_steps', 'arrow_shape_a', 'arrow_shape_b', 'arrow_shape_c'""" get_type = _gnomeui.gnome_canvas_line_get_type _gtk._name2cls['GnomeCanvasLine'] = GnomeCanvasLine class GnomeCanvasPolygon(GnomeCanvasItem): """has argyments 'points', 'fill_color', 'fill_color_gdk', 'outlint_color', 'outline_color_gdk', 'fill_stipple', 'outline_stipple', 'width_pixels', 'width_units'""" get_type = _gnomeui.gnome_canvas_polygon_get_type _gtk._name2cls['GnomeCanvasPolygon'] = GnomeCanvasPolygon class GnomeCanvasRE(GnomeCanvasItem): """has arguments 'x1', 'y1', 'x2', 'y2', 'fill_color', 'outline_color', 'width_pixels', 'width_units'""" get_type = _gnomeui.gnome_canvas_re_get_type _gtk._name2cls['GnomeCanvasRE'] = GnomeCanvasRE class GnomeCanvasRect(GnomeCanvasRE): """has arguments of GnomeCanvasRE""" get_type = _gnomeui.gnome_canvas_rect_get_type _gtk._name2cls['GnomeCanvasRect'] = GnomeCanvasRect class GnomeCanvasEllipse(GnomeCanvasRE): """has arguments of GnomeCanvasRE""" get_type = _gnomeui.gnome_canvas_ellipse_get_type _gtk._name2cls['GnomeCanvasEllipse'] = GnomeCanvasEllipse class GnomeCanvasText(GnomeCanvasItem): """has arguments 'text', 'x', 'y', 'font', 'anchor', 'justification', 'fill_color'""" get_type = _gnomeui.gnome_canvas_text_get_type _gtk._name2cls['GnomeCanvasText'] = GnomeCanvasText class GnomeCanvasWidget(GnomeCanvasItem): """has arguments 'widget', 'x', 'y', 'width', 'height', 'anchor', 'size_pixels'""" get_type = _gnomeui.gnome_canvas_widget_get_type _gtk._name2cls['GnomeCanvasWidget'] = GnomeCanvasWidget