package bogue

  1. Overview
  2. Docs

Source file b_empty.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(* This file is part of BOGUE, by San Vu Ngoc *)

(* An empty widget. Does not draw anything, but can be used to get mouse focus,
   and to execute an action when unloading. *)

type t = {
  mutable size: int * int;
  mutable unload : unit -> unit
  }

let on_unload t f =
  t.unload <- f

let size e = e.size

let create ?(unload=fun () -> ()) size =
  { size; unload }

let resize size t =
  t.size <- size

let free _ = ()

let unload t = t.unload ()

let display _ _ _ _ = []