<?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/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"
  prev="2003/10/79d5e8ba53848e40456050ecf8aa0b6e"
  next="2003/10/19fb72de40775f093b3e192e9e0debc3"
  prev-in-thread="2003/10/e62bbfd8546de628fe6c486ee3a4ec3b"
  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>
From: "Vincent Barichard" &lt;Vincent.Barichard@info.univ-angers.fr&gt;

&gt; I use labltk to build a gui for a programm where I need that a button b1 can
&gt; enable another button b2 and disable itself. For example :
&gt; 
&gt; let b1 = Button.create top ~text:"b1" ~state:`Disabled
&gt;   ~command:(fun _ -&gt; Button.configure b2 ~state:`Active;
&gt;    Button.configure b1 ~state:`Disabled);;
&gt; let b2 = Button.create top ~text:"b2"
&gt;   ~command:(fun _ -&gt; Button.configure b1 ~state:`Active;
&gt;    Button.configure b2 ~state:`Disabled);;

That's pretty classical. You can add the command after creating the
button:
let b1 = Button.create top ~text:"b1" ~state:`Disabled
let b2 = Button.create top ~text:"b2"
let () =
  Button.configure b1 ~command:(...);
  Button.configure b2 ~command:(...)

Jacques Garrigue

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

