Delivered-To: lablgtk at yquem.inria.fr Message-ID: <4874CF28.503 at irisa.fr> Date: Wed, 09 Jul 2008 16:46:00 +0200 From: Sebastien Ferre Organization: IRISA MIME-Version: 1.0 To: lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] Gdk.color GTree.column ? References: <4873715E.7080207 at irisa.fr> <18347849.post@talk.nabble.com> <487463C8.8080707@irisa.fr> <18356225.post@talk.nabble.com> In-Reply-To: <18356225.post at talk.nabble.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Length: 1056 thanks, this perfectly answers my question! Sébastien Eddy2 wrote: > 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 > _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk