Top.Mail.Ru
Python
? ?
LiveJournal for python.
View:Personal Journal.
View:Friends.
View:Calendar.
Missed some entries? Then simply jump to the previous day or the next day.

Thursday, July 10th, 2008

Time:12:29 am.
In wxPython, when I am making a new 'frame', I find it to be a cluster to the code when I am adding the methods for the Menu events, along with other functions for the program. It makes the program unnecessarily larger for one file, and I want to break it down to make it easier to maintain.

Is there a way I can store the methods in a separate .py file to import into the main program as methods for the main application frame object? Every other time I try, an error comes up, and it must be because there's a focus conflict or the way I wrote it.

This is what I would have:

frame object
- def __init__ stuff (initialize the frame, size, position, title, etc.)
- Menu setup (Piece together the main menu on top like submenus and listed menus)
- frame setup (sizers, buttons, etc.)
- LOTS of methods for different events

startup

What I think I want to do is move the methods to another .py file so it can be maintained like a library of methods, and the main program can import it easily.

Anything I could be missing?

Thanks in advance.
Comments: Read 3 orAdd Your Own.

LiveJournal for python.

View:User Info.
View:Friends.
View:Calendar.
View:Memories.
Missed some entries? Then simply jump to the previous day or the next day.

Image