<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/10/e62bbfd8546de628fe6c486ee3a4ec3b"
  from="Vincent Barichard &lt;Vincent.Barichard@i...&gt;"
  author="Vincent Barichard"
  date="2003-10-01T11:59:27"
  subject="[Caml-list] self widget call in camltk"
  prev="2003/10/a42049b2fe20cdf070defeb13e2ed9e2"
  next="2003/10/1d220b3f2e2d7062dfd40bd0036ab9d1"
  next-in-thread="2003/10/f586481c4fa95ec8f77daecc517abe25"
  prev-thread="2003/10/a42049b2fe20cdf070defeb13e2ed9e2"
  next-thread="2003/10/1d220b3f2e2d7062dfd40bd0036ab9d1"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] self widget call in camltk">
<msg 
  url="2003/10/e62bbfd8546de628fe6c486ee3a4ec3b"
  from="Vincent Barichard &lt;Vincent.Barichard@i...&gt;"
  author="Vincent Barichard"
  date="2003-10-01T11:59:27"
  subject="[Caml-list] self widget call in camltk">
<msg 
  url="2003/10/f586481c4fa95ec8f77daecc517abe25"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-10-01T23:54:52"
  subject="Re: [Caml-list] self widget call in camltk">
</msg>
</msg>
</thread>

<contents>
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 _ -&gt; Button.configure b2 ~state:`Active;
   Button.configure b1 ~state:`Disabled);;
let b2 = Button.create top ~text:"b2"
  ~command:(fun _ -&gt; Button.configure b1 ~state:`Active;
   Button.configure b2 ~state:`Disabled);;

pack [b1;b2];;
mainLoop ();;
closeTk ();;

#quit;;

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.

Vincent

-------------------
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

</contents>

</message>

