Catching the XML window savage destroy

This commit is contained in:
Pascal Brisset
2006-03-13 15:44:46 +00:00
parent 7b3f9a79e8
commit 1f6033e151
3 changed files with 11 additions and 9 deletions
+9 -7
View File
@@ -480,10 +480,18 @@ module Edit = struct
| None -> f ()
let close_fp = fun geomap () ->
match !current_fp with
None -> () (* Nothing to close *)
| Some (fp, filename) ->
fp#destroy ();
current_fp := None
let load_xml_fp = fun geomap ?(xml_file=path_fps) xml ->
set_georef_if_none geomap (georef_of_fp xml);
let fp = new MapFP.flight_plan geomap "red" fp_dtd xml in
fp#show_xml ();
fp#window#show ();
ignore (fp#window#connect#destroy ~callback:(close_fp geomap));
current_fp := Some (fp,xml_file);
fp
@@ -544,12 +552,6 @@ module Edit = struct
| Some (fp,_) ->
ignore (fp#add_waypoint geo)
let close_fp = fun geomap () ->
match !current_fp with
None -> () (* Nothing to close *)
| Some (fp, filename) ->
fp#destroy ();
current_fp := None
let save_fp = fun geomap () ->
match !current_fp with
+1 -1
View File
@@ -113,7 +113,7 @@ class flight_plan = fun geomap color fp_dtd xml ->
object
val mutable max_dist_from_home = max_dist_from_home
method georef = ref_wgs84
method show_xml () = xml_window#show ()
method window = xml_window
method destroy () =
wpts_group#group#destroy ();
xml_window#destroy ()
+1 -1
View File
@@ -38,7 +38,7 @@ class flight_plan :
method hide : unit -> unit
method index : XmlEdit.node -> int * MapWaypoints.waypoint
method show : unit -> unit
method show_xml : unit -> unit
method window : GWindow.window
method waypoints : XmlEdit.node list
method xml : Xml.xml
end