Re: gtkCompletion entry changed vs focus

"Jacques Le Normand" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
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 <[email protected]>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 ()
>
>
>

_______________________________________________
Lablgtk mailing list
[email protected]
http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.