5 #include <caml/mlvalues.h>
6 #include <caml/alloc.h>
7 #include <caml/memory.h>
8 #include <caml/callback.h>
19 #define GtkMenuItem_val(val) check_cast(GTK_MENU_ITEM,val)
20 ML_0 (gtk_menu_item_new, Val_GtkWidget_sink)
21 ML_0 (gtk_tearoff_menu_item_new, Val_GtkWidget_sink)
22 ML_1 (gtk_menu_item_new_with_label, String_val, Val_GtkWidget_sink)
23 ML_2 (gtk_menu_item_set_submenu, GtkMenuItem_val, GtkWidget_val, Unit)
24 ML_1 (gtk_menu_item_remove_submenu, GtkMenuItem_val, Unit)
25 ML_2 (gtk_menu_item_set_placement, GtkMenuItem_val,
26 Submenu_placement_val, Unit)
27 ML_3 (gtk_menu_item_configure, GtkMenuItem_val, Bool_val, Bool_val, Unit)
28 ML_1 (gtk_menu_item_activate, GtkMenuItem_val, Unit)
29 ML_1 (gtk_menu_item_right_justify, GtkMenuItem_val, Unit)
31 /* gtkcheckmenuitem.h */
33 #define GtkCheckMenuItem_val(val) check_cast(GTK_CHECK_MENU_ITEM,val)
34 ML_0 (gtk_check_menu_item_new, Val_GtkWidget_sink)
35 ML_1 (gtk_check_menu_item_new_with_label, String_val, Val_GtkWidget_sink)
36 ML_2 (gtk_check_menu_item_set_active, GtkCheckMenuItem_val, Bool_val, Unit)
37 ML_2 (gtk_check_menu_item_set_show_toggle, GtkCheckMenuItem_val,
39 ML_1 (gtk_check_menu_item_toggled, GtkCheckMenuItem_val, Unit)
40 Make_Extractor (gtk_check_menu_item_get, GtkCheckMenuItem_val,
43 /* gtkradiomenuitem.h */
45 #define GtkRadioMenuItem_val(val) check_cast(GTK_RADIO_MENU_ITEM,val)
46 static GSList* item_group_val(value val)
48 return (val == Val_unit ? NULL :
49 gtk_radio_menu_item_group(GtkRadioMenuItem_val(Field(val,0))));
51 ML_1 (gtk_radio_menu_item_new, item_group_val, Val_GtkWidget_sink)
52 ML_2 (gtk_radio_menu_item_new_with_label, item_group_val,
53 String_val, Val_GtkWidget_sink)
54 ML_2 (gtk_radio_menu_item_set_group, GtkRadioMenuItem_val,
59 #define GtkOptionMenu_val(val) check_cast(GTK_OPTION_MENU,val)
60 ML_0 (gtk_option_menu_new, Val_GtkWidget_sink)
61 ML_1 (gtk_option_menu_get_menu, GtkOptionMenu_val, Val_GtkWidget_sink)
62 ML_2 (gtk_option_menu_set_menu, GtkOptionMenu_val, GtkWidget_val, Unit)
63 ML_1 (gtk_option_menu_remove_menu, GtkOptionMenu_val, Unit)
64 ML_2 (gtk_option_menu_set_history, GtkOptionMenu_val, Int_val, Unit)
68 #define GtkMenuShell_val(val) check_cast(GTK_MENU_SHELL,val)
69 ML_2 (gtk_menu_shell_append, GtkMenuShell_val, GtkWidget_val, Unit)
70 ML_2 (gtk_menu_shell_prepend, GtkMenuShell_val, GtkWidget_val, Unit)
71 ML_3 (gtk_menu_shell_insert, GtkMenuShell_val, GtkWidget_val, Int_val, Unit)
72 ML_1 (gtk_menu_shell_deactivate, GtkMenuShell_val, Unit)
76 #define GtkMenu_val(val) check_cast(GTK_MENU,val)
77 ML_0 (gtk_menu_new, Val_GtkWidget_sink)
78 ML_5 (gtk_menu_popup, GtkMenu_val, GtkWidget_val, GtkWidget_val,
79 Insert(NULL) Insert(NULL) Int_val, Int_val, Unit)
80 ML_1 (gtk_menu_popdown, GtkMenu_val, Unit)
81 ML_1 (gtk_menu_get_active, GtkMenu_val, Val_GtkWidget)
82 ML_2 (gtk_menu_set_active, GtkMenu_val, Int_val, Unit)
83 ML_2 (gtk_menu_set_accel_group, GtkMenu_val, GtkAccelGroup_val, Unit)
84 ML_1 (gtk_menu_get_accel_group, GtkMenu_val, Val_GtkAccelGroup)
85 ML_1 (gtk_menu_ensure_uline_accel_group, GtkMenu_val, Val_GtkAccelGroup)
86 value ml_gtk_menu_attach_to_widget (value menu, value widget)
88 gtk_menu_attach_to_widget (GtkMenu_val(menu), GtkWidget_val(widget), NULL);
91 ML_1 (gtk_menu_get_attach_widget, GtkMenu_val, Val_GtkWidget)
92 ML_1 (gtk_menu_detach, GtkMenu_val, Unit)
96 #define GtkMenuBar_val(val) check_cast(GTK_MENU_BAR,val)
97 ML_0 (gtk_menu_bar_new, Val_GtkWidget_sink)