let edit_sourceview_props ?modal ?(preview=apply_sourceview_props_to_registered) () =
let d = GWindow.dialog ?modal ~type_hint: `DIALOG ~width: 400 ~height: 600 () in
let box = new sourceview_props_box preview in
let f_ok () =
(
match box#props with
None -> ()
| Some p -> store_sourceview_props p; preview p
);
d#destroy ()
in
let f_cancel () =
let p = read_sourceview_props () in
preview p;
d#destroy ()
in
box#set_props (Some (read_sourceview_props ()));
d#vbox#pack ~expand: true ~fill: true box#box;
d#add_button_stock `OK `OK;
d#add_button_stock `CANCEL `CANCEL;
match d#run () with
`OK -> f_ok ()
| `CANCEL
| `DELETE_EVENT -> f_cancel ()