# Removing All Traces of Drawn Widgets From Ruby/Tk Canvas

**URL:** <https://www.ruby-forum.com/t/removing-all-traces-of-drawn-widgets-from-ruby-tk-canvas/54504>\
**Category:** Ruby\
**Created:** [March 7, 2006, 8:34am UTC](https://www.ruby-forum.com/t/removing-all-traces-of-drawn-widgets-from-ruby-tk-canvas/54504 "2006-03-07T08:34:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [March 7, 2006, 8:34am UTC](https://www.ruby-forum.com/t/removing-all-traces-of-drawn-widgets-from-ruby-tk-canvas/54504/1 "2006-03-07T08:34:45Z")

</div>

Greetings Ruby Community:

Question: How do I effectively erase a filled rectangle to reveal the  
RubyTk canvas’ background “color” beneath it? I’m having a tough time  
trying to "remove’ all traces of the filled widgets that I’ve drawn.

Details: I created a TkcRectange on a TkCanvas using a fill option color  
of, say, ‘antique white’. I then needed to “remove” the rectangle, but  
when I wrote over it without the fill option specified, thinking that  
that would “erase” the original rectangle, it didn’t and instead left  
the first rectangle’s color in place, inferring that the background  
“color” is transparent. So I have temporarily been using color ‘grey83’  
to overwrite my rectangles to get as close as possible to the background  
grey of the canvas. And, hey, nobody wants to embody their ignorance in  
code! I am using Ruby 1.8.2 under Windows 2000 Professional.

Note: I am new to Ruby, but I have been thumbing through the pickaxe  
book, and reading through various Ruby web resource pages, (for a few  
days now, I am almost embarrassed to admit (:\>) ), all to no avail. So  
far, I have not as yet been able to figure out how I can reveal that  
oddish grey color of the RubyTk canvas after I write over it with  
various widgets. Any help or direction on this problem will be greatly  
appreciated.

Best regards,

David B.

removed\_email\_address@domain.invalid  
removed\_email\_address@domain.invalid: MS Messenger  
dbailey7: AOL IM  
db7bd: Yahoo IM  
220816592: ICQ
