From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 91DDE7EE4B for ; Fri, 4 Oct 2013 14:25:09 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of tim@gfxmonk.net) identity=pra; client-ip=209.85.219.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tim@gfxmonk.net"; x-sender="tim@gfxmonk.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of tim@gfxmonk.net) identity=mailfrom; client-ip=209.85.219.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tim@gfxmonk.net"; x-sender="tim@gfxmonk.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-oa0-f42.google.com) identity=helo; client-ip=209.85.219.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tim@gfxmonk.net"; x-sender="postmaster@mail-oa0-f42.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At0CAIuyTlLRVdsqlGdsb2JhbABZgmZZUq5vihSIRYESCBYOAQEBAQcLCwkSKoIlAQEEASdHCwULCwQHDQ0hIhIBBQEKEhkSh2IDCQYBC50clFEDiXWPTQQHFoQNA5gBgS+OZRgpgmWBew X-IPAS-Result: At0CAIuyTlLRVdsqlGdsb2JhbABZgmZZUq5vihSIRYESCBYOAQEBAQcLCwkSKoIlAQEEASdHCwULCwQHDQ0hIhIBBQEKEhkSh2IDCQYBC50clFEDiXWPTQQHFoQNA5gBgS+OZRgpgmWBew X-IronPort-AV: E=Sophos;i="4.90,1032,1371074400"; d="scan'208";a="35585472" Received: from mail-oa0-f42.google.com ([209.85.219.42]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 04 Oct 2013 14:25:07 +0200 Received: by mail-oa0-f42.google.com with SMTP id g12so3874955oah.1 for ; Fri, 04 Oct 2013 05:25:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=izH8huJ6K+0igP5SHXzTbsqv5swU57z/Ry0gHxUqnvk=; b=QaKoY4QuZ2L30hlurQA7YUcs64YW+yZe7jVS1b9Ntw3fA7f2x1gd6lWip5sB4r2GCT uUyJ43UdvyZDe2+Oz4a7SdVjWTBonsWSijUAHKt49F3A/NTrREgkFPoympoLfmbAFIfR /P8k8N1mOL3rulc/n7kSy8X9FX6zIUclIojhCnS6uMwbwOq0kxZNbD9uGcqmdm8yMA+z n6q8ehBAtvWZSDB16zoYW998wT2oh0lAej+RDmqdLtH4frSU8VDqbcIYhV6lOBCe4DCF U6LYEOTV10u4UyaTLvttP2tMfvcNnQ/At9mYPgbllftpVnrB+ZL81pC4vNfW7fXCWKB7 YATw== X-Gm-Message-State: ALoCoQnTuc7kxMtzw2xU1bIu9nUNTjfNCAokph5iv6lPCBS0FiqvQmTMB/jg8ga3AhAlX16AHlsF X-Received: by 10.60.58.10 with SMTP id m10mr166989oeq.61.1380889507159; Fri, 04 Oct 2013 05:25:07 -0700 (PDT) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [2607:f8b0:4001:c03::235]) by mx.google.com with ESMTPSA id y1sm29618872oek.4.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Oct 2013 05:25:06 -0700 (PDT) Received: by mail-ie0-f181.google.com with SMTP id tp5so8651852ieb.40 for ; Fri, 04 Oct 2013 05:25:05 -0700 (PDT) X-Received: by 10.50.87.36 with SMTP id u4mr6252116igz.40.1380889505818; Fri, 04 Oct 2013 05:25:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.77.73 with HTTP; Fri, 4 Oct 2013 05:24:44 -0700 (PDT) In-Reply-To: <524E0AAD.9000909@colba.net> References: <524E0AAD.9000909@colba.net> From: Tim Cuthbertson Date: Fri, 4 Oct 2013 22:24:44 +1000 Message-ID: To: eliot@colba.net Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=089e0111d0d878800104e7e9645a Subject: Re: [Caml-list] Adding ttk (tile tk) bindings to labltk --089e0111d0d878800104e7e9645a Content-Type: text/plain; charset=ISO-8859-1 On Fri, Oct 4, 2013 at 10:24 AM, Eliot Handelman wrote: > On 10/03/2013 05:45 AM, Tim Cuthbertson wrote: > >> >> Does anyone know if it's possible to add ttk widgets to labltk? Is there >> a library other than labltk that I should be using for ttk? >> > > It is for me -- here's how I got LabelFrame going: > > open Tk > open Protocol > > let tokenize strings = > Arr.of_list (L1.map (fun s -> TkToken s) strings) > > let tk_command string_list = > Protocol.tkCommand (tokenize string_list) > > let tk_eval string_list = > Protocol.tkEval (tokenize string_list) > > let after ms = > tk_command [ "after"; string_of_int ms] > > module LabelFrame = struct > let id = ref 0 > let create ?(text = "") top = > let i = int !id in > incr id; > let lf_name = (Widget.name top) ^ ".labelframe" ^ i in > tk_command > ["ttk::labelframe"; lf_name; > "-text"; text > ]; > Protocol.cTKtoCAMLwidget lf_name > end > > best, > > -- eliot > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/**arc/caml-list > Beginner's list: http://groups.yahoo.com/group/**ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-**bugs > Thanks, Eliot. It's good to know this is possible, but I was thinking more of extending labltk itself to provide / generate these bindings - I don't much fancy writing wrappers like this for each function / widget I want to use. Cheers, - Tim. --089e0111d0d878800104e7e9645a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
=A0


On Fri, Oct 4, 2013 at 10:24 AM, Eliot Handelman &= lt;eliot@colba.net= > wrote:
On 10/0= 3/2013 05:45 AM, Tim Cuthbertson wrote:

Does anyone know if it's possible to add ttk widgets to labltk? Is ther= e a library other than labltk that I should be using for ttk?

It is for me -- here's how I got =A0LabelFrame going:

open Tk
open Protocol

let tokenize strings =3D
=A0 Arr.of_list (L1.map (fun s -> TkToken s) strings)

let tk_command string_list =3D
=A0 =A0Protocol.tkCommand (tokenize string_list)

let tk_eval string_list =A0=3D
=A0 Protocol.tkEval (tokenize string_list)

let after ms =3D
=A0 tk_command [ "after"; string_of_int ms]

module LabelFrame =3D struct
=A0 let id =3D ref 0
=A0 let create ?(text =3D "") top =3D
=A0 =A0 let i =3D int !id in
=A0 =A0 =A0 incr id;
=A0 =A0 =A0 let lf_name =3D (Widget.name top) ^ ".labelframe" ^ i= in
=A0 =A0 tk_command
=A0 =A0 =A0 ["ttk::labelframe"; lf_name;
=A0 =A0 =A0 =A0"-text"; text
=A0 =A0 =A0 ];
=A0 =A0 Protocol.cTKtoCAMLwidget lf_name
end

best,

-- eliot

Thanks, Eliot.

It'= s good to know this is possible, but I was thinking more of extending labltk itself to provide / generate these= =20 bindings - I don't much fancy writing wrappers like this for each=20 function / widget I want to use.

Ch= eers,
=A0- Tim.
--089e0111d0d878800104e7e9645a--