chessguy
chessguy

Reputation: 165

Buttons side-by-side using labltk

I am using labltk in Ocaml. I would like to create three buttons side-by-side.

Suppose the following code :

#load "labltk.cma";;
let top = openTk() in

...

let button1 = Button.create
      ~text:"Button 1"
      ~command:(fun () -> Tk.closeTk (); exit 0)
      top in

let button2 = Button.create
      ~text:"Button 2"
      ~command:(fun () -> Tk.closeTk (); exit 0)
      top in

let button3 = Button.create
      ~text:"Button 3"
      ~command:(fun () -> Tk.closeTk (); exit 0)
      top in
...

Right now, the buttons are one over the others. Is there a workaround the make the button side-by-side

Upvotes: 1

Views: 61

Answers (1)

barti_ddu
barti_ddu

Reputation: 10299

For a simplistic layout You may just pack them:

pack ~side:`Left [button1;button2;button3] ;;

Upvotes: 2

Related Questions