[pygtk] dynamic treestore

alex goretoy agoretoy at gmail.com
Sun Nov 28 10:40:46 WST 2010


Currently I am having to do this in my application to create dynamic
treestore; is the a better way to do this?

def get_treestore(n):
        if n == 0:
                treestore = gtk.TreeStore(str);
        elif n == 1:
                treestore = gtk.TreeStore(str);
        elif n == 2:
                treestore = gtk.TreeStore(str, str);
        elif n == 3:
                treestore = gtk.TreeStore(str, str, str);
        elif n == 4:
                treestore = gtk.TreeStore(str, str, str, str);
        else:
                treestore = gtk.TreeStore(str);

        return treestore


Thank you in advance,
-Alex Goretoy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20101127/1a1405be/attachment.html>


More information about the pygtk mailing list