From: nagai@... Date: 2003-03-11T13:46:22+09:00 Subject: Re: Ruby/Tk :: Root window backgrounds? Hi, From: kryptik@usa.com Subject: Ruby/Tk :: Root window backgrounds? Date: Sun, 9 Mar 2003 17:57:02 +0900 Message-ID: <20030309085657.60426.qmail@mail.com> > Is there a way to set a background img or color to your root window? > I would like to use a img or color to give my app a desktop like feel. > Is it possible, or is this something tk is lacking? Well, maybe need a little tricky way. The way is to use two geometry manager on same widget. For example, ---------------------------------------------------- require 'tk' image = TkPhotoImage.new('file'=>'background.gif', 'height'=>200, 'width'=>200) root = TkRoot.new TkLabel.new(root, 'image'=>image).place('in'=>root, 'relheight'=>1.0, 'relwidth'=>1.0) TkButton.new(root, 'text'=>'TOP').pack('side'=>'top') TkButton.new(root, 'text'=>'BOTTOM').pack('side'=>'bottom') Tk.mainloop ---------------------------------------------------- Each of Place and Pack geometry manager doesn't know other geometry manager. So Pack geometry manager has no attention to existence of the label widget with the image controlled by Place geometry manager. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)