On Fri, Oct 4, 2013 at 10:24 AM, Eliot Handelman <eliot@colba.net> 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.