def __init__(self, logger=None, rgbmap=None, settings=None): ImageViewCairo.ImageViewCairo.__init__(self, logger=logger, rgbmap=rgbmap, settings=settings) imgwin = gtk.DrawingArea() imgwin.connect("expose_event", self.expose_event) imgwin.connect("configure-event", self.configure_event) imgwin.connect("size-request", self.size_request) imgwin.set_events(gtk.gdk.EXPOSURE_MASK) # prevents some flickering imgwin.set_double_buffered(True) imgwin.set_app_paintable(True) # prevents extra redraws, because we manually redraw on a size # change imgwin.set_redraw_on_allocate(False) self.imgwin = imgwin self.imgwin.show_all() # see reschedule_redraw() method self._defer_task = GtkHelp.Timer() self._defer_task.add_callback('expired', lambda timer: self.delayed_redraw()) self.msgtask = GtkHelp.Timer() self.msgtask.add_callback('expired', lambda timer: self.onscreen_message(None))
def make_timer(self): return GtkHelp.Timer()