Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Eliot Handelman <eliot@colba.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Adding ttk (tile tk) bindings to labltk
Date: Thu, 03 Oct 2013 20:24:13 -0400	[thread overview]
Message-ID: <524E0AAD.9000909@colba.net> (raw)
In-Reply-To: <CAC-LLDicLMG13A_AzJWxEmteJ+qG9ZF9s0ogbhMLhWQV6f8UZQ@mail.gmail.com>

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

  parent reply	other threads:[~2013-10-04  0:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-03  9:45 Tim Cuthbertson
2013-10-03 11:43 ` ygrek
2013-10-04  0:24 ` Eliot Handelman [this message]
2013-10-04 12:24   ` Tim Cuthbertson
2013-10-04 14:14   ` Jacques Garrigue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=524E0AAD.9000909@colba.net \
    --to=eliot@colba.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox