123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135(**************************************************************************)(* Lablgtk *)(* *)(* This program is free software; you can redistribute it *)(* and/or modify it under the terms of the GNU Library General *)(* Public License as published by the Free Software Foundation *)(* version 2, with the exception described in file COPYING which *)(* comes with the library. *)(* *)(* This program is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Library General Public License for more details. *)(* *)(* You should have received a copy of the GNU Library General *)(* Public License along with this program; if not, write to the *)(* Free Software Foundation, Inc., 59 Temple Place, Suite 330, *)(* Boston, MA 02111-1307 USA *)(* *)(* *)(**************************************************************************)(* $Id$ *)openGauxopenGobjectopenGtkopenTagsopenGtkButtonPropsopenGtkBasemoduleButton=structincludeButtonletmake_params~contp?label?use_mnemonic?stock=letlabel,use_stock=matchstockwithNone->label,None|Someid->Some(GtkStock.convert_idid),Sometrueinmake_params~contp?label?use_underline:use_mnemonic?use_stockexternalpressed:[>`button]obj->unit="ml_gtk_button_pressed"externalreleased:[>`button]obj->unit="ml_gtk_button_released"externalclicked:[>`button]obj->unit="ml_gtk_button_clicked"externalenter:[>`button]obj->unit="ml_gtk_button_enter"externalleave:[>`button]obj->unit="ml_gtk_button_leave"endmoduleToggleButton=structincludeToggleButtonletcreate_checkpl:toggle_buttonobj=Object.make"GtkCheckButton"plexternaltoggled:[>`toggle]obj->unit="ml_gtk_toggle_button_toggled"endmoduleRadioButton=structincludeRadioButtonletcreate?groupp=create(Property.may_consP.groupgroupp)endmoduleToolbar=structincludeToolbar(*
external insert_space : [>`toolbar] obj -> pos:int -> unit
= "ml_gtk_toolbar_insert_space"
let insert_space w ?(pos = -1) () = insert_space w ~pos
external insert_button :
[>`toolbar] obj -> kind:[`BUTTON|`TOGGLEBUTTON|`RADIOBUTTON] ->
text:string -> tooltip:string ->
tooltip_private:string ->
icon:[>`widget] optobj -> pos:int -> button obj
= "ml_gtk_toolbar_insert_element_bc" "ml_gtk_toolbar_insert_element"
let insert_button w ?(kind=`BUTTON) ?(text="") ?(tooltip="")
?(tooltip_private="") ?icon ?(pos = -1) ?callback () =
let b =insert_button w ~kind ~text ~tooltip ~tooltip_private ~pos
~icon:(Gpointer.optboxed icon)
in
may callback ~f:
(fun callback -> GtkSignal.connect b ~sgn:Button.S.clicked ~callback);
b
external insert_widget :
[>`toolbar] obj -> [>`widget] obj ->
tooltip:string -> tooltip_private:string -> pos:int -> unit
= "ml_gtk_toolbar_insert_widget"
let insert_widget w ?(tooltip="") ?(tooltip_private="") ?(pos = -1) w' =
insert_widget w w' ~tooltip ~tooltip_private ~pos
external set_tooltips : [>`toolbar] obj -> bool -> unit =
"ml_gtk_toolbar_set_tooltips"
external get_tooltips : [>`toolbar] obj -> bool
= "ml_gtk_toolbar_get_tooltips"
*)letset?orientation?stylew=maystyle~f:(setP.toolbar_stylew);mayorientation~f:(Orientable.set_orientationw)externalunset_style:[>`toolbar]obj->unit="ml_gtk_toolbar_unset_style"(*
external get_icon_size : [>`toolbar] obj -> Tags.icon_size
= "ml_gtk_toolbar_get_icon_size"
external set_icon_size : [>`toolbar] obj -> Tags.icon_size -> unit
= "ml_gtk_toolbar_set_icon_size"
*)(* extended API in GTK 2.4 *)externalinsert:[>`toolbar]obj->[>`toolitem]obj->pos:int->unit="ml_gtk_toolbar_insert"externalget_item_index:[>`toolbar]obj->[>`toolitem]obj->int="ml_gtk_toolbar_get_item_index"externalget_n_items:[>`toolbar]obj->int="ml_gtk_toolbar_get_n_items"externalget_nth_item:[>`toolbar]obj->int->[`toolitem]obj="ml_gtk_toolbar_get_nth_item"externalget_drop_index:[>`toolbar]obj->int->int->int="ml_gtk_toolbar_get_drop_index"externalset_drop_highlight_item:[>`toolbar]obj->[>`toolitem]objoption->int->unit="ml_gtk_toolbar_set_drop_highlight_item"externalget_relief_style:[>`toolbar]obj->GtkEnums.relief_style="ml_gtk_toolbar_get_relief_style"endmoduleColorButton=ColorButtonmoduleFontButton=FontButtonmoduleLinkButton=structincludeLinkButtonexternalcreate:string->[>`linkbutton]obj="ml_gtk_link_button_new"externalcreate_with_label:string->string->[>`linkbutton]obj="ml_gtk_link_button_new_with_label"endmoduleToolItem=ToolItemmoduleSeparatorToolItem=SeparatorToolItemmoduleToolButton=ToolButtonmoduleToggleToolButton=ToggleToolButtonmoduleRadioToolButton=RadioToolButtonmoduleMenuToolButton=MenuToolButton