[pyar] TimePickerCtrl en wxPython

Mariano Reingart reingart en gmail.com
Sab Mayo 31 01:47:29 ART 2014


2014-05-27 18:15 GMT-03:00 Willians Vivanco <williansvi en gmail.com>:

> Hola... Existirá en wxPython alguna clase como wx.DatePickerCtrl pero para
> la hora en lugar de la fecha?
>

En el modulo lib.masked tenes TimeCtrl:

http://www.wxpython.org/docs/api/wx.lib.masked.timectrl.TimeCtrl-class.html

Para Phoenix:

http://wxpython.org/Phoenix/docs/html/lib.masked.maskededit.html

Podes verlo funcionando y copiar el código en el demo (adjunto imagen
reducida):


​
​

> Estuve viendo
> http://wxpython.org/Phoenix/docs/html/adv.TimePickerCtrl.html pero no me
> quedan claras algunas cosas, como por ejemplo donde debo setear el
> USE_TIMEPICKCTRL a 1?
>
>
USE_TIMEPICKCTRL es un parámetro de compilación de wxWidgets (la biblioteca
a la cual "envuelve" wxPython) que está habilitado por defecto (al menos en
la última versión trunk / master actual para gtk)
Por ello, aparentemente en wxPython Phoenix viene incluido y no debes
recompilar ni hacer nada adicional (por lo menos para gtk, por lo que leí
en windows también funcionaría y de manera nativa)

reingart en s5ultra:~$ python3
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> wx.version()
'3.0.1.dev76577 gtk2 (phoenix)'
>>> import wx.adv
>>> wx.adv.TimePickerCtrl
<class 'wx._adv.TimePickerCtrl'>
>>> wx.adv.TimePickerCtrl()
<wx._adv.TimePickerCtrl object at 0x7f60d94dab70>

No tuve tiempo de probarlo un poco más pero debería funcionar como está
documentado.

Sds

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20140531/5de3fd23/attachment-0001.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: wxTimeCtrl.png
Type: image/png
Size: 28319 bytes
Desc: no disponible
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20140531/5de3fd23/attachment-0001.png>


More information about the pyar mailing list