Re: GtkListStore usage



* pclouds (pclouds users sourceforge net) wrote:
> Hello
> 
> I would like to use GtkListStore in this way:
>  - Create GtkListStore with 1 column (G_TYPE_POINTER) 
>  - Register two functions get_value and set_value. When 
>    gtk_list_store_{get,set}_value is called, my {get,set}_value will be
>    called, returning a value from the object in column 1 (or generate
>    a value from the object), and set a value in the object, respectively.
>    "Registering" may be connecting to signal or setting a function pointer
>    in GtkListStore struct, ..
> 
>  * Or we can create GtkListStore with n+1 columns, and let GtkListStore
>    check data types instead of {get,set}_value.
>  - {get,set}_value contain a lot of switches to control each column data.
> 
> Is there a way to do this without modifying GtkListStore or implementing
> a new GtkTreeModel?

I don't have an answer for you, but I need similar functionality in a
program I'm writing. Plus I need it for multi-column lists as well. Any
info you find out would be of use to me. Similarly, if I find anything
of use, I'll report it to the list for you.

> BTW, Gtk(2.0) uses gtktreedatalist to store a row. It would be better if 
> GtkListStore allows developer to use another type instead of gtktreedatalist
> when they want.

Yes, especially if you want to work on data by column instead of by row.

-- 
 .''`.      Carl B. Constantine
: :' :     duckwing duckwing ca
`. `'    GnuPG: 135F FC30 7A02 B0EB 61DB  34E3 3AF1 DC6C 9F7A 3FF8
  `-  Debian GNU/Linux -- The power of freedom

Attachment: pgpBes8mWQ3Tk.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]