On Tue, Jul 20, 2004 at 09:30:32AM +0200, Xavier Ordoquy wrote: > On Mon, 2004-07-19 at 18:04 -0400, Eric Newman wrote: > > Hi all, > > Hi > > > Do you know of any way to draw an arc (elliptical or circular) on a gnome > > canvas from python? I've googled around and searched the archives to no > > avail. The only solutions I have come up with are drawing the arc in a > > pixmap and drawing that to the canvas (no antialiasing), or trying to fit a > > Bpath to the shape of an arc (too CPU-intensive to be doing this in python > > for so many arcs). I just thought it was weird that the lower level gtk > > drawing area has the arc functionality, but the gnome canvas does not. Am I > > missing something? > > A quick look to the C examples shows that they are using bpath to create > ellipses. > > GnomeCanvasPathDef *path_def; > > path_def = gnome_canvas_path_def_new(); > > gnome_canvas_path_def_moveto(path_def, 500.0, 175.0); > gnome_canvas_path_def_curveto(path_def, 550.0, 175.0, 550.0, > 275.0, 500.0, 275.0); > setup_item(gnome_canvas_item_new(root, > gnome_canvas_bpath_get_type(), > "bpath", path_def, > "outline_color", "black", > "width_pixels", 4, > NULL)); > gnome_canvas_path_def_unref(path_def); > > You'll have to port the code to python however.
If anyone's brave enough to do this, consider submitting it for addition to the FAQ, it's definitely a nice thing to include. Take care, -- Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331 _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
