0

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.

Kavaliro
  • 119
  • 1
  • 8
  • You should add an answer to this question and mark it as correct, since you seem to have fixed the problem. – chrismamo1 Feb 04 '20 at 00:12
  • @user1030453, I't not really a fix. I just tested same code with a beta version of lablgtk3 to narrow down the cause of this issue. Now it looks like it has something to do with lablgtk2 library – Kavaliro Feb 04 '20 at 00:36

0 Answers0