From: Hidetoshi NAGAI Date: 2004-12-04T12:36:14+09:00 Subject: Re: hide/show items on TkCanvas? Hi, From: "R. Mark Volkmann" Subject: hide/show items on TkCanvas? Date: Sat, 4 Dec 2004 11:11:28 +0900 Message-ID: <039d01c4d9a6$8e9e8b10$0200a8c0@MarkDesktop> > If I have an item on a TkCanvas such as a Rectangle, is there a way to hide > it temporarily and then show it later? > Hopefully I don't have to delete it and recreate it later. Probably, the simplest way is to move the item to out of the canvas's scrollregion. For exampke, when the scrollregion of the canvas is (min_x, min_y, max_x, max_y), you can hide the item by item.move(-(max_x - min_x), -(max_y - min_y)) and show it by item.move(max_x - min_x, max_y - min_y). Of course, if the part of the item exists on the out of the scrollregion, you never forget the out_of_range part when decide the moving delta. Then, bbox method (and canvas tags) may be useful. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)