Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=rBt2od10d6Ao+3VPh9JcBzZOMvpvznIgsMOIy2MGu3Q=; b=boOT17IDMlrwgYkrGKObp6Tmdiw/mDiyOYF8Sv1Dq1zV37hpwpIfrSx0dnSD/6CzW6 nNrVLsmccYdBHO/sClv05FmolHEF6QiufOWizPQ4pt6fIjewv9N2nEEI2DwXGG2Qp0rI 6aSwQrZFS6DfAteWUs2q451HFxWw9n/xfg2Zo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=jdZLONOyMSZqC9OsUvdN5dXAXw+kv3yj9rwj2h9eRF6us+QwUu86N0n6nRSufb3f63 LlZKefPF+yrldmLAtICykiFG9WxDqt1GEp3FZgMtUHBZLr4E27xWpxNYPpTErRZptgDa aaq2uJrPqzbIIsu3hPO+7MQOMzpbGBhPOGBiQ= Message-ID: Date: Sun, 5 Oct 2008 18:36:41 -0400 From: "Jacques Le Normand" To: lablgtk at yquem.inria.fr In-Reply-To: MIME-Version: 1.0 References: Subject: [Lablgtk] Re: gtkCompletion entry changed vs focus Mime-version: 1.0 Content-Type: multipart/mixed; boundary="===============0597580934==" Content-Length: 4787 --===============0597580934== Content-Type: multipart/alternative; boundary="----=_Part_24161_12514029.1223246201171" ------=_Part_24161_12514029.1223246201171 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I've been informed by Benjamin Monate that this may be a bug in gtk and proposed the following: As a workaround you can use: print_endline (m#get ~row:i ~column:{col_string with creator=0}) ; Which is ugly and bypasses the lablgtk internal consistency checks between columns and models. The cleaner version for next lablgtk2 version will probably be: print_endline (m#child_model#get ~row:(m#convert_iter_to_child_iter i) ~column:col_string) ; On Sat, Oct 4, 2008 at 6:15 PM, Jacques Le Normand wrote: > Dear lablgtk@yquem, > thanks for all the help so far! The current behaviour of a completion is to > start completing when the entry is changed. How can I change this so that it > also starts completing when the entry gets focused? > To see what I mean, the following code generates a simple text entry (which > starts with the focus). However, there's no completion available (until you > change the entry): > > > > open GTree > open Gobject.Data > > let cols = new GTree.column_list > let col_string = cols#add string > > let create_model () = > let data = ["fooo"] > in > let store = GTree.list_store cols in > let fill str = > let iter = store#append () in > store#set ~row:iter ~column:col_string str; > in > List.iter fill data; > store > > > > let _ = > let source_window = GWindow.window () in > let entry = GEdit.entry ~packing:source_window#add () in > let model = create_model () in > let completion = GEdit.entry_completion ~model ~entry () in > completion#set_text_column col_string; > entry#set_text "foo"; > source_window#show (); > GMain.Main.main () > > > ------=_Part_24161_12514029.1223246201171 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
I've been informed by Benjamin Monate that this may be a bug in gtk and proposed the following:


<start of quote>
As a workaround you can use:
print_endline (m#get ~row:i ~column:{col_string with creator=0}) ;

Which is ugly and bypasses the lablgtk internal consistency checks between columns and models.

The cleaner version for next lablgtk2 version will probably be:
print_endline (m#child_model#get ~row:(m#convert_iter_to_child_
iter i) ~column:col_string) ;




On Sat, Oct 4, 2008 at 6:15 PM, Jacques Le Normand <rathereasy@gmail.com> wrote:
Dear lablgtk@yquem,
thanks for all the help so far! The current behaviour of a completion is to start completing when the entry is changed. How can I change this so that it also starts completing when the entry gets focused?
To see what I mean, the following code generates a simple text entry (which starts with the focus). However, there's no completion available (until you change the entry):



open GTree
open Gobject.Data

let cols = new GTree.column_list
let col_string = cols#add string

let create_model () =
  let data = ["fooo"]
  in
  let store = GTree.list_store cols in
  let fill str =
    let iter = store#append () in
    store#set ~row:iter ~column:col_string str;
  in
  List.iter fill data;
  store



let _ =
  let source_window = GWindow.window () in
  let entry = GEdit.entry ~packing:source_window#add () in
  let model = create_model () in
  let completion = GEdit.entry_completion ~model ~entry () in
    completion#set_text_column col_string;
    entry#set_text "foo";
    source_window#show ();
    GMain.Main.main ()



------=_Part_24161_12514029.1223246201171-- --===============0597580934== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk --===============0597580934==--