do the window#show in the dispatcher thread
Ignore-this: e43b5a6f7a724bba9dd0957a7c1b8399 darcs-hash:20110921002225-c41ad-cd0cee9ced2fca7c0b399bbf392ff99ecdd37955
This commit is contained in:
parent
ddf0556887
commit
e2bd3d586b
|
@ -84,25 +84,12 @@ let init_history () =
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
(* +-----------------------------------------------------------------+
|
(* +-----------------------------------------------------------------+
|
||||||
| Glib main loop |
|
| GTK ui |
|
||||||
+-----------------------------------------------------------------+ *)
|
+-----------------------------------------------------------------+ *)
|
||||||
|
|
||||||
(* Initializes GTK. *)
|
(* Initializes GTK. *)
|
||||||
let _ = GMain.init ~setlocale:false ()
|
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. *)
|
(* Create the main window. *)
|
||||||
let window = GWindow.window ~title:"utop" ~width:800 ~height:600 ~allow_shrink:true ()
|
let window = GWindow.window ~title:"utop" ~width:800 ~height:600 ~allow_shrink:true ()
|
||||||
|
|
||||||
|
@ -407,4 +394,15 @@ let () =
|
||||||
| None ->
|
| None ->
|
||||||
edit#misc#modify_base [(`NORMAL, default_background ())]
|
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 ()
|
||||||
|
|
Loading…
Reference in New Issue