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=2.0 required=5.0 tests=HTML_00_10,HTML_MESSAGE, 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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 6B13FBC69 for ; Tue, 6 Mar 2007 01:22:30 +0100 (CET) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.233]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l260MT5O025982 for ; Tue, 6 Mar 2007 01:22:30 +0100 Received: by wx-out-0506.google.com with SMTP id i31so1784789wxd for ; Mon, 05 Mar 2007 16:22:29 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=BrujZli9icESUmu6ave2DVcmv5NmzjZvT1FK2C1zWz4m55gxkS1eYlJRo7L94J4s6bzMimgZAdB3Igx4p+OCSbevh3t3hPrRriV8l6UKi+QmfN9UfHJd0xzSZ2u6CO9bIL3BortLfyzqTdv3QZfjrIDQUojxgA+/EgXjmvgutsw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=beeooNaOFv7Mhl9keRGiDQuP0WsXf9RAs54ydvZkitoAI5fIpgSxXn3Tt6PcpYEXDP0DpYFk1uznZagc/syXrj3dyRHvSstMVKuM44BEGDc5R82Gw+GDoXiDipxub2owW0Cf48DDXWykYgdVW6moREdaCQk7/udtdggyj791ptg= Received: by 10.90.78.9 with SMTP id a9mr5416794agb.1173140548841; Mon, 05 Mar 2007 16:22:28 -0800 (PST) Received: by 10.90.65.3 with HTTP; Mon, 5 Mar 2007 16:22:28 -0800 (PST) Message-ID: Date: Tue, 6 Mar 2007 00:22:28 +0000 From: "Ewen Maclean" Sender: ewenmaclean@gmail.com To: caml-list@inria.fr Subject: lablgtk GTree problem MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_151428_16337.1173140548683" X-Google-Sender-Auth: 39715140f2960888 X-Miltered: at discorde with ID 45ECB445.003 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lablgtk:01 model:01 model:01 iter:01 integers:01 iter:01 integers:01 integer:01 integer:01 callback:02 callback:02 element:03 element:03 let:03 let:03 ------=_Part_151428_16337.1173140548683 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I have tried looking for this information on the web but unfortunately have not been successful and any help would be greatly appreciated. I'm using a GTree.list_store as a model for a GTree.view. Everything is working fine and the documentation has really helped. The problem I have is that I am attributing a double-click event to each item in the GTree.list_store: gtreeview#connect#row_activated ~callback:(fun m n -> on_row_activated greetreeview nps m n) which calls the function on_row_activated: let on_row_activated (view:GTree.view) nps path column = let model = view#model in let row = model#get_iter path in let name = model#get ~row ~column:str_col in uprint ("Double-clicked row contains name " ^ name) () what I want is to work out is the integer index of row in the path. I read somewhere that I could use path#get_indices to return an array of integers which would tell me, but it tells me that path has no method get_indices. The point is that the row of the double clicked object is the index of the element I want from the list nps. I know that I can return a row_reference, but it would be really useful to get the index as an integer from the path. Any help would be much appreciated. Many thanks in advance and apologies if this is a very simple problem Ewen ------=_Part_151428_16337.1173140548683 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello,

I have tried looking for this information on the web but unfortunately have not been successful and any help would be greatly appreciated. I'm using a GTree.list_store as a model for a GTree.view. Everything is working fine and the documentation has really helped. The problem I have is that I am attributing a double-click event to each item in the GTree.list_store:

gtreeview#connect#row_activated ~callback:(fun m n -> on_row_activated greetreeview nps m n)

which calls the function on_row_activated:

let on_row_activated (view:GTree.view) nps path column =
  let model = view#model in
  let row = model#get_iter path in
  let name = model#get ~row ~column:str_col in
  uprint ("Double-clicked row contains name " ^ name) ()

what I want is to work out is the integer index of row in the path. I read somewhere that I could use path#get_indices to return an array of integers which would tell me, but it tells me that path has no method get_indices. The point is that the row of the double clicked object is the index of the element I want from the list nps. I know that I can return a row_reference, but it would be really useful to get the index as an integer from the path.

Any help would be much appreciated.

Many thanks in advance and apologies if this is a very simple problem

Ewen

------=_Part_151428_16337.1173140548683--