Phoenix - can't enable custom control

3 views
Skip to first unread message

Werner

unread,
Apr 28, 2013, 12:43:16 PM4/28/13
to wxpyth...@googlegroups.com
Hi,

I have a custom control which is based on the PopUp control sample in
the demo and in Phoenix this control can't be enabled.

In Phoenix I use wx.Control instead of wx.PyControl in 2.9.5 (where it
works) and the control has an "Enable" method which enables the two
contained controls (a button and a textctrl).

Any idea what might cause this - before I need to create a sample app;-) .

Werner

Robin Dunn

unread,
Apr 30, 2013, 12:29:46 AM4/30/13
to wxPyth...@googlegroups.com
I think I'll need to see a sample on this one. Thanks.


--
Robin Dunn
Software Craftsman
http://wxPython.org

werner

unread,
Apr 30, 2013, 10:31:46 AM4/30/13
to wxPyth...@googlegroups.com
On 30/04/2013 06:29, Robin Dunn wrote:
> Werner wrote:
>> Hi,
>>
>> I have a custom control which is based on the PopUp control sample in
>> the demo and in Phoenix this control can't be enabled.
>>
>> In Phoenix I use wx.Control instead of wx.PyControl in 2.9.5 (where it
>> works) and the control has an "Enable" method which enables the two
>> contained controls (a button and a textctrl).
>>
>> Any idea what might cause this - before I need to create a sample
>> app;-) .
>
> I think I'll need to see a sample on this one. Thanks.
I narrowed it down, but don't have a sample app for it yet.

When I create controls I do this (SearchCtrl is my popup based custom
control)

tctrl = searchctrl.SearchCtrl(tpane, wx.ID_ANY, name=ctrlname,
mask = u"*{%i}" % ctrl['dbLength'])
tctrl.Disable()

Later on when data is loaded I do tctrl.Enable(True), if I replace the
tctrl.Disable() with tctrl.Enable(False) then it works fine.

Werner


Robin Dunn

unread,
May 1, 2013, 8:21:32 PM5/1/13
to wxPyth...@googlegroups.com
Try changing the Enable in the PopupCtrl class to be called DoEnable
instead. Then see if calling Enable() and Disable() work as expected.
Enable and Disable both call DoEnable, and in Phoenix it is the one that
is virtualized. I can also make Enable be virtual again, but I'm
curious to see if overriding DoEnable instead of Enable fixes this.

werner

unread,
May 2, 2013, 3:01:21 AM5/2/13
to wxPyth...@googlegroups.com
Hi Robin,

On 02/05/2013 02:21, Robin Dunn wrote:

...
> Try changing the Enable in the PopupCtrl class to be called DoEnable
> instead. Then see if calling Enable() and Disable() work as expected.
> Enable and Disable both call DoEnable, and in Phoenix it is the one
> that is virtualized. I can also make Enable be virtual again, but I'm
> curious to see if overriding DoEnable instead of Enable fixes this.
Yes, if I override DoEnable in my custom PopupCtrl then all is fine.

Werner
Reply all
Reply to author
Forward
0 new messages