From: Olivier Andrieu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16476.29143.422239.542096 at karryall.dnsalias.org> Date: Sat, 20 Mar 2004 17:31:19 +0100 To: Henri Binsztok Cc: lablgtk at kaba.or.jp Subject: Re: GnoCanvas question In-Reply-To: <1079790058.22467.30.camel at seamaster> References: <1079790058.22467.30.camel at seamaster> Henri Binsztok [Saturday 20 March 2004] : > > Hi > > I am beginning to use lablgtk, and while many things just work, one > problem persist. > > I want to delete all items from the whole canvas or a given > GnoCanvas.group (canvas#root or another). Therefore, I tried > unsuccessfully two ways: > > - List.iter canvas#remove canvas#children > which does not work, since canvas#children is always an empty list... Yes: canvas is a GtkWidget, derived from GtkContainer. That's where the #children method comes from. However the GnomeCanvasItem are not widgets so they do not appear in this list. > - Use group#get_items, which gives a GnomeCanvas.item Gobject.obj list, > but then to use the GnoCanvas.item#destroy method, I need to convert > those items, which I couldn't figure out :( You can simply destroy them directly with GtkBase.Widget.destroy : List.iter GtkBase.Widget.destroy group#get_items -- Olivier