From: Kevin A. <al...@se...> - 2004-09-13 14:54:25
|
On Sep 13, 2004, at 5:38 AM, Arthur Elsenaar wrote: > > On Sep 12, 2004, at 19:08, Kevin Altis wrote: > >> In general, if the PythonCard component doesn't support one of the >> styles supported by the underlying wxPython control, you'll have to >> subclass the PythonCard component or just modify it to suit your >> purposes. PythonCard will look for components in a directory called >> appcomponents in your main application directory before it loads from >> the default component list, so that can be used to override which >> version of a component is used if you want something >> application-specific. If you decide to provide you're own about the >> only thing you need to provide in the subclass is a replacement >> __init__ method, so just copy that from the original and change the >> style. >> >> In the case of this style, it is something that PythonCard really >> should support, so I'll make appropriate modifications to the >> multicolumnlist component and post something here once that is done. > > ok, added a directory 'appcomponents' next to my script, copied a > modified version of multicolumnlist.py in there. In the __init__ of > multicolumnlist.py, in line 92 I have added | wx.LC_NO_HEADER to the > rules. > > I still have headings, so I suspect the modified version is not > loaded. Any ideas what goes wrong here? > > Thanks, Arthur. > Sorry, I forgot to tell you that you also need a file named __init__.py in the appcomponents directory in order for the appcomponents directory to act as a package; that's how Python works. Just make a new blank file or copy the one that is already in the components directory. There are logging messages in the PythonCard framework to show what components are loaded and from where, so if you run your application with the -l command-line option you'll get a pythoncard.log file or output to stdout with a line that looks something like: DEBUG: : Mon Sep 13 07:48:07 2004: imported appcomponent multicolumnlist PythonCard customization note: Whether the output goes to stdout (the default) or not is controlled by a line in your pythoncard_config.txt file in ~/pythoncard_config/pythoncard_config.txt on *nix systems, including Mac OS X or your My Documents/pythoncard_config/pythoncard_config.txt or similar user directory on Windows systems, which is roughly equivalent to the home directory on *nix. The relevant lines are: 'logfile':'pythoncard.log', 'logToStdout':True, ka |