change the style of combobox after creation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

change the style of combobox after creation

lior
I have this code:

self.optionCtrl = wx.combo.ComboCtrl(self,-1, style=wx.CB_READONLY |wx.CB_DROPDOWN)

I want to be able to change its style after creation (In some cases this list is editable and in some cases its not - the user can overwrite this setting manualy by clicking checkbox)

I tried:
self.optionCtrl.SetEditable(True)  

But it gives:
AttributeError: 'ComboCtrl' object has no attribute 'SetEditable'


I didnt find anything helpful in the documentation.

What can I do?
Reply | Threaded
Open this post in threaded view
|

Re: change the style of combobox after creation

Tim Roberts
lior wrote:

> I have this code:
>
> self.optionCtrl = wx.combo.ComboCtrl(self,-1, style=wx.CB_READONLY
> |wx.CB_DROPDOWN)
>
> I want to be able to change its style after creation (In some cases this
> list is editable and in some cases its not - the user can overwrite this
> setting manualy by clicking checkbox)
>
> I tried:
> self.optionCtrl.SetEditable(True)  
>
> But it gives:
> AttributeError: 'ComboCtrl' object has no attribute 'SetEditable'

The combo control has two distinct parts: the dropdown menu, and the
edit control.  You can access the two parts separately.  I suspect that
    self.optionCtrl.GetTextCtrl().SetEditable(True)
will do what you want.

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: change the style of combobox after creation

lior
Thank you!!!!
I just wish that the documentation would mention this.