Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] self widget call in camltk
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-10-01 (11:59)
From: Vincent Barichard <Vincent.Barichard@i...>
Subject: [Caml-list] self widget call in camltk
Hi all,

I use labltk to build a gui for a programm where I need that a button b1 can
enable another button b2 and disable itself. For example :

open Tk

let top = openTk ();;
let b1 = Button.create top ~text:"b1" ~state:`Disabled
  ~command:(fun _ -> Button.configure b2 ~state:`Active;
   Button.configure b1 ~state:`Disabled);;
let b2 = Button.create top ~text:"b2"
  ~command:(fun _ -> Button.configure b1 ~state:`Active;
   Button.configure b2 ~state:`Disabled);;

pack [b1;b2];;
mainLoop ();;
closeTk ();;


Obviously, this code doesn't work because b1 and b2 call themself. How can I
make it work ? Is there any solution to simulate cross reference in labltk ?

Thanks for your help.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: