Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby/Tk: How to specify default background colour

Reply
Thread Tools

Ruby/Tk: How to specify default background colour

 
 
Ronald Fischer
Guest
Posts: n/a
 
      04-21-2006
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-replayer.com
 
Reply With Quote
 
 
 
 
Ronny
Guest
Posts: n/a
 
      04-26-2006

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
What is the point of having 16 bit colour if a computer monitor can only display 8 bit colour? How do you edit 16 bit colour when you can only see 8 bit? Scotius Digital Photography 6 07-13-2010 03:33 AM
Getting default colour for <input> - or just the old colour jodleren Javascript 2 01-12-2008 02:57 PM
Colour blindness, photography and colour management Tor Lillqvist Digital Photography 12 05-24-2004 08:57 AM
changing a background image to a background colour? Dj Frenzy Javascript 3 02-10-2004 08:08 PM



Advertisments