From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B56F3BC6D for ; Tue, 5 Feb 2008 17:37:47 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CALcfqEeAKs6Bd2dsb2JhbACQLAEKBAMMCBicfg X-IronPort-AV: E=Sophos;i="4.25,308,1199660400"; d="scan'208";a="22232058" Received: from smtp2.mail.rice.edu (HELO mh2.mail.rice.edu) ([128.42.206.129]) by mail4-smtp-sop.national.inria.fr with ESMTP; 05 Feb 2008 17:37:46 +0100 Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 74AD044056 for ; Tue, 5 Feb 2008 10:37:45 -0600 (CST) X-Virus-Scanned: by amavis-2.4.4 at mh2.mail.rice.edu Received: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VYcSyaIP1dIy for ; Tue, 5 Feb 2008 10:37:45 -0600 (CST) Received: from [10.101.94.65] (student-101-wless94-065.rice.edu [10.101.94.65]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mh2.mail.rice.edu (Postfix) with ESMTP id 1B64B44057 for ; Tue, 5 Feb 2008 10:37:45 -0600 (CST) Message-ID: <47A89124.1040304@rice.edu> Date: Tue, 05 Feb 2008 10:39:00 -0600 From: Gregory Malecha Reply-To: gmalecha@rice.edu User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: LablGTK Reading Properties Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; lablgtk:01 def:01 7.5:98 7.5:98 conv:02 conv:02 match:02 match:02 color:97 string:02 string:02 objects:02 black:96 let:03 let:03 Hi, I've been working on some code with GnomeCanvas and I'm having difficulty reading properties off of objects. For example, I've created a polygon and I want to read the points from it, but I always get back None. Here's my current code: let points item = let prop = {Gobject.name = "points"; Gobject.conv = GnomeCanvas.Conv.path_def} in let x = Gobject.get prop item in match x with None -> print_string "NONE!\n"; [] (* I always end up in this case *) | Some ary -> print_string "SOME!\n"; let ary = GnomeCanvas.Conv.get_points ary in Array.to_list ary My creation code looks like this: let drawSourcePort group (x, y) dir = let lst = match dir with East -> let cX,cY = x +. 5., y in let p1X,p1Y = x, y +. 7.5 in let p2X,p2Y = x, y -. 7.5 in [cX;cY; p1X;p1Y; p2X;p2Y] | West -> let cX,cY = x -. 5., y in let p1X,p1Y = x, y +. 7.5 in let p2X,p2Y = x, y -. 7.5 in [cX;cY; p1X;p1Y; p2X;p2Y] | North -> let cX,cY = x, y -. 5. in let p1X,p1Y = x +. 7.5, y in let p2X,p2Y = x -. 7.5, y in [cX;cY; p1X;p1Y; p2X;p2Y] | South -> let cX,cY = x, y +. 5. in let p1X,p1Y = x +. 7.5, y in let p2X,p2Y = x -. 7.5, y in [cX;cY; p1X;p1Y; p2X;p2Y] in let ary = Array.of_list lst in GnoCanvas.polygon ~points:ary ~fill_color:"black" group ;; I've also tried with lines and that fails as well. Does anyone know if there is anything special that I have to do in order to be able to read properties or why I keep getting null? Thanks. -- gregory malecha wiess college computer science 219.510.3400