From: <kim...@ya...> - 2005-07-05 22:21:22
|
Alex Tweedly wrote: > kim...@ya... wrote: > >> I don't know whether this is true or not with other Python GUI >> toolkits (I only know PythonCard) but I >> find PythonCard extremely easy to handle situations >> where you have a number of user interfaces that are >> quite similar and yet each one has it's own subtleties >> that needs its own code. >> For instance, with the application I am developing, I >> have many situations like that. So, what I did was to >> define a super-class for all of the similar GUIs. Then I have one file >> (module) for each of the GUIs, >> and subclass them from the super-class. This way, I >> can have a resource file for each of them, and yet >> share lots of the common action code as long as I >> structured the code accordingly. >> >> >> > If you have an example of that you'd be willing to share, I'd love to > see it (preferably the code etc. , not just a description, please). > In my case, I have a lot of lists that require editing. So, I have a GUI with a left list, and a right list. Now, there are lots of things I want to do with such a panel. Like: move an item from the left side to the right side, sort the lists, move them up and down, and so forth. But then with some lists, I don't want them sorted and I don't want the sort button at all. Some might have additional controls in addition to the left/right list.... Some buttons essentially do the same thing but requires different labels... All of which can be done by additional if/then/else code but that makes the code quite unreadable and hard to maintain. So, I use the sub-classing architecture instead. The code comes out very very clean and easy to maintain. I can put together tonight when I get home. >> I really like PythonCard. The only gripe I have is >> the lack of more detailed documentations, like which >> control supports which method and so forth - the >> existing documentation needs a lot of improvement. I >> had to spend a lot of time looking through code before >> I can figure out how to do certain things. >> >> >> > Did you look at the html files created from the "widgets" sample ? > Is there more detail that you need, or something missing from there ? > Yes, I have. > (that's for the first part about details of which controls support which > methods; I agree more documentation would be good - though I really like > looking at the samples to see how things are done. Given a choice of a > certain level of effort in writing docs vs. extending samples to give > more coverage, I'd put the hours of effort into more examples ...) > > This is always a chanllenge for programmers... :=) -- John |