do the window#show in the dispatcher thread

Ignore-this: e43b5a6f7a724bba9dd0957a7c1b8399

darcs-hash:20110921002225-c41ad-cd0cee9ced2fca7c0b399bbf392ff99ecdd37955
This commit is contained in:
Jeremie Dimino 2011-09-21 02:22:25 +02:00
parent ddf0556887
commit e2bd3d586b
1 changed files with 13 additions and 15 deletions

View File

@ -84,25 +84,12 @@ let init_history () =
return ()
(* +-----------------------------------------------------------------+
| Glib main loop |
| GTK ui |
+-----------------------------------------------------------------+ *)
(* Initializes GTK. *)
let _ = GMain.init ~setlocale:false ()
(* Glib main loop. *)
let main () =
while true do
Lwt_glib.iter ()
done
(* Start the glib main loop in another thread. *)
let _ = Thread.create main ()
(* +-----------------------------------------------------------------+
| GTK ui |
+-----------------------------------------------------------------+ *)
(* Create the main window. *)
let window = GWindow.window ~title:"utop" ~width:800 ~height:600 ~allow_shrink:true ()
@ -407,4 +394,15 @@ let () =
| None ->
edit#misc#modify_base [(`NORMAL, default_background ())]
let () = window#show ()
(* The glib main loop. *)
let main () =
(* For some reason, this must happen in the dispatcher thread on
windows. *)
window#show ();
while true do
Lwt_glib.iter ()
done
(* Start the glib main loop in another thread. *)
let _ = Thread.create main ()