a widget : The timegrid

Hi all,

(Sorry for my english : i’m french)

You can find in the attached file a little test of a timetable using a grid. It shows how to use such functions as gridlabelrenderer or PyGridCellRenderer. Cells are sensitives as you can move and resize timebars by clicking on them. And there’s no flicker at all. It’s poorly coded but it maybe can give ideas to beginners like me !

Have a good day.

timegrid.py (21.7 KB)

Hi,
it looks interesting; thanks for the demo.
You may probably simplify some of the code doing the color
conversions by using the built in python functions in the "colorsys"
module

http://docs.python.org/2/library/colorsys.html#colorsys.rgb_to_hsv
http://docs.python.org/2/library/colorsys.html#colorsys.hsv_to_rgb

However, these functions work with floats in the range 0-1, hence some
conversion would be needed in your code.

regards,
   vbr

···

2013/3/11 Noe <noethys@gmail.com>:

Hi all,

(Sorry for my english : i'm french)

You can find in the attached file a little test of a timetable using a grid.
It shows how to use such functions as gridlabelrenderer or
PyGridCellRenderer. Cells are sensitives as you can move and resize timebars
by clicking on them. And there's no flicker at all. It's poorly coded but it
maybe can give ideas to beginners like me !

Have a good day.

Hi,

Indeed, i didn’t know this module. Thx !

···

Le lundi 11 mars 2013 14:40:07 UTC+1, vbr a écrit :

2013/3/11 Noe noe...@gmail.com:

Hi all,

(Sorry for my english : i’m french)

You can find in the attached file a little test of a timetable using a grid.

It shows how to use such functions as gridlabelrenderer or

PyGridCellRenderer. Cells are sensitives as you can move and resize timebars

by clicking on them. And there’s no flicker at all. It’s poorly coded but it

maybe can give ideas to beginners like me !

Have a good day.

Hi,

it looks interesting; thanks for the demo.

You may probably simplify some of the code doing the color

conversions by using the built in python functions in the “colorsys”

module

http://docs.python.org/2/library/colorsys.html#colorsys.rgb_to_hsv

http://docs.python.org/2/library/colorsys.html#colorsys.hsv_to_rgb

However, these functions work with floats in the range 0-1, hence some

conversion would be needed in your code.

regards,

vbr