Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Suppressing Gdk Warnings Date: Thu, 7 Jul 2005 13:28:39 +0100 Message-ID: <08274F3CA42017478C1A9114E2B186B632B8D8 at axiom1.cambridge.internal> Thread-Topic: Suppressing Gdk Warnings Thread-Index: AcWC6E9s5towACsNQZ6iFmUk/34aegABw2tQ From: "Matthew Lakin" To: "Jacques Garrigue" Cc: Content-Transfer-Encoding: 8bit Thanks a lot, that's exactly what I was looking for! Matt -----Original Message----- From: Jacques Garrigue [mailto:garrigue@math.nagoya-u.ac.jp] Sent: 07 July 2005 12:38 To: Matthew Lakin Cc: lablgtk@math.nagoya-u.ac.jp Subject: Re: Suppressing Gdk Warnings 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