- let rc = ref `YES in
- let callback =
- function
- | `YES -> rc := `YES
- | `NO -> rc := `NO
- | `CANCEL -> rc := `CANCEL
- | `DELETE_EVENT -> rc := `CANCEL
- | `POPUPCLOSED -> rc := `CANCEL
- in
- let buttons = [`YES,`YES ; `NO,`NO ; `CANCEL,`CANCEL] in
- popup_message_lowlevel
- ~title ~message ~message_type:`WARNING ~callback ~buttons ?parent ();
- !rc
+ GtkThread.sync (fun _ ->
+ let buttons = [`YES,`YES ; `NO,`NO ; `CANCEL,`DELETE_EVENT] in
+ popup_message_lowlevel
+ ~title ~message ~message_type:`WARNING ~buttons ?parent ()
+ ) ()