From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA11148; Sun, 28 Oct 2001 15:58:23 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA11356 for ; Sun, 28 Oct 2001 15:58:22 +0100 (MET) Received: from imailg1.svr.pol.co.uk (imailg1.svr.pol.co.uk [195.92.195.179]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9SEwLv13690 for ; Sun, 28 Oct 2001 15:58:22 +0100 (MET) Received: from modem-432.stoked.dialup.pol.co.uk ([62.25.189.176] helo=alba.sw) by imailg1.svr.pol.co.uk with esmtp (Exim 3.13 #0) id 15xrOH-0002If-00 for caml-list@inria.fr; Sun, 28 Oct 2001 14:58:21 +0000 Received: by alba.sw (Postfix, from userid 1001) id EEEEBF8; Sun, 28 Oct 2001 15:56:25 +0000 (GMT) Date: Sun, 28 Oct 2001 15:56:25 +0000 From: Andrew Lawson To: caml-list@inria.fr Subject: [Caml-list] Passing self to a new object Message-ID: <20011028155625.A1303@alba.sw> Reply-To: Andrew Lawson Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi all I'm writing a gui program where the callback for a button creates a new object (also a gui) and needs to pass it a reference to itself in order that the new object can contact the original for information. The classes look something like this; class xyz = let top = ... in let ... = ... in let btnNew = ... ~command:(fun () = new abc self) top in object (self) ... ... end class abc (parent:xyz) = object (self) var myparent = parent ... end My error is; This expression has type < btnDelete : 'a; btnEdit : 'b; btnExit : 'c; btnFind : 'd; btnNew : Widget.button Widget.widget; get_config : 'e -> 'f; list_record_directory : 'g; new_filename : 'h; read_configuration : 'i; self : 'j; set_config : 'k -> 'l -> 'm; topLevel : 'n; .. > but is here used with type 'j Self type cannot escape its class And I have no clue what I am doing wrong :) All suggestions appreciated Andrew -- Andrew Lawson andrew@absentis.com ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr