Re: how to use simple-dialog in widget-dialog.jl

>> There is a file called widget-dialog.jl which includes a function
>> called simple-dialog which I guess is capable of creating a simple
>> dialog window, accept user input (yes or no) and return the result to
>> sawfish.
> Hi, Daniel. It'll be a bit of challenge. From lisp/sawfish/gtk/README
> which I'll create soon:
> ------------------------------------------------------------------------
> This directory contains components, or "widgets" for sawfish-config,
> *not* raw gtk widgets.
> For example, 'boolean' is defined in widget.jl, among other widgets.
> This is used to define boolean option, and it shows checkbox, for
> example in:
>  (defcustom warp-to-window-enabled nil
>    "Whether to enable warping the cursor to windows."
>    :type boolean
>    :group (misc warp))
> ------------------------------------------------------------------------
> So, you can learn from widget-dialog.jl, but it's not an out-of-box
> use.

Okay, thanks.

> If you know the basics of gtk, then it's not so difficult to creat a
> dialog box. Have a look at examples/ in rep-gtk. (Bah, gtk-dialog.jl
> breaks your Sawfish session.

What do you mean by 'breaks your sawfish session'?

There is this in gtk-dialog.jl

(defun yes-or-no-p (question)
  (gtk-dialog question '("Yes" . t) '("No" . nil)))

(defun y-or-n-p (q)
  (yes-or-no-p q))

which seems the kind of thing I need. Since I'm pretty much illiterate
in lisp, how can I call these lisp functions from the rep console?

> Yet I know some codes there indeed work.)
> Any gtk instance has to be run in a seperate process. (Even the menus
> of Sawfish are so.) So, the simplest one will look like this:
> ------------------------------------------------------------------------
> #!/bin/sh
> exec rep
> !#
> ;; lisp code is here
> ------------------------------------------------------------------------
> Now, it has to communicate with Sawfish. It can be done by running
> sawfish-client from the above lisp code.

Oh, this seems too complicated. If I need a bash script and some more
magic, I'd rather use zenity. It's very simple to create dialogs from
zenity from a bash script and this would work very well, but would
introduce zenity dependence into my sawfish kit. So, if possible, I'd
like to use a lisp solution from sawfish only.


Psss, psss, put it down! -

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