[pygtk] Calendar Widget

Samuel Abels newsgroups at debain.org
Fri Oct 12 03:14:57 WST 2007


Alright, I have a basic version ready. The way in which events are
painted is very preliminary, but it should work. It also takes its
colors from the currently selected Gtk/GNOME theme. A short demo:

http://debain.org/stuff/calendar.ogg
(250K)

I implemented a simple model/view, where the event model (which does not
have to be used, you can also use the calendar as a replacement for
GtkCalendar) is currently *really* dumb, but good enough for what I am
planning to do. Example code:

------
[...]
import GooCalendar
event_store   = GooCalendar.EventStore()
calendar      = GooCalendar.Calendar(event_store)
my_container.add(calendar)
event         = GooCalendar.Event('Lalala',
                                  datetime.datetime(2007, 10, 9),
                                  datetime.datetime(2007, 10, 11))
event_store.add_event(event)
------

Calendar signals: Pretty much just "day-selected" (in addition to the
goocanvas.Canvas signals).

The package is here:

http://debain.org/stuff/goocalendar-0.0.0.1.tgz

Not sure how much I am going to work on this in the next days, but I am
planning to improve this further. If anyone has a good repository to
store this (a repository for third party PyGtk widgets would be nice)
let me know, else I'll maintain it in my application's SVN.

-Samuel



More information about the pygtk mailing list