Date: Thu, 07 Jul 2005 20:37:37 +0900 (JST) Message-Id: <20050707.203737.106262714.garrigue at math.nagoya-u.ac.jp> To: matthew.lakin at nevisys.co.uk Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Suppressing Gdk Warnings From: Jacques Garrigue In-Reply-To: <08274F3CA42017478C1A9114E2B186B632B8D2 at axiom1.cambridge.internal> References: <08274F3CA42017478C1A9114E2B186B632B8D2 at axiom1.cambridge.internal> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: "Matthew Lakin" > I have an application which uses Lablgtk2 under Windows XP. I have run > into a known bug in GTK > (http://bugzilla.gnome.org/show_bug.cgi?id=137796) which causes errors > of the form: "(camlprog.exe:1116): Gdk-WARNING **: > gdkdrawable-win32.c:1591: BitBlt failed: The handle is invalid." to fill > up the terminal window when the desktop is unlocked. This only happens > when the user enters their password after the screensaver has kicked in. > The number of such errors that appear depends on how many times the > window was redrawn while the desktop was locked. > > The errors themselves seem to be completely benign so is there any way > to trap and handle such warnings within LablGtk, to prevent them getting > written to the terminal? I have had a look through the documentation but > have not found anything yet. Alternatively, is there any workaround > known for this issue in LablGtk? You should be able to do it with the Glib.Message.set_log_handler function. Note that it only acts for one log-domain at a time. In your case, you would need Glib.Message.set_log_handler ~domain:"Gdk" ~levels:[`WARNING] (fun ~level s -> ()) Jacques