From: Liam C. <cy...@gm...> - 2005-03-20 04:56:58
|
Why not just bind each string to a particular function in a dict? On Sat, 19 Mar 2005 21:32:57 -0600, bra...@om... <bra...@om...> wrote: > > I don't suppose there is a way to accomplish this same goal with a simple > dialog.singleChoiceDialog. I did a dir on the result of singleChoiceDialog, > but didn't see anything that looked promising. I could work backward by > searching the list for the matching string, but that seems kludgy. > > Thanks... > > > pyt...@li... wrote on 03/15/2005 07:59:15 > PM: > > > > Hi Brad, > > > > > > for a multicolumnlist called MCL, because I'm boring - > > > > def on_MCL_itemActivated(self, event): > > wasSelected = self.components.MCL.getStringSelection()[0] > > > > will return the list(line) that was clicked on. > > > > To get an actual index for it, use - > > > > def on_MCL_itemActivated(self, event): > > selectedIndex = event.m_itemIndex > > > > > > I trawled through the wxPython multicolumnlist demo code to find that. > > Remember, 90% of the wxPython tricks you need are in the demo, it's > > just the knack of finding them. > > Only reason I found that is I noticed that when you click an item in > > that demo it prints stuff like this - > > > > OnItemSelected: 5, Billy Joel, Blonde Over Blue, Rock > > > > So yeah... good luck, Pythoncard is great, and very flexible, and it's > > not that often you have to revert to the wx stuff. > > > > > > HTH > > > > Liam Clarke > > -- > > 'There is only one basic human right, and that is to do as you damn > > well please. > > And with it comes the only basic human duty, to take the consequences. > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT Products from real users. > > Discover which products truly live up to the hype. Start reading now. > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > > _______________________________________________ > > Pythoncard-users mailing list > > Pyt...@li... > > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > -- 'There is only one basic human right, and that is to do as you damn well please. And with it comes the only basic human duty, to take the consequences. |