On Aug 4, 2013, at 12:45 PM, vvyogi . <[email protected]> wrote:

> The *Class Designed* Generates a xml file with "cdxml" extension. This xml
> has all my* UI design* and *UI elements* and *Code* as well. As I am adding
> more each day, the size of this cdxml file is growing and *on each save/save
> -as* I have to wait for 8-12seconds.
> 
> Now, I have stopped using the Class Designed and I am editing the XML file
> directly and running it in python shell. This makes *save/save-as* faster
> but the app loading *seems* slow.
> My Questions are :
> 
> 1. Is my approach i.e. using the cdXML to store "UI + code" right?

It is one option; the other is to store them in separate files (see below).

> 2. How can I separate the code from cdXML file and put it into a "py" file.
> Will this make my app load fast.

Under the File menu in the Class Designer is a toggle item: "Single File for 
Layout and Code". Select that to uncheck the option. Now when you save your 
design, the UI elements are stored in the cdxml, and the code in a separate .py 
file. If your cdxml file is named "foo.cdxml", your code will be in 
"foo-code.py".

I can't say whether this will make your app load faster. A lot depends on how 
deeply you nest items within other items. I've noticed that if I have several 
pageframes, and each page has many items, wxPython takes a lot longer than when 
the same number of items are in an unnested arrangement.

> 3. Right Now I am using *lengthy* statements like
> "self.Form.dPanel.dPageFrameNoTabs.cyclePages(1)" how can i avoid that.

I find RegIDs helpful to avoid long references like that. Not only does it save 
typing, but if you later move or rename any element in the chain, your code 
will break, whereas the RegID is not dependent on the name of the control or 
any of its "parents".

> 4. I am using RegID to access all my textBoxex and EditBoxes( there are a
> total of 50+ of them colletively) Does it make my app Slow?

If anything, the use of RegID will speed things up. There is probably something 
else that is causing the slowdown.

What I do sometimes is save a copy of my current form, and then try removing 
sections just to see how it affects performance. If it doesn't, I recopy the 
original, and try something else. If I do see a change, then at least I have a 
clue as to what could be responsible, and I can then focus on that part.


-- Ed Leafe





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to