From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 69E647FA4D for ; Thu, 31 Jul 2014 10:48:35 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of adrien@notk.org) identity=pra; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of adrien@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am4JAGQC2lNbeUeT/2dsb2JhbABYgw5SVwGCJlGKSb1Uh0kBgQYWd4QDAQEEASNWBQsLGAICBRMOAgIPBRgxiE0MCaRKl10XgSyOIAeCeTaBGwWbYwGBUpMBg0s7LwEB X-IPAS-Result: Am4JAGQC2lNbeUeT/2dsb2JhbABYgw5SVwGCJlGKSb1Uh0kBgQYWd4QDAQEEASNWBQsLGAICBRMOAgIPBRgxiE0MCaRKl10XgSyOIAeCeTaBGwWbYwGBUpMBg0s7LwEB X-IronPort-AV: E=Sophos;i="5.01,770,1400018400"; d="scan'208";a="87711510" Received: from nautica.notk.org ([91.121.71.147]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 31 Jul 2014 10:48:35 +0200 Received: by nautica.notk.org (Postfix, from userid 1003) id 1DE6AC009; Thu, 31 Jul 2014 10:48:34 +0200 (CEST) Date: Thu, 31 Jul 2014 10:48:34 +0200 From: Adrien Nader To: Oliver Bandel Cc: caml-list@inria.fr Message-ID: <20140731084834.GB12684@notk.org> References: <20140723014541.Horde.3N6p_tSbAB9ToziHlYE0gw8@webmail.in-berlin.de> <20140723111034.GA26916@notk.org> <20140723134245.Horde.4I1V6EjmlCCX20bk_Xmh1Q2@webmail.in-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20140723134245.Horde.4I1V6EjmlCCX20bk_Xmh1Q2@webmail.in-berlin.de> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] lablgtk with OCamlMakefile On Wed, Jul 23, 2014, Oliver Bandel wrote: > I again use "lablgtk2" (instead of "lablgtk2.auto-init") > in the "PACKS"-section of my Makefile. > > And I added the line > > let locale = GtkMain.Main.init () in > > as first line in my GUI-code. > > > Doing it this way, it also works; I get a GUI instead of a crash. > > I hope this is the correct and recommended way now. Yes, it's perfect. Just for completeness for archives: this changes very slightly when multi-threading is required (and also remember that graphics-related operations can only happen in the main thread on most platforms but X11 (Wayland too?) and that even in that case, the GDK lock must be taken before issuing them. (more details are easily found on the internet) > Remark on the README-file: > > The line with "GtkMain.Main.init ()" I found in the > README of lablgtk, which you seemed to refer to. > > Normally this README is not seen, because when installing > the lablgtk-package, it will just be the working code become installed, > and the README does not show up. > > Possibly it makes sense to have doc-packages, which install > the documentation also. > (It's on Arch-linux, and no docs are installed by default.) Yes, right. There's http://lablgtk.forge.ocamlcore.org/README.html#_how_to_compile_and_link which should be more visible but still not as well as it should. I've been unable to keep up with my TODO list in the recent months but I'll soon have 2 * 4 hours of plane so I'll try to use that to commit improvements to the documentation and beginner material. Unfortunately, until then I won't have time to make such changes. -- Adrien Nader