Delivered-To: garrigue at math.nagoya-u.ac.jp Delivered-To: lablgtk at yquem.inria.fr Message-ID: <21173775.post at talk.nabble.com> Date: Fri, 26 Dec 2008 04:12:34 -0800 (PST) From: Eddy2 To: lablgtk at yquem.inria.fr Subject: [Lablgtk] GButton.color_button, Gdk.color and GDraw.pixmap MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello ! I'm currently writing a little toy program (labyrinth generator). In order to let the user choose the wall and cell colors, I've added two GButton.color_button widgets to the main window. The drawings are done in a backing widget (GDraw.pixmap), and the foreground color is set up with pixmap#set_foreground. Curiously, the following code does not seem to do the job : pixmap#set_foreground (`COLOR color_button#color) I need to use this auxiliary function : let convert color = let r = Gdk.Color.red color and g = Gdk.Color.green color and b = Gdk.Color.blue color in `NAME (Printf.sprintf "#%02x%02x%02x" (r lsr 8) (g lsr 8) (b lsr 8)) pixmap#set_foreground (convert color_button#color) Thus, it seems that red, green and blue values use 16 bits in color_button, and only 8 bits in pixmap. Can you explain me this (somewhat weird) difference ? -- View this message in context: http://www.nabble.com/GButton.color_button%2C-Gdk.color-and-GDraw.pixmap-tp21173775p21173775.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