Browse thread
Does LablTk have a future?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Richard Jones <rich@a...> |
| Subject: | Re: [Caml-list] Re: Feeding the OCaml GUI troll |
We face a similar problem, connecting database fields to GUI widgets.
We came up with a concept of a "tied reference" variable. Included
below is the interface - you can probably work out how it works. It
has to be said that it wasn't particularly successful, and still
required lots of manual and repetitive work to make it happen.
Luckily we ditched that project for financial reasons :-)
Rich.
------------------------------------------------------------ tiedref.mli
(* Tied references.
* Copyright (C) 2003 Merjis Ltd.
* $Id: tiedref.mli,v 1.2 2003/12/02 13:22:01 rich Exp $
*)
type 'a tiedref
val tiedref : read:(unit -> 'a) -> write:('a -> unit) -> 'a tiedref
val ( !* ) : 'a tiedref -> 'a
val ( *:= ) : 'a tiedref -> 'a -> unit
------------------------------------------------------------ dbtiedref.mli
(* Database-backed tied references.
* Copyright (C) 2003 Merjis Ltd.
* $Id: dbtiedref.mli,v 1.3 2004/03/08 13:44:25 rich Exp $
*)
open Tiedref
type dbrow
val dbrow : Dbi.connection -> string -> string -> Dbi.sql_t list -> dbrow
type 'a dbfield
val dbfield_bool_not_null : string -> bool dbfield
val dbfield_bool : string -> bool option dbfield
val dbfield_int_not_null : string -> int dbfield
val dbfield_int : string -> int option dbfield
val dbfield_string_not_null : string -> string dbfield
val dbfield_string : string -> string option dbfield
val dbtiedref : dbrow -> 'a dbfield -> 'a tiedref
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com