Reputation: 165
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
Reputation: 10299
For a simplistic layout You may just pack
them:
pack ~side:`Left [button1;button2;button3] ;;
Upvotes: 2