[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: X11 bindings and shell bindings

From: Paul Emsley
Subject: Re: X11 bindings and shell bindings
Date: Thu, 18 Sep 2008 18:16:09 +0100
User-agent: Thunderbird (Macintosh/20080707)

Ishan Arora wrote:

Is there a procedure to get mouse position.
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).

And is there a procedure to synchronously run a shell code and return the output as a String. Thanks.
;; code from thi <ttn at>
;; run command and put the output into a string and return
;; it. (c.f. @code{run-command/strings})
(define (shell-command-to-string cmd)
   (lambda ()
     (let ((in-port (open-input-pipe cmd)))
   (let loop ((line (read-line in-port 'concat)))
     (or (eof-object? line)
       (display line)
       (loop (read-line in-port 'concat)))))))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]