caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] labltk and ocaml 3.01
@ 2001-05-10  9:38 a9502276
  2001-05-10 10:02 ` Jacques Garrigue
  0 siblings, 1 reply; 2+ messages in thread
From: a9502276 @ 2001-05-10  9:38 UTC (permalink / raw)
  To: caml-list

Hello!

I'm completely new to FP and Caml in particular.

I downloaded camltk417-2 and tried helloworld.ml:

administrator@NTWSW2KJH /cygdrive/d/Temp
$ labltk.exe helloworld.ml
File "helloworld.ml", line 9, characters 10-184:
Expecting function has type
  ?name:string ->
  ?activebackground:Tk.color ->
  ?activeforeground:Tk.color ->
  ?anchor:Tk.anchor ->
  ?background:Tk.color ->
  ?bitmap:Tk.bitmap ->
  ?borderwidth:int ->
  ?command:(unit -> unit) ->
  ?cursor:Tk.cursor ->
  ?disabledforeground:Tk.color ->
  ?font:string ->
  ?foreground:Tk.color ->
  ?height:int ->
  ?highlightbackground:Tk.color ->
  ?highlightcolor:Tk.color ->
  ?highlightthickness:int ->
  ?image:#Tk.image ->
  ?justify:Tk.justification ->
  ?padx:int ->
  ?pady:int ->
  ?relief:Tk.relief ->
  ?state:Tk.state ->
  ?takefocus:bool ->
  ?text:string ->
  ?textvariable:Textvariable.textVariable ->
  ?underline:int ->
  ?width:int -> ?wraplength:int -> Widget.button Widget.widget
This argument cannot be applied without label

and this is the example-program (i added the first line to meet my needs):

#directory "d:\programs\ocaml\lib\labltk";;
open Tk;;            (* Make interface functions available *)

let top = openTk ();;   (* Initialisation of the interface *)
(* top is now the toplevel widget *)

(* Widget initialisation *)
let b = Button.create top 
          [Text "foobar"; 
           Command (function () -> 
                      print_string "foobar"; 
                      print_newline();
                      flush stdout)];;
(* b exists but is not yet visible *)

let q = Button.create top 
          [Text "quit"; 
           Command closeTk];;
(* q exists but is not yet visible *)

pack [b; q][] ;;           (* Make b visible *)
mainLoop() ;;           (* User interaction*)
(* You can quit this program by deleting its main window *)


but for this example-program (and all the other labltk-examples) i get the
error "This argument cannot be applied without label"

I am running ocaml 3.01
Am i doing sthg wrong or are the example programms shiped with labltk
0.417 somewhat broken?

Thank you!

Johann

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] labltk and ocaml 3.01
  2001-05-10  9:38 [Caml-list] labltk and ocaml 3.01 a9502276
@ 2001-05-10 10:02 ` Jacques Garrigue
  0 siblings, 0 replies; 2+ messages in thread
From: Jacques Garrigue @ 2001-05-10 10:02 UTC (permalink / raw)
  To: a9502276; +Cc: caml-list

From: <a9502276@unet.univie.ac.at>

> I'm completely new to FP and Caml in particular.
> 
> I downloaded camltk417-2 and tried helloworld.ml:
> 
> administrator@NTWSW2KJH /cygdrive/d/Temp
> $ labltk.exe helloworld.ml

The problem is clear enough: you are trying to use labltk with a
camltk program.
LablTk and CamlTk are two different libraries, but they share the same
module names, since LablTk is a dervative from CamlTk.
LablTk is included in the OCaml distribution, but CamlTk has to be
downloaded independently.
Both libraries have basically the same functionality, but they adopt a
different style: in CamlTk options are passed as lists of
constructors, while in LablTk optional arguments are used.

A few examples for LablTk are available, but infortunately they are
not included in the binary distribution for Windows. You have to get
the source distribution, and look in otherlibs/labltk/example.

On the other hand, if you want to use CamlTk, you must first compile
and install it.

Cheers,

        Jacques Garrigue
---------------------------------------------------------------------------
Jacques Garrigue      Kyoto University     garrigue at kurims.kyoto-u.ac.jp
		<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-10 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-10  9:38 [Caml-list] labltk and ocaml 3.01 a9502276
2001-05-10 10:02 ` Jacques Garrigue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).