Re: yes/no dialog

On 10/22/06, Manfred Lotz <manfred lotz arcor de> wrote:
> You can override the menu definitions. Read about it here,

However, I didn't find how to override the root-menu or to replace the
root menu with my own root menu.

You will have to set the new menu definition to the "root-menu"
variable. I hope you are comfortable with lisp (and rep, the dialect
used in sawfish).

If you check the ./lisp/sawfish/wm/menus.jl file in sawfish, root-menu
is set to a lisp form like this,

 (defvar root-menu
   `((,(_ "_Windows") . window-menu)
     (,(_ "Work_spaces") . workspace-menu)
     (,(_ "_Programs") . apps-menu)
     (,(_ "_Customize") . custom-menu)
     (,(_ "_Help")
      (,(_ "_FAQ...") help:show-faq)
      (,(_ "_News...") help:show-news)
      (,(_ "_WWW page...") help:show-homepage)
      (,(_ "_Manual...") help:show-programmer-manual)
      (,(_ "_About Sawfish...") help:about))
     (,(_ "_Restart") restart)
     (,(_ "_Quit") quit)))

You should be able to write your own lisp function `my-restart' and
replace it in root-menu. Fiddle with your .sawfishrc ...

> For the dialog logic, you can use Xdialog or even better zenity,

The problem with zenity is that I don't know how to hand over the
zenity return code to sawfish.

E.g. when calling (system "zenity --warning&") I want
to quit Sawfish if I clicked Ok and I want to cancel quit if I clicked
Cancel. How can I get returncodes 0 or 1 into Sawfish?

Look at the program (zenity) exit code. For eg., I clicked on 'Cancel'
in this case.

srid homeless:~$ zenity --warning
srid homeless:~$ echo $?
srid homeless:~$


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