summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/browser/editor.ml
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2000-04-20 02:45:44 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2000-04-20 02:45:44 +0000
commitcd10f285b1056d02338b718b0c675d2e1765036a (patch)
tree18bbb0d9e29767ec6f4fa17de84157983973ad21 /otherlibs/labltk/browser/editor.ml
parentf07fed5f1bf8b0c0ef61346ae240fb7dad274391 (diff)
do not propose to cancel when you cannot do it
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3112 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/labltk/browser/editor.ml')
-rw-r--r--otherlibs/labltk/browser/editor.ml12
1 files changed, 6 insertions, 6 deletions
diff --git a/otherlibs/labltk/browser/editor.ml b/otherlibs/labltk/browser/editor.ml
index 70f02d33f..a5fbdfe74 100644
--- a/otherlibs/labltk/browser/editor.ml
+++ b/otherlibs/labltk/browser/editor.ml
@@ -473,20 +473,20 @@ class editor ~top ~menus = object (self)
method close_file () = self#close_window (List.hd windows)
- method quit () =
+ method quit ?(cancel=true) () =
try
List.iter windows ~f:
begin fun txt ->
if Textvariable.get txt.modified = "modified" then
- match Jg_message.ask ~master:top ~title:"Quit"
+ match Jg_message.ask ~master:top ~title:"Quit" ~cancel
("`" ^ Filename.basename txt.name ^ "' modified. Save it?")
with `yes -> self#save_text txt
| `no -> ()
| `cancel -> raise Exit
end;
bind top ~events:[`Destroy];
- destroy top; break ()
- with Exit -> break ()
+ destroy top
+ with Exit -> ()
method reopen ~file ~pos =
if not (Winfo.ismapped top) then Wm.deiconify top;
@@ -514,10 +514,10 @@ class editor ~top ~menus = object (self)
~action:(fun _ -> act (); break ())
end;
- bind top ~events:[`Destroy] ~breakable:true ~fields:[`Widget] ~action:
+ bind top ~events:[`Destroy] ~fields:[`Widget] ~action:
begin fun ev ->
if Widget.name ev.ev_Widget = Widget.name top
- then (break (); self#quit ())
+ then self#quit ~cancel:false ()
end;
(* File menu *)