def draw_ticks(self):
        """Draw the time tick markers on the TimeLine Canvas"""
        self._canvas_ticks.create_line((0, 10, self.pixel_width, 10), fill="black")
        self._ticks = list(TimeLine.range(self._start, self._finish, self._tick_resolution / self._zoom_factor))
        for tick in self._ticks:
            string = TimeLine.get_time_string(tick, self._unit)
            x = self.get_time_position(tick)
            x_tick = x + 1 if x == 0 else (x - 1 if x == self.pixel_width else x)
            x_text = x + 15 if x - 15 <= 0 else (x - 15 if x + 15 >= self.pixel_width else x)
            self._canvas_ticks.create_text((x_text, 20), text=string, fill="black", font=("default", 10))
            self._canvas_ticks.create_line((x_tick, 5, x_tick, 15), fill="black")
        self._canvas_ticks.config(scrollregion="0 0 {0} {1}".format(self.pixel_width, 30))
def draw_ticks ( self ) : self . _canvas_ticks . create_line ( ( 0 , 10 , self . pixel_width , 10 ) , fill = "black" ) self . _ticks = list ( TimeLine . range ( self . _start , self . _finish , self . _tick_resolution / self . _zoom_factor ) ) for tick in self . _ticks : string = TimeLine . get_time_string ( tick , self . _unit ) x = self . get_time_position ( tick ) x_tick = x + 1 if x == 0 else ( x - 1 if x == self . pixel_width else x ) x_text = x + 15 if x - 15 <= 0 else ( x - 15 if x + 15 >= self . pixel_width else x ) self . _canvas_ticks . create_text ( ( x_text , 20 ) , text = string , fill = "black" , font = ( "default" , 10 ) ) self . _canvas_ticks . create_line ( ( x_tick , 5 , x_tick , 15 ) , fill = "black" ) self . _canvas_ticks . config ( scrollregion = "0 0 {0} {1}" . format ( self . pixel_width , 30 ) )
Draw the time tick markers on the TimeLine Canvas