Beispiel #1
0
    def __init__(self, parent_window):
        super(HistoryView, self).__init__()
        self.parent_window = parent_window
        self.calendar = gtk.Calendar()
        self.tomato_view = self._create_tomato_view()
        self.tomato_model = self.tomato_view.get_model()
        self.stat_model = WeeklyStatisticsModel()
        self.stat_graph = WeeklyBarChart(self.stat_model)

        tomato_wnd = gtk.ScrolledWindow()
        tomato_wnd.add(self.tomato_view)
        tomato_wnd.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)

        tomato_view = gtk.Viewport()
        tomato_view.add(tomato_wnd)

        top_hbox = gtk.HBox(False, 0)
        top_hbox.pack_start(self.calendar, False, False, padding=5)
        top_hbox.pack_start(tomato_view, True, True, padding=5)

        top_vbox = gtk.VBox(False, 0)
        top_vbox.pack_start(top_hbox, True, True, padding=5)

        self.pack1(top_vbox, shrink=False)
        self.pack2(self.stat_graph, shrink=False)

        self._on_day_changed(self.calendar)
        self.calendar.connect('day-selected', self._on_day_changed)