From: Joe Van Dyk Date: 2005-06-23T01:38:50+09:00 Subject: Re: tk canvas question On 6/21/05, Hidetoshi NAGAI wrote: > From: Joe Van Dyk > Subject: Re: tk canvas question > Date: Wed, 22 Jun 2005 06:15:41 +0900 > Message-ID: > > 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?