On 2013/10/04, at 9:24, 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, This code could easily be generated by tkcompiler (i.e. adding it to WIdget.src), but for the use of :: inside the name, as it isn't a valid ocaml name. The simplest is probably to slightly modify tkcompiler to handle namespaces. […] Well I tried that approach, and at this point it's rather painful. The additions to Widget.src are minimal, but the widget types are hardcoded, so you end up by having to modify more things than you should. A bit of refactoring would solve that. Jacques Garrigue Here is the patch to just to modify tkcompiler and add ttk_labelframe.