From: Alec B. <wry...@gm...> - 2006-12-18 13:13:53
|
This is a hard one to explain, but here goes. I'd like to be able to script component names in my PythonCard layout. For example, instead of saying something like: self.components.button4.file = "some_picture.jpg" I'd like to be able to do something like: button_number = 4 button = 'self.components.button" + `button_number` + ".file = "some_picture.jpg"' Currently I'm burying everything in way too many if statements, which is always a sign I'm doing things sloppily. If I could write a function that, for example, redraws only a specific button, my code would get much neater. But without being able to script or concatenate the component name, I can't think of a way to do that. Is such a thing possible? Or is there some clever way to achieve the same thing? |