123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111(**************************************************************************)(* 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$ *)openStdLabelsopenGauxopenGobjectopenGtkopenGtkBaseopenOgtkBasePropsopenGtkContainersopenOgtkContainersPropsopenGObjopenGDataopenContainerclassfocusobj=objectvalobj=obj(* method circulate = focus obj *)methodset(child:widgetoption)=letchild=may_mapchild~f:(funx->x#as_widget)inset_focus_childobj(Gpointer.optboxedchild)methodset_hadjustmentadj=set_focus_hadjustmentobj(Gpointer.optboxed(may_mapadj~f:as_adjustment))methodset_vadjustmentadj=set_focus_vadjustmentobj(Gpointer.optboxed(may_mapadj~f:as_adjustment))endclass['a]container_implobj=object(self)inherit['a]widget_implobjinheritcontainer_propsmethodaddw=addobj(as_widgetw)methodremovew=removeobj(as_widgetw)methodchildren=List.map~f:(newwidget)(childrenobj)methodall_children=letl=ref[]inforallobj~f:(funw->l:=newwidgetw::!l);List.rev!lmethodfocus=newfocusobjendclasscontainer=['a]container_implclasscontainer_signals_implobj=objectinheritwidget_signals_implobjinheritcontainer_sigsendclasstypecontainer_signals=container_signals_implclasscontainer_fullobj=objectinheritcontainerobjmethodconnect=newcontainer_signals_implobjendletcast_container(w:widget)=newcontainer_full(castw#as_widget)letpack_container~create=Container.make_params~cont:(funp?packing?show()->pack_return(createp)~packing~show)class['a]bin_implobj=objectinherit['a]container_implobjmethodchild=newwidget(Bin.get_childobj)endclassbin=['a]bin_implclassvirtual['a]item_containerobj=object(self)inherit['b]widget_implobjinheritcontainer_propsmethodadd(w:'a)=addobjw#as_itemmethodremove(w:'a)=removeobjw#as_itemmethodprivatevirtualwrap:Gtk.widgetobj->'amethodchildren:'alist=List.map~f:self#wrap(childrenobj)methodall_children=letl=ref[]inforallobj~f:(funw->l:=self#wrapw::!l);List.rev!lmethodfocus=newfocusobjmethodvirtualinsert:'a->pos:int->unitmethodappend(w:'a)=self#insertw~pos:(-1)methodprepend(w:'a)=self#insertw~pos:0end