From: <gre...@co...> - 2004-09-12 17:03:56
|
Sorry, I forgot to describe the bug. This is a specific problem only with the resource editor. Basically what happens is I open resource editor, select 'Choice' (or 'Combobox'), then I go to the properties window, select items, type in [1,2,3] (or ['1','2','3'] either causes it), click update, then I go to stringselection, press the drop down button and see 1,2,3. I choose 1, and nothing seems to happen, then I hit update, and still nothing happens. Finally I hit save and code is generated without a stringselection specified. Does that explain it better? -Greg Kevin Altis wrote: > On Sep 12, 2004, at 9:40 AM, Gregory Piñero wrote: > >> Actually, it seems to only happen with numbers as items. Also I typed >> them as [1,2,3] in the resource editor field. Maybe it's required to >> do, ['1','2','3'] ? >> >> -Greg >> >> >> Gregory Piñero wrote: >> >>> Minor bug? Maybe this was already fixed in the latest version? >>> Below is the code generated by the resource editor. You can use it >>> to replicate the bug, but any example should work. >>> -Greg >>> Version Info: >>> PythonCard version: 0.8 >>> wxPython version: 2.5.2.7 >>> Python version: 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit >>> (Intel)] >>> Platform: win32 >>> {'application':{'type':'Application', >>> 'name':'Template', >>> 'backgrounds': [ >>> {'type':'Background', >>> 'name':'bgTemplate', >>> 'title':'Standard Template with no menus', >>> 'position':(198, 198), >>> 'size':(490, 582), >>> 'components': [ >>> {'type':'Choice', >>> 'name':'Choice1', >>> 'position':(118, 78), >>> 'size':(130, -1), >>> 'backgroundColor':(255, 128, 255), >>> 'foregroundColor':(0, 0, 255), >>> 'items':['1', '2', '3', '4', '5', '6'], >>> }, >>> ] # end components >>> } # end background >>> ] # end backgrounds >>> } } >>> > > You didn't say what the bug was before, but I assume you mean that the > items in the list are strings? If so, yes, the items in the list must be > strings for all the components that have an items list attribute. Use > str() and int() to convert back and forth in your code if you need to > work with integers internally, but display them as strings in the > components. > > If you wanted to use stringSelection to select the item '3' in the list > then you would do something like: > > self.components.Choice1.stringSelection = '3' > > but if you wanted to select the item by its numeric position in the > list, remember to use an integer as well as that the list is zero-based, > like most things in Python. > > self.components.Choice1.selection = 2 > > ka > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > |