From: Kevin A. <al...@se...> - 2004-09-12 02:56:20
|
On Sep 11, 2004, at 4:48 PM, Gregory Pi=F1ero wrote: > I am wondering if I have run into a bug. In the textarea and=20 > textfield components, if I create them during runtime, and set enabled=20= > to false, it does not get grayed out and I am still able to edit the=20= > component. Additionally, I tried setting editable to false and nothing=20= > seemed to change from that either, as I appeared to be able to still=20= > 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=20= > (Intel)] > Platform: win32 > > Here's the part of my code where I am creating the textfield. (sorry=20= > if email bungles the tabs.) > > editable=3D'False' > tooltip=3D'' > widgetDefn=3D{'type':'TextField', > 'name':'txt'+ column[0], > 'position':(xPosWidget, yPos), > 'text':'', > 'editable':editable, > 'enabled':editable, > 'toolTip':tooltip, = =20 > 'size':(20,-1)} > self.components[widgetDefn['name']]=3DwidgetDefn > Um, you aren't setting them to False, you're setting them to a string=20 'False' and all strings except the empty string '' evaluate to True.=20 Change the line above to: editable =3D False Enabled applies to all controls and determines whether those controls=20 get mouse clicks, whether the user can type text in them, select items=20= in a list, etc. Editable only applies to fields and determines whether=20= you can type text into the field or not. You can still copy text from=20 the field. The widgets sample shows off both attributes. BTW, please don't respond to another message to post a new question.=20 The mail message headers that mail clients use to show message threads=20= are still there even though your mail client may not show them, and so=20= it screws up the display of those threads. ka |