[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby/Tk: How to specify default background colour

u235321044

4/21/2006 8:28:00 AM

I find the default colour assignment for Tk widgets (kind of a dark-green over a something I could best describe a muddy brown) a bit
difficult to read, and therefore would like to use a different
background colour for my widget.

In my first attempt, I just assigned a new background colour to the
TkRoot object, but this colour information is not inherited by the
child widgets. Of course I can, for each child widget, explicitly
configure the background colour, but I wonder whether there is
maybe an easier way to do this.





--
Sent by mn-pg-p-e-b-consultant-3.com from siemens part from com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-re...
1 Answer

Ronald Otto Valentin

4/26/2006 7:50:00 AM

0


Ronald Fischer schrieb:

> I find the default colour assignment for Tk widgets (kind of a dark-green over a something I could best describe a muddy brown) a bit
> difficult to read, and therefore would like to use a different
> background colour for my widget.

I found the solution! Here is how I did it:

Before entering the main loop, I use the statements

$dft_background="#F8E8EE"
TkOption.add("*foreground","blue")
TkOption.add("*background",$dft_background)

Then, when creating the root widget, I write

TkRoot.new() { background $dft_background }

This together has the desired effect.

Ronald