2002-04-26 05:16:26 -07:00
|
|
|
##ifdef CAMLTK
|
|
|
|
|
|
|
|
let create ?name parent title mesg bitmap def buttons =
|
|
|
|
let w = Widget.new_atom "toplevel" ~parent ?name in
|
|
|
|
let res = tkEval [|TkToken"tk_dialog";
|
2002-07-23 07:12:03 -07:00
|
|
|
cCAMLtoTKwidget widget_any_table w;
|
|
|
|
TkToken title;
|
|
|
|
TkToken mesg;
|
|
|
|
cCAMLtoTKbitmap bitmap;
|
|
|
|
TkToken (string_of_int def);
|
|
|
|
TkTokenList (List.map (function x -> TkToken x) buttons)|]
|
2002-04-26 05:16:26 -07:00
|
|
|
in
|
|
|
|
int_of_string res
|
|
|
|
;;
|
|
|
|
|
|
|
|
let create_named parent name title mesg bitmap def buttons =
|
|
|
|
let w = Widget.new_atom "toplevel" ~parent ~name in
|
|
|
|
let res = tkEval [|TkToken"tk_dialog";
|
2002-07-23 07:12:03 -07:00
|
|
|
cCAMLtoTKwidget widget_any_table w;
|
|
|
|
TkToken title;
|
|
|
|
TkToken mesg;
|
|
|
|
cCAMLtoTKbitmap bitmap;
|
|
|
|
TkToken (string_of_int def);
|
|
|
|
TkTokenList (List.map (function x -> TkToken x) buttons)|]
|
2002-04-26 05:16:26 -07:00
|
|
|
in
|
|
|
|
int_of_string res
|
|
|
|
;;
|
|
|
|
|
|
|
|
##else
|
|
|
|
|
2000-04-11 20:43:25 -07:00
|
|
|
let create ~parent ~title ~message ~buttons ?name
|
|
|
|
?(bitmap = `Predefined "") ?(default = -1) () =
|
|
|
|
let w = Widget.new_atom "toplevel" ?name ~parent in
|
1999-11-30 06:59:39 -08:00
|
|
|
let res = tkEval [|TkToken"tk_dialog";
|
|
|
|
cCAMLtoTKwidget w;
|
|
|
|
TkToken title;
|
|
|
|
TkToken message;
|
|
|
|
cCAMLtoTKbitmap bitmap;
|
|
|
|
TkToken (string_of_int default);
|
2000-04-11 20:43:25 -07:00
|
|
|
TkTokenList (List.map ~f:(fun x -> TkToken x) buttons)|]
|
1999-11-30 06:59:39 -08:00
|
|
|
in
|
|
|
|
int_of_string res
|
2002-04-26 05:16:26 -07:00
|
|
|
;;
|
|
|
|
|
|
|
|
##endif
|