From: Steve C. <stn...@xm...> - 2005-07-19 15:31:37
|
Alex Tweedly wrote: > Mark Carter wrote: > > >Hello. > > > >I've written an app using PythonCard in Windows. However, when I take > >the code and run it on Ubuntu Linux (Ubuntu 5.04, Gnome) using my > >laptop, it has some issues. > > > >Specifically: > >- The drop-down choice box, because Gnome renders it with both an up > >and down arrow, is much bigger. > >- Fonts. I left them at default in Windows, which is Microsoft Sans > >Serif size 8. However, in Gnome, it defaults to Sans size 10. The > >size change resizes buttons on me, screws up my form layout, and just > >looks terrible. > > I should start off by saying I've never run Pythoncard on Linux (and > don't have any access to Linux to try it), so these answers should be > treated cautiously. > > For text and control sizing, there is no good *native PythonCard* > solution right now. The best way I know is to use wxPython's sizers to > make your layout fully self-sizing. That will typically make it nicer to > use anyway, and should handle issues like different system font sizes, > drop-down arrow sizes, etc. along the way. > > There's a good example of using sizers in the findfiles utility > (PythonCard/tools/findfiles), and there's some half-decent documentation > on sizers in the wxPython documentation/demo download. I'd chime in with Alex, I just added sizers to my app, and it was much easier than I thought it'd be. One thing to keep in mind, the size you make the components in the resource editor is the default size of the object when the sizer places them... So you might want to make them the minimal size. Also, in my app I have 3 multicolumn lists that take up the majority of the space on the window. Adding sizers that sized them proportionally to each other was doing very strange stuff until I made the initial size of each multi-column list the same 'unit' size (100x100). > > >- I have a text field (like a VB label) beside my choice drop-down. > >On Linux, it's got a border around it for some reason. > > No idea. Is it a TextField, or a StaticText ? Do all such fields get a > border on Linux ? I'm also on Ubuntu, using wxPython 2.6.1.0. I don't see it on my StaticText fields... Mark, which version of wxPython are you using? And, which version of PythonCard? If you want to see what the widgets look like on my system, you can look at the presentation I gave the other day: http://www.utahpython.org/meetings.spy (a screenshot of the widgets sample is on page 6 of the .pdf) > > >Everything else works fine, which is very good. But I need to clean > >up the user interface, which goes from looking great in Windows to > >crap in Linux. > > > >Anybody have any tips regarding cross-platform development? Am I > >going to have to maintain two versions of any software with a GUI? > > > Shouldn't need to if you can wrestle the layout into sizers - it's not > always easy to find the right combination of sizers to get the layout > you want. You could also do two resource files, run your app with '-l' on the command-line to see the set of resource files it tries to load at startup. But, I think you'd end up much happier using sizers. It does take work to get them right, but in the end it'll be less tweaking busy work. > > >On another note, I use NSIS to package a nice installer for Windows. > >What's the best way to package it up for Linux users? > > I definitely can't answer that one ... > What do you want to do w/ regard to packaging it up? Does it have dependencies on other applications/shared libraries? If so, you might need to look into .deb or .rpm packaging. If not, I'd just bundle it all up in a .tgz file and include adequate documentation in a README file. -Steve |