From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id AD2B0BDDB for ; Sat, 3 Sep 2005 12:34:21 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j83AYKh6024493 for ; Sat, 3 Sep 2005 12:34:20 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA22019 for ; Sat, 3 Sep 2005 12:34:19 +0200 (MET DST) Received: from mx1.polytechnique.org (mx1.polytechnique.org [129.104.30.34]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j83AYJgX027564 for ; Sat, 3 Sep 2005 12:34:19 +0200 Received: from [192.168.0.11] (falcal.net [81.56.73.55]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTP id 18EE933168; Sat, 3 Sep 2005 12:34:16 +0200 (CEST) In-Reply-To: <1125664781.7262.51.camel@localhost.localdomain> References: <20050830174757.99765.qmail@web30510.mail.mud.yahoo.com> <200508302001.58080.jon@ffconsultancy.com> <3d13dcfc05083101487092acd5@mail.gmail.com> <43168841.9000302@havenrock.com> <1125580528.7192.23.camel@localhost.localdomain> <1125646841.735.57.camel@acerf.exomi.com> <1125664781.7262.51.camel@localhost.localdomain> Mime-Version: 1.0 (Apple Message framework v734) Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-34--739913102; protocol="application/pkcs7-signature" Message-Id: <1A0BFF96-D811-4173-933F-F7BB69668856@m4x.org> Cc: Ville-Pertti Keinonen , Matt Gushee , caml-list@inria.fr From: Damien Bobillot Subject: Re: [Caml-list] Re: Feeding the OCaml GUI troll Date: Sat, 3 Sep 2005 12:34:17 +0200 To: skaller X-Mailer: Apple Mail (2.734) X-AV-Checked: ClamAV using ClamSMTP at djali.polytechnique.org (Sat Sep 3 12:34:19 2005 +0200 (CEST)) X-DCC--Metrics: djali 32702; Body=1 Fuz1=1 Fuz2=1 X-Org-Mail: damien.bobillot.2002@polytechnique.org X-Miltered: at concorde with ID 43197C2C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43197C2B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 ocaml:01 flowed:01 gui's:01 pointers:01 callbacks:01 callbacks:01 widget:01 widget:01 transformers:01 ocaml:01 apis:01 bindings: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=none autolearn=disabled version=3.0.3 --Apple-Mail-34--739913102 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed skaller wrote : > IMHO the *key* problem with GUI's -- and why real (TM) developers > hate using them -- is the lack of automation: unix script > sucks, but it does provide automation. If we're going to make > a new GUI it has to have full automation capability. I totally agree : in software development, GUI programming is one of the most boring phases. According to my experience, the main issue is GUI to core program communication, you have to : - programmatically get pointers to hundreds of GUI elements - programmatically install event callbacks for the same widgets - programmatically keep GUI element contents in synchronization with internal variables All this stuff is very easy to do, but often long, boring. Fortunately, you don't any more need to programmatically define your widgets (and their attributes, position), thanks to WYSIWYG GUI creation tools (Qtdesigner for Qt, Apple's Interface Builder, Visual Studio...). I think, the good idea is the automation of all this work. I'll give the solutions retained by Apple for Interface Builder : - the global variables/class member containing reference to widgets are automatically set-up. You just have to define them in your code and tell the GUI creation tool to which widgets each variables is bind to. - the user directly define the callbacks function in the GUI editor tool : you just have to give the name of the callback function. - any class member may be bind to the content of a widget : if the user types characters in a text field, the matching class member (a variable of type string) is automatically updated to contain the newly typed characters. If the programmer modify the value of this variable, the text field is automatically updated to the new value of the variable. Several widgets may be bond to one variable, several variable to one widget, and even a variable/widget may be bond to a file entry to enable persistent storage of the value (it's used for user preference storage). It's also possible to create transformers in order to do some type convertion when you use, for instance, a text field bond to a integer variable. I don't know if it is implementable in ocaml as is, or if it is really the good solution (it has been designed for the Objective-C language, using some of its very particular features). However, I think it gives a good idea of what is missing in current GUI APIs and GUI creation tools. Apple explanation of bindings : http://developer.apple.com/cocoa/cocoabindings.html -- Damien alias Schmurtz aim:goim?screenname=schmuuurtz --Apple-Mail-34--739913102 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGIjCCAtsw ggJEoAMCAQICAw54xzANBgkqhkiG9w0BAQQFADBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhh d3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVt YWlsIElzc3VpbmcgQ0EwHhcNMDUwNDEzMTc1MTAxWhcNMDYwNDEzMTc1MTAxWjBJMR8wHQYDVQQD ExZUaGF3dGUgRnJlZW1haWwgTWVtYmVyMSYwJAYJKoZIhvcNAQkBFhdkYW1pZW4uYm9iaWxsb3RA bTR4Lm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ1TOYBqwJ42s0Fzz56jY1p0 fplGyikFgoNEUKGnOpqt4vpeoqUppAnORt2yvdQJxfIkhsWkrD/diiPS7MTF73wcxlSJtqYzVzPK G/2WDm6dBinuWCIyWYFhtGedyxbap3kJW44H7cL7HUVVxZ0JhOIOTsjCoEzaeKnML7bctbIJeXEE lErfbDv2jA1PDG1ru5dx+Q+AmbexX92ygnntE6aX3QZLSbhrytg4yCRdV8cOyQ9eFruZBI42RJv3 nJXevjUOr4n+y/7bzijAJj4BFyUU+dllvj6bmk5brnUXheCSOD0Ci20dqGNC1MyJ43b6MoI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