Re: yes/no dialog

> It happens that I accidentally click the Quit item on the main menu.
> Therefore I like to  change that item by adding a dialog which displays:
> Do you really want to quit Sawfish? and offering a Yes/No choice.
> Could anybody tell me how I can create such a dialog?

My solution is to have a couple of sub-menus that need to be executed
before you can log out.  Hitting the quit menu is harmless; you have
to do a couple of very careful submenu selections to exit successfully.

(setq root-menu
      '(("Windows" . window-menu)
	("Programs" . apps-menu)
	("Quick Connections" . quick-connections-menu)
	("Connections" . connections-menu)
	("Workspaces" . workspace-menu)
	("Customize" . custom-menu)
	 ("_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-menu)

(defvar quit-menu
    ("DON'T DO THIS!")
    ("Exit even though I really shouldn't"
     ("Exit and annoy Geoff.")
     ("Don't be surprised if Geoff gets angry about this.")
     ("Okay, I'll take the blame -- log him out" quit)))

(define (popup-quit-menu)
  "Display the quit menu."
  (popup-menu quit-menu))
(define-command 'popup-quit-menu popup-quit-menu)

    Geoff Kuenning   geoff cs hmc edu

McDonald's, which does not wait on your table, does not cook your food
to order, and does not clear your table, came up with the slogan ``We
Do It All For You.''
	-- Dave Barry

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