Hi all,
I attached the source. in line 450 in the SaveTest function:
self.tree.GetFirstChild(self.root)
Self being the frame, tree the wxTreeCtrl control.
As best as i can determine, that line is the troublsome one. But - and here's the wierd thing - it worked fine ten minutes ago
when I used it in a for loop to print out all the root's childen...
If you have a spare 5 minutes and can test it for me: choose add>new sentence, type a few words (no punctuation), then
choose file>make script.If it worked, You will see all the tree items printed out in a list, with child items nested as new lists
in the console window. If it crashed... well, you wont see much :p.
Please tell me either way, and if you can, please help! I'm desperate.
BTW incase its important, am using Python 2.2.2 with wxPython 2.3 under winxp.
I attached the source. in line 450 in the SaveTest function:
self.tree.GetFirstChild(self.root)
Self being the frame, tree the wxTreeCtrl control.
As best as i can determine, that line is the troublsome one. But
- and here's the wierd thing - it worked fine ten minutes ago
when I used it in a for loop to print out all the root's
childen...
If you have a spare 5 minutes and can test it for me: choose
>new sentence, type a few words (no punctuation), then
choose file>make script.If it worked, You will see all the tree
items printed out in a list, with child items nested as new lists
in the console window. If it crashed... well, you wont see much
:p.
Please tell me either way, and if you can, please help! I'm
desperate.
On Win2K it crashes for me too, and it does seem that the line you
indentified is the offending line. I am out of my league here, but
the docs say that tree.GetFirstChild requires a 'cookie' as well as
the item id. See what happens when you try:
def SaveTest(self, event):
# 2000 is the 'cookie' that I made up
print self.tree.GetFirstChild(self.root, 2000)
At least it does not crash.
Regards,
···
=====
Donnal Walter
Arkansas Children's Hospital
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus � Powerful. Affordable. Sign up now.
The cookie is used for re-entrance because you may want to use it later if you call
GetNextChild(): see the wxWindows docs for treectrl.GetFirstChild():
"""wxPython note: In wxPython the returned wxTreeItemId and the new cookie
value are both returned as a tuple containing the two values."""
After you get the first child you use the value returned in the cookie as a param
for GetNextChild().
#--------------------------------
Jeff Sasmor
jeff@sasmor.com
----- Original Message -----
From: "Donnal Walter" <donnalcwalter@yahoo.com>
To: <wxPython-users@lists.wxwindows.org>
Cc: <andrewthegreen@netscape.net>
Sent: Saturday, November 23, 2002 10:09 AM
Subject: Re: [wxPython-users] Python crashes on wxTreeCtrl.GetFirstChild()
--- Amos Joshua wrote:
I attached the source. in line 450 in the SaveTest function:
self.tree.GetFirstChild(self.root)
Self being the frame, tree the wxTreeCtrl control.
As best as i can determine, that line is the troublsome one. But
- and here's the wierd thing - it worked fine ten minutes ago
when I used it in a for loop to print out all the root's
childen...
If you have a spare 5 minutes and can test it for me: choose
>new sentence, type a few words (no punctuation), then
choose file>make script.If it worked, You will see all the tree
items printed out in a list, with child items nested as new lists
in the console window. If it crashed... well, you wont see much
:p.
Please tell me either way, and if you can, please help! I'm
desperate.
On Win2K it crashes for me too, and it does seem that the line you
indentified is the offending line. I am out of my league here, but
the docs say that tree.GetFirstChild requires a 'cookie' as well as
the item id. See what happens when you try:
def SaveTest(self, event):
# 2000 is the 'cookie' that I made up
print self.tree.GetFirstChild(self.root, 2000)
At least it does not crash.
Regards,
=====
Donnal Walter
Arkansas Children's Hospital
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org