From: <gre...@co...> - 2004-09-12 15:31:08
|
Ah yes, silly mistake with using the string 'false'. My syntax highlighting doesn't pick up True/False, so I figured they weren't keywords... I'm still confused about the general False vs 0 issue in python, are they interchangeable? ..but that's off topic for for this list. Sorry for the false alarm. Greg Kevin Altis wrote: > On Sep 11, 2004, at 4:48 PM, Gregory Piñero wrote: > >> I am wondering if I have run into a bug. In the textarea and >> textfield components, if I create them during runtime, and set enabled >> to false, it does not get grayed out and I am still able to edit the >> component. Additionally, I tried setting editable to false and nothing >> seemed to change from that either, as I appeared to be able to still >> edit the text. >> >> By the way, what is the difference between editable and enabled? >> >> 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 >> >> Here's the part of my code where I am creating the textfield. (sorry >> if email bungles the tabs.) >> >> editable='False' >> tooltip='' >> widgetDefn={'type':'TextField', >> 'name':'txt'+ column[0], >> 'position':(xPosWidget, yPos), >> 'text':'', >> 'editable':editable, >> 'enabled':editable, >> >> 'toolTip':tooltip, >> 'size':(20,-1)} >> self.components[widgetDefn['name']]=widgetDefn >> > > Um, you aren't setting them to False, you're setting them to a string > 'False' and all strings except the empty string '' evaluate to True. > Change the line above to: > > editable = False > > Enabled applies to all controls and determines whether those controls > get mouse clicks, whether the user can type text in them, select items > in a list, etc. Editable only applies to fields and determines whether > you can type text into the field or not. You can still copy text from > the field. The widgets sample shows off both attributes. > > BTW, please don't respond to another message to post a new question. The > mail message headers that mail clients use to show message threads are > still there even though your mail client may not show them, and so it > screws up the display of those threads. > > 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 > |