Re: [pygtk] Dynamically creating columns in a ListStore

2002-11-06 Thread Christian Reis
On Tue, Nov 05, 2002 at 05:23:21PM +0800, James Henstridge wrote: What I'd like to do is something like: store = gtk.ListStore([gobject.TYPE_STRING]*cols) Sure. Python makes it quite easy to call a function that takes a variable number of arguments with an argument vector. You

Re: [pygtk] Dynamically creating columns in a ListStore

2002-11-06 Thread James Henstridge
Christian Reis wrote: On Wed, Nov 06, 2002 at 12:49:48AM -0800, David M. Cook wrote: On Tue, Nov 05, 2002 at 05:23:21PM +0800, James Henstridge wrote: store = gtk.ListStore(*[str]*cols) Whoa, slick, you can also use foo(**keys). I can get rid of all those awkward apply()

[pygtk] Dynamically creating columns in a ListStore

2002-11-04 Thread Don Allingham
I need to be able to determine at runtime how many columns a ListStore should have. What I'd really like to do is something like passing a list of types to the constructor instead of having to specify a set of parameters to the constructor. Right now I have to do: if cols == 1: store =