From: <gre...@co...> - 2004-09-12 15:36:57
|
Kevin, Your answer makes sense. I guess all I really want to do is disable text entry so the user must choose one of the list items. I'm wondering if I'm using the wrong GUI component? For example on a web form, a drop-down box type thing only presents the preset choices, so I just want a GUI version of that type of webform thing. I'll play with the resource editor a bit, see if there's something that already works like that. Otherwise I'll look up how to just disable text entry. -Greg Kevin Altis wrote: > On Sep 11, 2004, at 5:11 PM, Gregory Piñero wrote: > >> A combobox lets me write text in it instead of forcing me to select >> one of its listed choices, however this text does appear to do >> anything as it does not show up in .stringselection. This is even the >> case when I type in the exact same text as a listed choice in the >> combobox. >> >> This could be a bug depending on the desired behavior here. I believe >> the desired behavior should be to not allow text entry into a >> combobox, or giving an option to turn on text entry. But if the user >> is allowed to enter his own text, it should be picked up somewhere, >> right? >> > I don't believe the underlying wxPython ComboBox does anything with the > text the user types in the field, but rather leaves it up to you to > decide whether you want to do some processing. PythonCard does not bind > the EVT_TEXT_ENTER event, but you can handle the keyPress event, and do > some processing if event.keyCode == 13, otherwise just call > event.skip(). That way if the user presses Return you can add the text > to the ComboBox list. You can use the keyPress or textUpdate event if > you want to look at the current text and then change the stringSelection > based on what the user has typed. I believe that by default the > selection will be changed only when the user clicks on the dropdown arrow. > > If PythonCard is not behaving the same as the ComboBox in the wxPython > demo then there could be a bug in the PythonCard component, but I'm > pretty sure it is working the same. > > 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 > |