A widget can hold an optional value of the wdata extensible type. This is useful to store application specific data directly in some widgets rather than storing them in a map aside.
Widget class
Sourceclassvirtualwidget : ?class_:string option->?name:string option->?props:Props.t option->
unit ->object ... end
The base widget class. It contains methods to be called by children widgets, event if the base class does not handle child widgets.
Widget arguments
All widget classes handle the following optional arguments, which are handled by the convenient functions provided to create widgets (like Bin.scrollbox):
class_ specifies the class name of the widget. This is used to retrieve its default properties. The default class_ of a widget is defined by its class. class_ for a widget class is usually set to the same name as the class; for example, Bin.scrollbox widgets have a default class_ set to "scrollbox".
name specifies the name of the widget. This is useful for debugging purposes and default properties can also be associated to names. Default name is equal to class_ value.
props specifies properties to use in addition to the default properties associated to class_ and name. Propertes props are merged with the default properties, with Props.merge. This is useful to override or add some properties at widget creation.
Convenient functions also handle a pack optional argument. It is a function called with the created widget coerced to widget type, and is usually used to pack or add the created widget to another one.
Sourceval may_pack : ?pack:(widget-> unit)->< coerce : widget.. >-> unit
may_pack ?pack w will apply the pack function if provided, to widget w. This is used by convenient functions, usually to pack a creatd widget, hence the name.