|
From: | Paul Emsley |
Subject: | Re: X11 bindings and shell bindings |
Date: | Thu, 18 Sep 2008 18:16:09 +0100 |
User-agent: | Thunderbird 2.0.0.16 (Macintosh/20080707) |
Ishan Arora wrote:
I guess there may be a way via X11, but it is not clear to me. What you might want to be doing is knowing the coordinates of a click in a canvas, which is not the same thing (and easier).Hi, Is there a procedure to get mouse position.
And is there a procedure to synchronously run a shell code and return the output as a String. Thanks.
;; code from thi <ttn at mingle.glug.org> ;; ;; run command and put the output into a string and return ;; it. (c.f. @code{run-command/strings}) (define (shell-command-to-string cmd) (with-output-to-string (lambda () (let ((in-port (open-input-pipe cmd))) (let loop ((line (read-line in-port 'concat))) (or (eof-object? line) (begin (display line) (loop (read-line in-port 'concat))))))))) Paul.
[Prev in Thread] | Current Thread | [Next in Thread] |