Delivered-To: lablgtk at yquem.inria.fr Message-ID: <18356225.post at talk.nabble.com> Date: Wed, 9 Jul 2008 00:47:41 -0700 (PDT) From: Eddy2 To: lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] Gdk.color GTree.column ? In-Reply-To: <487463C8.8080707 at irisa.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit References: <4873715E.7080207 at irisa.fr> <18347849.post at talk.nabble.com> <487463C8.8080707@irisa.fr> Content-Type: text/plain; charset=us-ascii Content-Length: 1117 Hi, Sebastien Ferre-2 wrote: > > Is it possible to represent any color as a string ? I only > know the common colors as strings (e.g., white, blue, ...). > Yes you can do that ! In my first reply on this thread I gave you a piece of code which build a #RRGGBB string (for example "#0000FF" is a well-understood synonym of "green") and use it to fill the cell background. It's also very easy to build this string from RGB integers using Printf.sprintf : let string_of_rgb = Printf.sprintf "#%02x%02x%02x" let rgb_of_string s = Scanf.sscanf s "#%2x%2x%2x" (fun r g b -> r, g, b) But obviously you have to use "background" instead of "background-gdk" when setting the corresponding attribute. For instance : view_column#add_attribute cell_text "background" bg_color Hope this helps, Eddy -- View this message in context: http://www.nabble.com/Gdk.color-GTree.column---tp18339824p18356225.html Sent from the Lablgtk - France mailing list archive at Nabble.com. _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk