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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 1D95EBC6C for ; Wed, 6 Feb 2008 18:04:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAAJ4qUeAKs6Bdmdsb2JhbACQMgEKBAMKChicdA X-IronPort-AV: E=Sophos;i="4.25,313,1199660400"; d="scan'208";a="7718857" Received: from smtp2.mail.rice.edu (HELO mh1.mail.rice.edu) ([128.42.206.129]) by mail1-smtp-roc.national.inria.fr with ESMTP; 06 Feb 2008 18:04:54 +0100 Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id F2B7A384BC2; Wed, 6 Feb 2008 11:04:53 -0600 (CST) X-Virus-Scanned: by amavis-2.4.4 at mh1.mail.rice.edu Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zk1n4+Cyi90Z; Wed, 6 Feb 2008 11:04:53 -0600 (CST) Received: from [10.97.94.2] (student-97-wless94-002.rice.edu [10.97.94.2]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mh1.mail.rice.edu (Postfix) with ESMTP id C71B63844A7; Wed, 6 Feb 2008 11:04:53 -0600 (CST) Message-ID: <47A9E900.6000403@rice.edu> Date: Wed, 06 Feb 2008 11:06:08 -0600 From: Gregory Malecha Reply-To: gmalecha@rice.edu User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: Olivier Andrieu Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] LablGTK Reading Properties References: <47A89124.1040304@rice.edu> <95513600802060057g1d866af1of277c8f086f6483b@mail.gmail.com> In-Reply-To: <95513600802060057g1d866af1of277c8f086f6483b@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; lablgtk:01 andrieu:01 def:01 def:01 wrote:01 wrote:01 caml-list:01 conv:02 conv:02 match:02 match:02 string:02 string:02 objects:02 float:03 I've modified the function and I'm still getting the same behavior. Here is my new code: let points item = let prop = {Gobject.name = "points"; Gobject.conv = GnomeCanvas.Conv.points} in let x = Gobject.get prop item in match x with None -> print_string "NONE!\n"; [] | Some ary -> print_string "SOME!\n"; Array.to_list ary Is there a particular thing that I have to do before I can get the points? Does anyone have an example where they are able to do this? Thanks. Olivier Andrieu wrote: > 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 ... > > -- gregory malecha wiess college computer science 219.510.3400