wx.TimePickerCtrl "is only available if USE_TIMEPICKCTRL is set to 1".

58 views
Skip to first unread message

Paul Keating

unread,
May 20, 2015, 8:25:04 PM5/20/15
to wxpytho...@googlegroups.com
I upgraded wxPython from 2.7 to 3.0 and began getting the message AttributeError: 'module' object has no attribute 'TimePickerCtrl'.

The message is correct. My 3.0 version of wx no longer contains the class TimePickerCtrl. The help explains why: wx.TimePickerCtrl "is only available if USE_TIMEPICKCTRL is set to 1". But this is not very much help because it doesn't say whether USE_TIMEPICKERCTRL is a conditional define, or an environment variable, or a runtime switch, or a magic constant, or something else.

After some brute-force searching I know now that wxUSE_TIMEPICKCTRL (not USE_TIMEPICKCTRL) is a C-style conditional define.

But that gets me no further. As a humble Python programmer who last programmed in C twenty years ago, what do I do to switch it on, how do I then trigger a recompile on a 64-bit Windows platform, and what do I need to know about why it is disabled in 3.0, when it wasn't disabled in 2.7? it isn't that Windows doesn't have a native control for this. It does.

Paul Keating

unread,
May 22, 2015, 3:30:58 PM5/22/15
to wxpytho...@googlegroups.com
I discover that all the documentation entry for wx.TimePickerCtrl lacks is:

(1) A remark that the control is deliberately and permanently disabled (not putatively available if you set some conditional define ... that may be true, but it's misleading to a newcomer); and

(2) A see-also reference to wx.lib.masked.TimeCtrl.
Reply all
Reply to author
Forward
0 new messages