Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] version 7 beta typing change?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christoph Bauer <c_bauer@i...>
Subject: Re: [Caml-list] Re: Tcl/Tk and RH 9
Eray Ozkural <exa@kablonet.com.tr> writes:

> It is now going to sound "bold" to you people, but I don't understand why you 
> can't write the ultimate portable GUI toolkit in ocaml itself. With a 
> language as generic as ocaml it should be a no-brainer to efficiently 
> abstract over peculiarities of windows systems.

It's just too boring to create another platform independent GUI toolkit.
What about to extend lablgtk through camlp4 quotations so that
something like the following line is possible:

let window = << Button ~label:"Quit" ~callback:GMain.Main.quit >>

(equivalent to Tcl/Tk code:
pack [button .b -text Quit -command quit])


or

let editor_window = 
    << VBox 
        [Menu ["File" ["Open" ~callback:open; 
                       "Save" ~callback:save]; 
                        "Help" ["About" ~callback:about]];
         text = Text ~width:80 ~height:24;
         HBox [Button ~label:"Open" ~callback:open; 
               Button ~label:quit ~callback:Main.quit]] >>
                         
The Camlp4 had to 
  * create implizit the window widget
  * generate unused symbols (like the button name)
    but export the widget "text"
  * generate packing (vbox#add) 

Such code is better to maintain and it needs less time
to write. What do you think?

Regards,
Christoph


-- 
proc self {} {foreach c [split [info body self] ""] d {14 -7 0 0 4 -67 4 73 11
69 24 -83 -15 6 -4 -84 78 20 11 -78 -1 -1 79 19 -8 4} { binary scan $c c c
if {[catch {append r [format %c [expr $c+$d]]}]} {return $r};}};puts [self]

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners