package frama-c

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Box Layouts.

type box

A packed widget with its layout directives

type expand =
  1. | W
    (*

    Stay at widget's size.

    *)
  2. | H
    (*

    Expands horizontally. Typically, a text-field.

    *)
  3. | V
    (*

    Expands vertically. Typically a side-bar.

    *)
  4. | HV
    (*

    Expands in both directions. Typically, a text editor.

    *)

Expansion Modes.

val box : ?expand:expand -> ?padding:int -> ?widget:Widget.widget -> unit -> box

Generic packing. Without ~widget, a space is created instead.

Defaults: ~expand:W ~padding:0.

val g : ?expand:expand -> ?padding:int -> GObj.widget -> box

Helper to box for packing a GObj.widget. Same defaults than box.

val w : ?expand:expand -> ?padding:int -> Widget.widget -> box

Helper to box for packing a widget. Same defaults than box.

val h : ?padding:int -> Widget.widget -> box

w ~expand:H

val v : ?padding:int -> Widget.widget -> box

w ~expand:V

val hv : ?padding:int -> Widget.widget -> box

w ~expand:HV

val label : ?fill:bool -> ?style:Widget.style -> ?align:Widget.align -> ?padding:int -> string -> box

Helper to pack a Widget.label widget using box.

Default: ~fill:false ~style:`Label ~align:`Left ~padding:0

hbox and vbox can be used to created nested boxes. Typically, local scope opening can be used, typically: Wbox.(hbox [ w A ; w B ; w C ]), where A, B and C are widgets, or boxes.

Notice that nested boxes can generally be packed using default W mode, even if they contains horizontal or vertical widgets.

val hbox : box list -> Widget.widget

Pack a list of boxes horizontally.

val vbox : box list -> Widget.widget

Pack a list of boxes vertically.

val hgroup : Widget.widget list -> Widget.widget

Pack a list of widgets horizontally, with all widgets stuck to the same width

val vgroup : Widget.widget list -> Widget.widget

Pack a list of widgets vertically, with all widgets stuck to the same width

val toolbar : box list -> box list -> Widget.widget

The first list is packed to the left side of the toolbar. The second list is packed to the right side of the toolbar.

val sidebar : box list -> box list -> Widget.widget

The first list is packed to the top of the sidebar. The second list is packed to the bottom of the sidebar.

val panel : ?top:Widget.widget -> ?left:Widget.widget -> ?right:Widget.widget -> ?bottom:Widget.widget -> Widget.widget -> Widget.widget

Helper to create a full featured window: ~top is layout as a toolbar, left and right as sidebars, and bottom as a status bar. The main (non-optional) widget is centered with full expansion in both directions.

class type splitter = object ... end
val split : dir:[ `HORIZONTAL | `VERTICAL ] -> Widget.widget -> Widget.widget -> splitter
val scroll : ?hpolicy:[ `AUTOMATIC | `ALWAYS | `NEVER ] -> ?vpolicy:[ `AUTOMATIC | `ALWAYS | `NEVER ] -> Widget.widget -> Widget.widget

default policy is AUTOMATIC

val hscroll : Widget.widget -> Widget.widget

Same as scroll ~vpolicy:`NEVER

val vscroll : Widget.widget -> Widget.widget

Same as scroll ~volicy:`NEVER

OCaml

Innovation. Community. Security.