Source

clutter-ocaml / src / clutterLabel.ml

open OclutterProps
open ClutterProps
open Clutter

class label_skel obj = object (self)
  inherit label_props
  inherit actor_props
  inherit ['a] ClutterActor.actor_skel (as_actor obj)
  method obj : label Clutter.obj = obj
end

class label_signals_impl obj = object
  inherit ['a] gobject_signals obj
  inherit actor_sigs
end

class type label_signals = label_signals_impl
  
class label obj = object
  inherit label_skel (obj : [> `label] Clutter.obj)
  method connect = new label_signals_impl obj
end

class label_class = label

let make_label ~create =
  Label.make_params ~cont:
    (fun pl ->
       Actor.make_params pl ~cont:
	 (fun pl () ->
	    let (e : #label_skel) = create pl in
	    e)
    )

let label =
  make_label [] ~create:
    (fun pl ->
       let t = Label.create pl in
       new label t)

let new_with_text font_name text = label ~font_name ~text