From: Alberto G. <al...@ti...> - 2003-08-01 19:09:29
|
> Dear list, > > It seems since July 22, event id fields with a wxNewId() become global > variables in Python. Well, I guess it was not an accident ;-P > Up to now, I've been putting something like this > in the id field: > > self.someId = wxNewId() > > In my main application, I can get that ID by doing: > instantiatedFrame.someId I see. I must confess I didn't think of this trick when I changed the behaviour. > Is the idea now that all wxNewId() variables should be module global in > the generated Python? Well, I thought it was more useful to be able to access IDs from outside the __init__ code (and storing them as globals was the most obvious way - this is btw what the perl generator does, and also similar to the C++ one). > How difficult would it be to make this > configurable? Probably not difficult, but it requires some work. In particular for the UI: where should this option be available (the Application property window comes to mind, but this is quite python-specific). I have been thinking of adding some extra tabs to Application, for language-specific options. But I'd like to do this after releasing v 0.3. Also because I'm going on vacation and will probably be mostly offline for the next couple of weeks. But there's something that could be done right now: 1. Restore the old behaviour 2. "special-case" the workaround you are using (or maybe generalizing it, i.e. if the name of the id is something.like.THIS leave it as-is, while if it's SOMETHING_LIKE_THAT declare it global) So, what do you people think about this? Or do you have another (better) solution? > > Thanks for any information, > Charl Cheers, Alberto |