Thanks, I'll try that out. See on GTK I didn't need to do anything
beyond what I did, hence the confusion. For the most part I must say the
port has been really smooth though.
Iain
···
On Fri, 2008-18-04 at 08:47 -0500, Mike Driscoll wrote:
iain duncan wrote:
> On Wed, 2008-16-04 at 14:05 -0700, Robin Dunn wrote:
>
>> iain duncan wrote:
>>
>>> Hi folks, I found a sample online of making a readonly field in my form
>>> and am doing it like so:
>>>
>>> input = wx.TextCtrl( parent, -1, field.label,
>>> style=wx.TE_READONLY | wx.NO_BORDER, size=(INPUT_WIDTH,-1) )
>>>
>>> input.SetBackgroundColour( parent.GetBackgroundColour() )
>>>
>>> This is working fine on Gnome, but on OS X they are just regular 'ol
>>> inputs that the user can type in. Anyone know what I have done wrong or
>>> is this a Known Issue?
>>>
>> That style flag works for me.
>>
>
> Ok, I figured out that it does make it read only, but the input does not
> change background colour, and still receives a cursor focus with an
> outline and a blinking cursor inside it. So it looks to a user like a
> functioning input that just doesn't work instead of looking like a read
> only field. Is it just not usable on OS X?
>
> At any rate, I wouldn't release with a disabled input looking like that
> for a user. I guess I can change them all to static text fields ...
>
> thanks
> Iain
>
>
>
Maybe I'm missing something here, but why don't you just disable the
widget? In your example, all you'd have to do after initializing the
TextCtrl is call the Disable() method on it, like so:input.Disable()
You can still update the TextCtrl programmatically, but the user cannot
touch it. That's what I do when I want the TextCtrl to look disabled.