lablgtk2, GEdit.entry preventing window from showing

55 views Asked by At

I was learning Lablgtk2 for OCaml and all was good and working, but when I tried adding GEdit.entry to any container, the execution stops there and any thing after won't be executed. but the program keeps running, and I have to terminate it with ^C. For example

let local = GMain.Main.init ()

let main () =
  let window = GWindow.window ~title:"Entry Test" 
    ~width:200 ~height:200  () in
  let hbox = GPack.hbox ~packing:window#add () in 
  let entry = GEdit.entry  () in  
  (* window#show ();    this will show an empty window *)
  hbox#pack entry#coerce; (* this seems to be the problem *)
  window#show (); (* this won't be shown*)
  let win2 = GWindow.window ~title:"another window"
      ~width:200 ~height:200 () in
  win2#show (); (* this won't be shown either *)
  GMain.Main.main ()

let _ = main ()

Using the ~packing: label is just the same.

I'm running Ubuntu 19.10 and I have installed gtk2 as said here. I have installed lablgtk using opam with opam install lablgtk

UPDATE: I Installed lablgtk3 and tested it again, everything seems to work fine now.

0

There are 0 answers