Stk.PropsSourceProperties and their values.
A property-to-value map. This is a mutable structure.
Exception raised when trying to register a property but a property with the same name is already registered. The argument is the property name.
Describre what to do after a property is updated:
Resize: widget will claim that it needs resizing.Render: widget will claim that it needs to be rendered.Action f: call f ().A property for values of type 'a.
Transition function. f ~start ~stop r returns the value corresponding to r in the range from start (r=0.0) to stop (r=1.0).
Get property transition function.
Get property post action list.
prop_to_string p v returns a string representation of a property value v, using the Ocf wrapper assoociated to property p.
pp_prop p ppf v pretty-prints value v of property p to formatter ppf.
What is required to handle a property value: a type, a comparison function and an optional Ocf wrapper.
type 'a mk_prop =
?after:'a post_action list ->
?default:'a ->
?inherited:bool ->
?transition:'a transition ->
string ->
'a propThe type of functions creating properties. The property name is required. The property is then registered in a table. Creating a property when a property with the same name already exists raises Property_exists. Options arguments are:
after: a description of actions to perform after the value of a property changed. This is used in widgets to automatically perform these actions.default: a default value for this property. This is the value returned by get when no value is defined for a property.inherited (default is true indicates whether the value for this property is inherited by a widget when this widget is added to a parent widget (see Widget.widget.set_parent).transition (default is the transition function of the datatype) indicates a transition function used when a delay is indicated when setting the property.Type a of property, with a function mk_prop to create properties of this type.
Creating a property type from a value description.
Top-right-bottom-left values.
trbl_ top right bottom left is a label-less equivalent of trbl_ ~top ~right ~bottom ~left.
trbl_of t copies t except fields given as optional arguments.
Ocf.wrapper for trbl, using the given wrapper for values.
The property-to-value map of each Object.o (including widgets) are referred to as their "properties". We add a props type to represent this denomination.
get t p returns the value of property p in t, or else the default value of p. If p has no value in t and p has no default value, then exception Misc.error.Missing_prop is raised.
set_opt t p (Some v) gives value v to property p in t. set_opt t p None removes value associated to p in t.
update t p v set value v to propery p in t. If v is the same as previousvalue for p in t, then returns None, else returns Some x with x being the optional previous value associated to p in t.
to_string t returns a string representation of t, mainly for debugging purpose.
pp ppf t pretty-prints t to the given formatter, using to_string.
merge t1 t2 returns a new !t using map merging function (see Map.S.merge). The optional argument use_inherited (false by default) change the way to handle the case where a property p has a value v in t1 and no value in t2. When use_inherited = false, p is given value v in the new map. When use_inherited = true, then p is given value v in the new map only if p was defined with ~inherited:true (which is the default, see mk_prop).
iter f t calls f on each property defined in t.
fold f t acc folds over properties defined in t.
All properties are not inherited, except when specified else. The name of a property is the same as its OCaml ident. For example property padding has name "padding", except is specified else.
Border color of a widget when mouse cursor in hovering.
Border color of a widget when its selected property is true.
Border color of a widget when its is_focus property is true.
How many shares of a container free space the widget requires to expand horizontally (see Pack.box.pack).
How many shares of a container free space the widget requires to expand vertically (see Pack.box.pack). Default is 1.
Whether the widget is sensitive, i.e. responds to user events. Default is true. Inherited.
The color mask to apply on insensitive widgets. Default is 0x80808044. Inherited.
Whether the widget should fill horizontally the allocated space. (used by some containers). Default is true.
Whether the widget should fill vertically the allocated space. (used by some containers). Default is true.
Horizontal alignment (not used by all widgets). 0. means align on the left, 1.0 means align on the right. Default is 0.5 (centered).
Same as halign but for vertical alignment (0.: align on top, 1.: align on bottom).
Width of a widget in pixels. Only some widgets use this property. Other widget's width depend on the way they are packed and their allocated width can be accessed through the Widget.widget.geometry method. Inherited.
Maximum width. This property may be used by container to ask their childre for additional constraint (not used by now). Negative value should be considered as no value.
Maximum height. This property may be used by container to ask their childre for additional constraint. (only used by Clist.column by now). Negative value should be considered as no value.
Whether background color should cover borders. Default is false.
Font description. Inherited. Default is family "DejaVu Sans" with size 14.
Whether font to use is bold. Inherited. If set, then the bold flag in font description is set accordingly when retrieving the corresponding SDL font.
Foreground color when widget has its selected property set to true. Inherited.
Foreground color when widget has its is_focus property set to true. Inherited.
Foreground color, use for example for text. Inherited. Remember that setting background color has no effect if fill property has value false.
Foreground color when widget has its selected property set to true. Inherited.
Foreground color when widget has its is_focus property set to true. Inherited.
Foreground color for selection in some widgets (like Textview.textview).
Background color for selection in some widgets (like Textview.textview).
Background color for input area. Default is 0xeeeeeeff. Inherited.
Color for "ghost" text (see ghost_text). Default is 0xccccccff. Inherited.
Background color of current line (in Textview.textview widget). Inherited.
Color mask applied on some widgets (buttons) when button is pressed. Default is 0xffffff88. Inherited.
Whether a widget has input focus. It means that the is_focus property is true for it and all its parent widgets, and its window has focus too. Default is false.
Whether the input focus can enter the widget or any of its children. Default is true.
Whether a widget getting the focus calls self#show. Default is true.
Widget is selected. The way this property is set depends on the widget. Default is false.
Text contents, used in some widgets (for example Text.label). Inherited.
Glyph contents (unicode codepoint), used in some widgets (for example Text.glyph). Inherited.
Ghost text t, i.e. hint text which disappears when user enters some text. Inherited.
Used by some widgets to indicate whether contents is editable (typically text input widgets). Default is true.
Used by some widgets (typically text input) to indicate the cursor width in pixels. Default is 2. Inherited.
Used by some widgets (typically text input) to indicate the cursor color. Default is Color.red. Inherited.
Used by some widgets (typically text input) to indicate the active cursor color. Default is Color.red. Inherited.
Scrollbar handle minimum size in pixels. Default is 40. Inherited.
Scrollbar handle color. Default is 0x2222dd00. Inherited.
Scrollbar background color. Default is 0xffffff99. Inherited. Since scrollbar (by now) is displayed over contents, the background should not be opaque.
Selection mode used by some widgets. Default is Sel_multiple.
Orientation used by several widgets. Default is Vertical.
Text vertical alignment for items in Flex.flex widget. Default is Baseline.
get_font_for_char t uchar returns the font fn to use for this char (using get_font, and returning fallback font (see Font.add_fallback_font) when character is not available in fn.
set_font_size t n sets font_desc in t by changing its size to n.
set_font_italic t b sets font_desc in t by changing its italic flag to b.
set_font_bold t b sets font_desc in t by changing its bold flag to b.
set_font_family t s sets font_desc in t by changing its font family to s.
set_font_underline t b sets font_desc in t by changing its underline flag to b.
set_font_strikethrough t b sets font_desc in t by changing its strikethrough flag to b.
set_font_kerning t b sets font_desc in t by changing its kerning flag to b.
set_font_outline t n sets font_desc in t by changing its outline to n.