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: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] self widget call in camltk
From: "Vincent Barichard" <>

> 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 :
> 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);;

That's pretty classical. You can add the command after creating the
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 Archives:
Bug reports: FAQ:
Beginner's list: