From: Roger B. <ro...@ro...> - 2004-02-16 02:53:54
|
> > Do you have to manually resize it? > > Yes, a manual resize is necessary. Sorry, I missed this somehow > earlier, so it didn't make it into the test4 build I just sent. > However, I'll check it out and have something that works in a logical > way ready for the next go-round. That may explain the wxPython demo. The current code is in bphtml, line 325. The two lines commented out come from the demo. They set the print preview window to be the same size and position as the main app window (and hence totally covering it). Needless to say that is really silly since it seems like your main app window has disappeared. If you are looking for a little project, I do have one for you. I think the size of the preview frame should be saved. The main Window should also have its size saved (see gui.py line 477). You can see an example of saving and setting sizes in guiwidgets.py line 362. That code however is defective because it should really be done within the window (in this case the comm port browser) code rather than outside of it. The other defect of that code is that it doesn't check the screen size. Many people now have screens that can change size between runs of a program (eg a laptop in docked and undocked configurations). Nothing is more annoying than having a program remember its size and/or position and then place them off the screen you now have, or too big. As a suggested implementation, put a standalone function in guiwidgets.py that takes the config object, basename for configoptions, and a suggested screen size (as a percentage value). It should be called from the __init__ method of various Windows/dialogs which would check the current size, make it smaller if too big for the screen, and if the size is absurdly small or there is no saved size, then size the window at the percentage of current screen size supplied. Another function would need to be present that is called when the Window/dialog is closed, and save the current size. Bonus points for doing all this with position as well. Even more bonus points for fixing cruddy code mentioned above. On a seperate topic, can you verify you can get M2Crypto installed http://sandbox.rulemaker.net/ngps/m2/ I am doing a little side thing that should make development easier when the phone is on another machine. The M2Crypto is needed to get SSL support. I only care about 10.3 for this (so the 10.2 instructions on that site are hopefully not needed or relevant). Roger |