summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/builtin/dialog.ml
blob: 84e5274bf728bfeb1d7c56521894c3aee13bdf2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
let create ~parent ~title ~message ~buttons ?name
    ?(bitmap = `Predefined "") ?(default = -1) () =
  let w = Widget.new_atom "toplevel" ?name ~parent in
  let res = tkEval [|TkToken"tk_dialog";
                     cCAMLtoTKwidget w;
                     TkToken title;
                     TkToken message;
                     cCAMLtoTKbitmap bitmap;
                     TkToken (string_of_int default);
                     TkTokenList (List.map ~f:(fun x -> TkToken x) buttons)|]
   in
    int_of_string res