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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 31B4B7EE34 for ; Thu, 31 Mar 2016 12:21:22 +0200 (CEST) IronPort-PHdr: 9a23:AEhrKRdlurmDLibLBldVBSb3lGMj4u6mDksu8pMizoh2WeGdxc6+Zh7h7PlgxGXEQZ/co6odzbGG4+a7ASdZsd6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDivcaLKFwYzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IAu3GePEzRLlcSTAnKHwd5cvxtBCFQxHcyGEbVzA5lQFXAg6N8hb8Fr3rvyf3rO56x2HOMsrtUrEyHCrn5Y90RRWuhCpRZG1xy33elsEl1PETmxmmvREqm4M= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=goswin-v-b@web.de; spf=Pass smtp.mailfrom=goswin-v-b@web.de; spf=None smtp.helo=postmaster@mout.web.de Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.17.12; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of goswin-v-b@web.de designates 212.227.17.12 as permitted sender) identity=mailfrom; client-ip=212.227.17.12; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.17.12; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D3AQAZ+fxWjAwR49RduCaCfoUCgXCEfYEQAoE+ORMBAQEBAQEBAREBAQEIDQkJIS+CLYIUAQEBAwE6NBALCxgJAyIPBSiIRQENCAS8GB+FPSqJZX+FCoJfgisFl3KHIIZeiTQKhVmPFSEBglWBVIlXAQEB X-IPAS-Result: A0D3AQAZ+fxWjAwR49RduCaCfoUCgXCEfYEQAoE+ORMBAQEBAQEBAREBAQEIDQkJIS+CLYIUAQEBAwE6NBALCxgJAyIPBSiIRQENCAS8GB+FPSqJZX+FCoJfgisFl3KHIIZeiTQKhVmPFSEBglWBVIlXAQEB X-IronPort-AV: E=Sophos;i="5.24,421,1454972400"; d="scan'208";a="171837132" Received: from mout.web.de ([212.227.17.12]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Mar 2016 12:21:21 +0200 Received: from frosties.localnet ([134.3.242.84]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0LwqBg-1Zf7842ftI-016Ri4 for ; Thu, 31 Mar 2016 12:21:20 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.84) (envelope-from ) id 1alZj5-0004mi-RJ for caml-list@inria.fr; Thu, 31 Mar 2016 12:21:19 +0200 Date: Thu, 31 Mar 2016 12:21:19 +0200 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20160331102118.GA17174@frosties> References: <20160323105016.GA2235@frosties> <56F2CFD4.4000401@cea.fr> <20160324102559.GB32689@frosties> <20160325112839.GA27075@frosties> <20160329222912.GI9386@darkstar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160329222912.GI9386@darkstar> User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:n4SKXmMZ6PQUhr6jst+JwoGNt0raygMtn6zenGKkQlDVu63t87r UcZZ7/JGcDwJV8+QPJO55p2ybZTExay+0JfIJZW+alAhnx4oJFxYDai/nejRPrXhvcGCeUy r8PcFizlFo18SKbRhgQ6IR71om3fSV51Bf2S7LOU+yMYerWK7/ZF43trZMq7u7hDdBHsX9P uovuB40Ebda3JiNtUP8eQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Wy+k00f3W4k=:NoD9WHKJ2sXrBlG5O2yvAS aYWHDhSQNC9+H+rh78Z635KbXDU38YD81qoxtArc8TSaUi18i9a9EfEQjOPMuN3xMwox+pPyY UTQ58CzSlMHt1scMUq/UtG24yHkgFH2BTrNPOlNyK3duTdc/+FYVYvMDCYP+1l+gfK6Brcpwi moJviuNwgS6WL5O2SaA544UvAikdCvrd2G40pyUwhsqqSEqlbktwo61bdBM3cXksXgHVB7UAm rom01daY8m4zT09X924cHJOV5jTkPAfEphg7DVgvW0JLx9+eUuxJXazWlQjgYFG8OLP35lm27 KRRJlgODpNzHmCALGjx3dYpb1sn8UXGZyt65skPWPaKqLSZcrfOG7Tu4psKXgsopaEN4b+R1m q3xsxh9EhKPF7aIc07qmV1byhHF5r797xsmrs9MgmARIHaksrUWZ1xMSNJB7Px9x0bSaN0kRf S8ohbTlZKI99EAMHnonFCBphNY/1hoyzCuiVIortsIxdJJg2cCuwE01XOABA50xSkDiAISCkV D41zUP2DCBNiRAUaiNio6+kcIj1oQsYZjlKd6GaKoh1lmQ89vr7yqO8NlyaABTgjuaNZ4MKFc ZWwqRM5cVGfrygePDuHe76z5fu1kq1cm3nRfmZaohBEqZ95xA5ZnHPDgOQgGcqH2xNGCuvIhM +HSjsFD9QOSCAZhDFBHBiEzj5Vhbg8BehmHT+gXbXgD218UFHX291EMGIZb5K0E0upNrK1zIr bPvenO9pVWdtAg8CwJ2ppYv1WuGF3WYyZT6zbm2U2H+DE3PbBnteTWnucGE= Subject: Re: [Caml-list] RFH: can't figure out why my QT5 widget bindings segfault On Tue, Mar 29, 2016 at 11:29:12PM +0100, SP wrote: > On Fri, Mar 25, 2016 at 12:28:39PM +0100, Goswin von Brederlow wrote: > >I've converted to explicit painter#begin_ and painter#end_ calls and > >added some checks in the bindings to enforce them and now everything > >works. Now off to adding KeyEvent parsing and one can actually play. > > I think having Qt usable from OCaml would be great. > > But I'm not sure the best way to do it to map the object oriented system > "one-to-one" with OCaml objects. It will be as tedious to use as it is > with C++ and keeping track of any changes in the API might be a pain. I think it is the only sane way. GUI widgets are full of inheritance and you have tons of functions that can take any widget. Without objects you would have to use recursive types like type t = unit pushButton AbstarctButton.abstractButton Widget.widget Object.oObject OCLass.oClass (and how do I say that a widget is both an oObject and paintDevice?) or phantom types like type t = [`PushButton | `AbstractButton | `Widget | `Object | `PaintDevice ] OClass.oClass And that is just for a simple button. Other types would get a lot longer, not to mention the type for methods taking other widgets where you have multiple of those types. >From what I see the API doesn't change much. Even between QT4 and QT5 there is only a handfull of API changes. So I don't think tracking them will be that hard. Getting the API right and playing ball with the Gc the first time around is a pain though. One has to be carefull about Qt taking ownership of the arguments or not, which requires a human reading the API docs. So I'm afraid automatic stub generation from the header files is mostly not possible. > I'd like to follow the progress on this. Will you be posting on the > mailing list or have you got a blog about this? You can subscribe to the github repository to see commits, issues, pull requests etc. But I will probably announce larger milestones on the mailing list too. So far it's a proof of concept and I think having the Tetrix example work proofs the concept viable. So I'm gonna keep working on this. MfG Goswin