def __init__(self, body): """ body -- a ListWalker-like object that contains widgets to be displayed inside the list box """ if hasattr(body,'get_focus'): self.body = body else: self.body = PollingListWalker(body) try: connect_signal(self.body, "modified", self._invalidate) except NameError: # our list walker has no modified signal so we must not # cache our canvases because we don't know when our # content has changed self.render = nocache_widget_render_instance(self) # offset_rows is the number of rows between the top of the view # and the top of the focused item self.offset_rows = 0 # inset_fraction is used when the focused widget is off the # top of the view. it is the fraction of the widget cut off # at the top. (numerator, denominator) self.inset_fraction = (0,1) # pref_col is the preferred column for the cursor when moving # between widgets that use the cursor (edit boxes etc.) self.pref_col = 'left' # variable for delayed focus change used by set_focus self.set_focus_pending = 'first selectable' # variable for delayed valign change used by set_focus_valign self.set_focus_valign_pending = None
def nocache_bargraph_get_data(self, get_data_fn): """ Disable caching on this bargraph because get_data_fn needs to be polled to get the latest data. """ self.render = nocache_widget_render_instance(self) self._get_data = get_data_fn