From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id C9E02BDCB for ; Tue, 30 Aug 2005 18:25:18 +0200 (CEST) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.196]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j7UGPInk018422 for ; Tue, 30 Aug 2005 18:25:18 +0200 Received: by nproxy.gmail.com with SMTP id a4so389784nfc for ; Tue, 30 Aug 2005 09:25:18 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=W4aIGhBWOFGCoq9x35zhklS6NM3BYnUKzo+bK7Yc7/M/x+/rsKnCU0rhbOArmm+OcWVgSKGMMKwUOpAWNU/K5A8LBCEwOD6k3uePm5QcNWaSYnvx6xJeyhcgU+hOEnBe/BDenfMzw2RNhZI3vgLbwexN63uNWf3Fo9+loTLIR6c= Received: by 10.48.1.14 with SMTP id 14mr368591nfa; Tue, 30 Aug 2005 09:25:18 -0700 (PDT) Received: by 10.48.247.14 with HTTP; Tue, 30 Aug 2005 09:25:18 -0700 (PDT) Message-ID: Date: Tue, 30 Aug 2005 17:25:18 +0100 From: Chris Campbell To: Jon Harrop Subject: Re: GUI for OCaml (was: Re: [Caml-list] Does LablTk have a future?) Cc: caml-list@yquem.inria.fr In-Reply-To: <200508301701.49824.jon@ffconsultancy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4311DA63.4010104@havenrock.com> <3d13dcfc050830001671d0974f@mail.gmail.com> <20050830141430.GA16012@furbychan.cocan.org> <200508301701.49824.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 4314886E.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 caml-list:01 labltk:01 lablgtk:01 gtk:01 lablgtk:01 ocaml:01 api:01 snippets:01 labltk:01 guis:01 ...:98 ...:98 wrote:01 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 First, I hate AJAX. Breaks the back button! :( Yes, this is the second time I've written this email. On 30/08/05, Jon Harrop wrote: > On Tuesday 30 August 2005 15:14, Richard Jones wrote: > > Lablgtk2 is a pain, but I think the pain comes from Gtk itself, not > > any shortcomings in lablgtk2 or ocaml. >=20 > Yes. My understanding is that lablgtk does a lot to hide the hideousness > beneath. >=20 > > > However this is a huge task. [...] > > > > It is a huge task. >=20 > Depending on what exactly we're talking about, I think it is entirely > tractable for one person, let alone a team. >=20 > > I'm not even sure what a "functional" API for a > > GUI toolkit would look like. Ideas? Example code snippets? >=20 > I think the GUI code should be split into definition (i.e. how the widget= s are > laid out) and execution (i.e. what functions are called for GUI events). = The > former should be functional in style because it is easier to write and mo= re > succinct and the latter should be imperative in style because it is > essentially poking a state machine about. =20 This sounds like QTk. It is a wrapper to Tk that uses records (tuples and atoms are records in Oz) and call backs to implement the gui.=20 It's quite effective. In Oz, your example would look something like this... (warning, last Oz use was a while ago) Qtk.build td(lr(label:"Search" text(handle: H)) (lr(button(text:"Add" action:P) Where P and H are call back procedures. > Perhaps we should start by writing such a wrapper that can target either > labltk or lablgtk? Make it independant to a degree. Most GUIs offer the same functionality an= yway. Chris