On Sun, 30 Sep 2001, Jonathan Pennington wrote:

> I've got a weird problem with GtkCTree, and before I tell you what it is
> I'll say that I'm using Python2.2aX and pyGTK 0.6.8. I know, but it's
> working fine for the most part, I'm developing for a pyGTK-release running
> system (Linux on iPAQ), and I can't get the beta of pyGTK1.99 to compile
> because of failed dependancies (pkg-config? pango? it can't find glib, but
> I have it installed, blahh). If this is going to cause the problem, you

The 1.99.x releases require the development versions (1.3.x) of gtk, etc.
If you are working with gtk+-1.2.x, ignore the 1.99 releases for now --
they are betas for the 2.0 release of pygtk.

> needn't read further- just yell at me to upgrade :). Oh, all the structures
> I'm using are those from Python2.0- there's no 2.2 specific stuff in this
> one.

0.6.8 shouldn't have any problems with 2.2 (I haven't verified this
though).

>
> Quick problem synopsis: CTree built recursively from a dictionary (dict is
> in instance, ie self.dict) in a method of a single class. When I update the
> dictionary, freeze() or clear() the tree, then rebuild the tree with the
> same method that originally built the tree, it freezes and trips out (words
> write on top of words in the tree, branches disappear, etc.) If I freeze()
> or clear() the tree, then add a node manually, it works fine. If I don't
> return to the original method, but update the dictionary manually, it
> freezes. I need a way to update both the tree and dictionary, or otherwise
> keep them in sync, because the tree should reflect changes over multiple
> runs of the program (It's an expense tracker/calculator). If this is the
> wrong way to do it, I guess I can make all changes to the tree directly and
> figure out a method to dump the tree to a file.

It is a bit difficult to work out what is happening.  Are you calling the
thaw() method the same number of times as you freeze it?

>
> I'll send code if needed, but thought this might be a conceptual error on
> my part, rather than a programming error.
>
> Hmm, just thought of something... can I pickle a CTree and load it on the
> next startup, thereby eliminating the need for the dictionary altogether? I
> know that *technically* I can, because Pickle can handle arbitrary data
> types, but can I from a pyGTK perspective. Not handling the dictionary at
> all would save a lot of code!

No :).  I haven't added support for pickling widgets (it might be doable
using widget properties, but probably wouldn't handle saving the tree
structure of a CTree).

>
> (By the way James- thank you very much for pyGTK. I was forced into using
> it instead of wxPython, but already like it more.)

Thanks.  When 2.0 comes out, hopefully you will like it even more :)

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to