From: "Olivier Andrieu" <oandrieu@nerim.net>
To: "Matt Gushee" <matt@gushee.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] LablGTK2: problem w/ GMain.Io
Date: Mon, 8 May 2006 20:25:51 +0200 (CEST) [thread overview]
Message-ID: <59824.213.41.240.180.1147112751.squirrel@webmail.nerim.net> (raw)
In-Reply-To: <445E4697.3010109@gushee.net>
Hi,
> I have a GUI application (the Bantam file manager) that I originally
> wrote in LablTk, and have just ported to LablGTK2. I wrote most of the
> code on a Slackware 10.1 box using GODI with OCaml 3.08.4 and LablGTK2
> 20040716. The GTK2 version is 2.6.1. After implementing all current
> features in GTK and eliminating most of the known serious bugs, I built
> and installed the package on my other Linux box, which runs Arch Linux
> 0.7.1, with Ocaml-3.09.2, GTK2-2.8.17, and LablGTK2-2.6.0.
>
> Since I found startup to be a bit slow with GTK, I implemented a 'daemon
> mode' for the application. When you start it in daemon mode, the GUI is
> initialized, but remains hidden until it receives a '%show' command via
> a named pipe. Also, when you 'quit' the application via a keystroke
> command or the window manager, it actually only hides the main window.
> To actually quit the application in daemon mode, you send a '%quit'
> command via the above-mentioned pipe.
>
> Here's the problem: on the development (Slackware) box, I had the app
> running in both normal (GUI shows on startup & is destroyed by quitting)
> and daemon modes with no apparent problems. On the second box, normal
> mode works fine; the app will also run in daemon mode. But when I
> attempt to send a command to the app in daemon mode, I get the following
> error message:
>
> ** (bantam.bin:13244): CRITICAL **: GIOChannel watch: callback raised \
> an exception
That's because your callback raised an exception (!). LablGTK traps
uncaught exceptions from callbacks instead of re-raising them and exiting
the main loop. For signals, there is a user-overridable handler that
simply prints the exception name to stderr ; for other types of callbacks
(IO watches, timeouts, etc.) you simply get this error message.
In your code you should wrap your "watcher" function in a try...with block
and print the exception using Printexc.to_string to see what's going
wrong.
--
Olivier
next prev parent reply other threads:[~2006-05-08 18:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-07 19:12 Matt Gushee
2006-05-08 18:25 ` Olivier Andrieu [this message]
2006-05-11 22:05 ` [Caml-list] " Matt Gushee
2006-05-11 23:13 ` Matthew Hannigan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59824.213.41.240.180.1147112751.squirrel@webmail.nerim.net \
--to=oandrieu@nerim.net \
--cc=caml-list@inria.fr \
--cc=matt@gushee.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox