From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 651F7BC84 for ; Wed, 20 Apr 2005 15:09:16 +0200 (CEST) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id j3KD9GfC008420 for ; Wed, 20 Apr 2005 15:09:16 +0200 Received: (qmail invoked by alias); 20 Apr 2005 13:09:15 -0000 Received: from dialin-212-144-135-063.arcor-ip.net (EHLO dialin-212-144-135-063.arcor-ip.net) [212.144.135.63] by mail.gmx.net (mp013) with SMTP; 20 Apr 2005 15:09:15 +0200 X-Authenticated: #11134691 Received: from dirk by feanor.private-host.de with local (masqmail 0.2.20) id 1DOATD-0ZZ-00 for ; Wed, 20 Apr 2005 10:22:03 +0200 Date: Wed, 20 Apr 2005 10:22:02 +0200 To: caml-list@yquem.inria.fr Subject: Labltk: Canvas item -state hidden Message-ID: <20050420082202.GA2185@feanor> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040523i From: Dirk Thierbach X-Y-GMX-Trusted: 0 X-Miltered: at concorde with ID 4266547C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; labltk:01 labltk:01 widget:01 widget:01 workaround:01 int:01 match:02 match:02 string:03 let:03 let:03 interface:05 configure:08 configure:08 doesn't:12 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: Is there any reason that Labltk doesn't allow to configure canvas items with -state hidden (or with any state at all)? After wading through the interface information, I came up with the following workaround: let canvas_configure_item ?state widget tag = let tk_widget = cCAMLtoTKwidget widget in let tk_state = match state with | None -> [] | Some `Normal -> [TkToken "-state"; TkToken "normal"] | Some `Disabled -> [TkToken "-state"; TkToken "disabled"] | Some `Hidden -> [TkToken "-state"; TkToken "hidden"] in (* Tk.Tkintf.cCAMLtOTKtagOrId doesn't quote the tag *) let cCAMLtoTKtag (tag : Tk.tagOrId) = match tag with | `Id i -> TkToken (string_of_int i) | `Tag s -> TkQuote (TkToken s) in let tk_tag = cCAMLtoTKtag tag in let cmd = TkTokenList [tk_widget; TkToken "itemconfigure"; tk_tag] in tkCommand [| cmd; TkTokenList tk_state |] But of course it would be nicer if Labltk would already support it :-) - Dirk