f



AttributeError: 'Attributes' object has no attribute 'saveFile'

Not sure how to explain, but I'll try my best.  I'm making a GUI with
wxGlade.  The GUI has windows that open when the "Next Page" button is
pushed; the button also pickles the information that is input into the
frame at the same time.  The saveFile name is autocreated based on the
data entered by the user in the first frame.

Each frame that is created is a new class, e.g. the first frame that
opens is "CharInfo", which opens the frame "Attributes".  The pickling
works for the first frame but doesn't work for the ones after.
Apparently the saveFile attribute I created in the "CharInfo" class
isn't carried through to "Attribures", even though it's supposed to be
a subclass.

I've tried several different ways to get it working, such as expressly
calling CharInfo.saveFile, calling CharInfo.pushedButton.saveFile
(saveFile is part of the pushedButton method), calling
Attributes.saveFile, and calling self.saveFile.  Every time, I get the
AttributeError message stating saveFile is not an attribute of either
the classes or any function.

The reason I want to keep the same saveFile attribute through every
class is because the initial button in CharInfo creates the file save
name and path; I'd like to have it carried through the rest of the
classes so each new frame will save it's information to the same file.

Is there a way to keep the saveFile "live" throughout the entire
program or would it be better to create a "choose a filename" window at
the end of the program?  If the latter, is there anything special I
need to know so the information in each class is pickled correctly?

0
8/31/2006 11:50:16 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

2 Replies
706 Views

Similar Articles

[PageSpeed] 0

Hi

Sounds like you've got a wizard-type interface thing happening.
I haven't used wxGlade but I have done similar things in GTK several
times.

Try putting all the windows in a notebook widget with hidden tabs.
Put the 'Next Page' button and the filename outside the notebook.  This
makes the filename always available and the 'Next Page' button would
just switch pages in the notebook widget.

Hope this is helpful

Cheers
Tim

0
9/1/2006 1:15:10 AM
t.mitchell@aranz.com wrote:
> Hi
>
> Sounds like you've got a wizard-type interface thing happening.
> I haven't used wxGlade but I have done similar things in GTK several
> times.
>
> Try putting all the windows in a notebook widget with hidden tabs.
> Put the 'Next Page' button and the filename outside the notebook.  This
> makes the filename always available and the 'Next Page' button would
> just switch pages in the notebook widget.
>
> Hope this is helpful
>
> Cheers
> Tim
Sounds simple enough.  Of course, we all know the difference between
theory and practice.  I think I rember seeing a wizard-type interface
in the wxGlade tutorial.  I'll take a look at that to.  Thanks for the
tip.

0
9/1/2006 7:52:53 AM
Reply: