On 6/22/05, Joe Van Dyk <joevandyk / gmail.com> wrote: > On 6/21/05, Hidetoshi NAGAI <nagai / ai.kyutech.ac.jp> wrote: > > From: Joe Van Dyk <joevandyk / gmail.com> > > Subject: Re: tk canvas question > > Date: Wed, 22 Jun 2005 06:15:41 +0900 > > Message-ID: <c715e64050621141518afc887 / mail.gmail.com> > > > I found this code out there somewhere: > > (snip) > > > grp.add(TkcRectangle.new(canvas, '1c', '2c', '3c', '3c', > > > 'outline' => 'black', 'fill' => 'blue')) > > > > Please use TkcGroup#include. > > For example, > > ----------------------------------------------- > > require "tk" > > > > canvas = TkCanvas.new > > grp = TkcGroup.new(canvas) > > grp.include(TkcRectangle.new(canvas, '1c', '2c', '3c', '3c', > > 'outline' => 'black', 'fill' => 'blue'), > > TkcRectangle.new(canvas, '3c', '4c', '5c', '5c', > > 'outline' => 'black', 'fill' => 'blue')) > > canvas.pack > > > > grp.bind 'Enter' do > > grp.configure 'fill', 'red' > > end > > grp.bind 'Leave' do > > grp.configure 'fill', 'green' > > end > > Tk.mainloop > > ----------------------------------------------- > > > > TkcGroup has some bugs. > > I'll fix it later. And then, I'll revive TkcGroup#add. > > How can I hide and/or destroy all TkCanvas items that are in a group? Apparently, I can just delete the group. I'm not sure why it didn't work before, but it is now.