[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Gregory Malecha <gmalecha@r...> |
| Subject: | Re: [Caml-list] LablGTK Reading Properties |
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 <gmalecha@rice.edu> 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