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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL 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 94115BC6C for ; Wed, 6 Feb 2008 09:57:31 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKIFqUdC+VyukGdsb2JhbACQMgEBAQEHBAQJChEHllSGYw X-IronPort-AV: E=Sophos;i="4.25,311,1199660400"; d="scan'208";a="22279096" Received: from ug-out-1314.google.com ([66.249.92.174]) by mail4-smtp-sop.national.inria.fr with ESMTP; 06 Feb 2008 09:57:31 +0100 Received: by ug-out-1314.google.com with SMTP id k40so343817ugc.18 for ; Wed, 06 Feb 2008 00:57:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=dO5095ZtKixC0+WYH6wSi2wat2HiuEstF2ZMT6H50fc=; b=K2eiU0Dd6AuJIpWsncEYMu6WaLIlMxV+la83EWtlngDi/yJ10uXDcmopm3nR76FCE/UxM17m8fRk+HdkQe95KqPIh0FZur8GFOYuXRFSD1C/6CWbKiPbPajJpmvEsNBTXgMUUqAhH+Lge7drUM/cUbKVzMiu2yOg2KZlwTnLMh0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=l2b5rkMlwXE/MiRLpNiGFQrGya7kL/bSTvKprvIfWWAbZ36c3isVduJi8RuCWRi9nej4dMZO9GAXT3py9G6mATZMjT0wV96MHD8t88RvYFvcq5Gahf0v0yMfc0ZeEM9zO5DBenxruQvxTAJb5kuTnGv9aVp2/Ydm5Pj1+XqfFzk= Received: by 10.78.176.20 with SMTP id y20mr3292082hue.36.1202288248984; Wed, 06 Feb 2008 00:57:28 -0800 (PST) Received: by 10.78.25.10 with HTTP; Wed, 6 Feb 2008 00:57:28 -0800 (PST) Message-ID: <95513600802060057g1d866af1of277c8f086f6483b@mail.gmail.com> Date: Wed, 6 Feb 2008 09:57:28 +0100 From: "Olivier Andrieu" Sender: oandrieu@gmail.com To: gmalecha@rice.edu Subject: Re: [Caml-list] LablGTK Reading Properties Cc: caml-list@yquem.inria.fr In-Reply-To: <47A89124.1040304@rice.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47A89124.1040304@rice.edu> X-Google-Sender-Auth: 412a238258948734 X-Spam: no; 0.00; andrieu:01 oandrieu:01 lablgtk:01 def:01 def:01 wrote:01 caml-list:01 nerim:01 conv:02 conv:02 match:02 string:02 string:02 objects:02 float:03 Hi, On Feb 5, 2008 5:39 PM, Gregory Malecha wrote: > 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 you're getting None because you're using the wrong conversion function: this "points" property is basically a float array and here you're using the path_def conversion which is for bpath (bezier path). Your code should work with: let prop = {Gobject.name = "points"; conv = GnomeCanvas.Conv.points} in ... -- Olivier