Ejemplo n.º 1
0
    def __init__(self, title, init_width=230, init_height=230):
        """
        Instantiate an instance of _BasePyClock.

        @type title: str
        @param title: String to be used for the window title.

        @type init_width: int
        @param init_width: Initial width of the window.
            DEFAULT: 230

        @type init_height: int
        @param init_height: Initial heigh of the window.
            DEFAULT: 230
        """
        super(BasePyClock, self).__init__()

        self.set_title(title=title)
        self.resize(width=init_width, height=init_height)
        self.set_position(position=WIN_POS_CENTER)
        self.connect("destroy", main_quit)

        self._time = datetime.now()

        self._draw_area = DrawingArea()
        self._draw_area.connect("expose-event", self._expose)
        self.add(self._draw_area)

        timeout_add(1000, self._update)

        self.show_all()