[pygtk] Listtore

Rob Marino robemarino at interfree.it
Tue Feb 21 00:56:40 WST 2006


*try something like::*
-----------------------------------------
collection = []

something = ['hello','there',1,2]

for i in something:
collection.append(type(i))

store = gtk.ListStore(*collection)
------------------------------------------

Leeuw van der, Tim wrote:

> I believe that actually it should be:
>
> gtk.ListStore(*[str] * x)
>
> With an extra ‘*’ in front of the argument-list; otherwise it’s 1 
> argument to the ListStore constructor instead of an x number of 
> positional arguments.
>
> Cheers,
>
> --Tim
>
> ------------------------------------------------------------------------
>
> *From:* pygtk-bounces at daa.com.au [mailto:pygtk-bounces at daa.com.au] *On 
> Behalf Of *Arie Timmerman
> *Sent:* maandag 20 februari 2006 17:48
> *To:* pygtk at daa.com.au
> *Subject:* Re: [pygtk] Listtore
>
> 2006/2/20, Johan Dahlin <jdahlin at async.com.br 
> <mailto:jdahlin at async.com.br>>:
>
> [..]
> gtk.ListStore([str] * x)
>
> --
> Johan Dahlin <jdahlin at async.com.br <mailto:jdahlin at async.com.br>>
> Async Open Source
>
>
> It doesn't work actually:
>>>> store = gtk.ListStore([str]*4)
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> TypeError: could not get typecode from object
>
>------------------------------------------------------------------------
>
>_______________________________________________
>pygtk mailing list   pygtk at daa.com.au
>http://www.daa.com.au/mailman/listinfo/pygtk
>Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>  
>

-- 


       O__
      _/`.\
          `=( '




More information about the pygtk mailing list