Delivered-To: lablgtk at yquem.inria.fr Message-ID: <47A39F6C.2060605 at rice.edu> Date: Fri, 01 Feb 2008 16:38:36 -0600 From: Gregory Malecha MIME-Version: 1.0 To: Jacques Garrigue Subject: Re: [Lablgtk] GnomeCanvas Enumerate Items References: <20080105.170933.98869039.garrigue at math.nagoya-u.ac.jp> <47A01A5D.8030706 at rice.edu> <20080130.161111.48533977.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20080130.161111.48533977.garrigue at math.nagoya-u.ac.jp> Content-Transfer-Encoding: 7bit Cc: lablgtk at yquem.inria.fr Reply-To: gmalecha at rice.edu Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Length: 1659 Thanks for the help. Now I've come upon another problem. I'm failing to see how I'm suppose to get the properties of something like this. For example, I have a polygon and I want to iterate through the points or get the background color. Thanks. Jacques Garrigue wrote: > From: Gregory Malecha > >> I was able to get most of this working using wrap_item. There are a few >> cases that it apparently doesn't handle though. Mainly group, text, >> rich_text, etc, the ones that aren't GnoCanvas.items. Here's the code >> that I have: >> >> type annotated_item = >> Group of GnomeCanvas.group_p GnoCanvas.item (* I'd like this to be >> GnoCanvas.group *) >> > [...] > >> else if GnomeCanvas.Types.is_a item GnomeCanvas.Types.group then >> let gp = GnoCanvas.wrap_item item GnomeCanvas.Types.group in >> Group gp >> > [..] > >> Does anyone know of a way to get a GnoCanvas.group rather than a >> GnomeCanvas.group_p GnoCanvas.item when performing the cast? >> > > Since you have already checked that it has the right type, you can use > Gobject.unsafe_cast. > > new GnomeCanvas.group (Gobject.unsafe_cast item) > > Looks safe enough to me. > > Jacques > --------------------------------------------------------------------------- > Jacques Garrigue Nagoya University garrigue at math.nagoya-u.ac.jp > JG > > -- gregory malecha wiess college computer science 219.510.3400 _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk