Re: pickling a TreeStore? Re: [pygtk] Creating a sortable model derived from GenericTreeModel
On Fri, Oct 24, 2003 at 04:15:57PM +0800, James Henstridge wrote: > >According to the pickle documentation ( > >http://python.org/doc/2.3.1/lib/node64.html ), objects can be pickled > >if they are at the top level of a module. Would it be possible for me > >to hack the pygtk sources to put TreeStore at the top level of a > >module? If so, which file in the source distribution should I look at? > > > >Thanks for any ideas, > > No widgets in PyGTK are picklable. The problem is that the data structures that would require persisting are not Python objects and, on top of that, mostly opaque to PyGTK. This would only be possible if GTK+ went miles out of its way to support easily persisting its data structures (GObjects and all), and even then, I'm don't know if it would be possible to use Python's pickle. Take care, -- Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331 ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: pickling a TreeStore? Re: [pygtk] Creating a sortable model derived from GenericTreeModel
On 23/10/2003 3:00 AM, Eugene Koontz wrote: I'm in a similar situation that Don Allingham describes in his post "Creating a sortable model derived from GenericTreeModel" : I have a big TreeStore that takes a long time to load. My proposed solution is to have a compile-time step of pickling the store to a file, and then at run-time, loading the pickled store into a TreeView. Unfortunately, when I try to pickle a TreeStore, I get : "TypeError: can't pickle TreeStore objects" According to the pickle documentation ( http://python.org/doc/2.3.1/lib/node64.html ), objects can be pickled if they are at the top level of a module. Would it be possible for me to hack the pygtk sources to put TreeStore at the top level of a module? If so, which file in the source distribution should I look at? Thanks for any ideas, No widgets in PyGTK are picklable. James. -- Email: [EMAIL PROTECTED] WWW: http://www.daa.com.au/~james/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
pickling a TreeStore? Re: [pygtk] Creating a sortable model derived from GenericTreeModel
I'm in a similar situation that Don Allingham describes in his post "Creating a sortable model derived from GenericTreeModel" : I have a big TreeStore that takes a long time to load. My proposed solution is to have a compile-time step of pickling the store to a file, and then at run-time, loading the pickled store into a TreeView. Unfortunately, when I try to pickle a TreeStore, I get : "TypeError: can't pickle TreeStore objects" According to the pickle documentation ( http://python.org/doc/2.3.1/lib/node64.html ), objects can be pickled if they are at the top level of a module. Would it be possible for me to hack the pygtk sources to put TreeStore at the top level of a module? If so, which file in the source distribution should I look at? Thanks for any ideas, Eugene ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/