class MainWindow(ApplicationWindow): """ The main application window. """ data = Array data_view = Instance(IDataViewWidget) def _create_contents(self, parent): """ Creates the left hand side or top depending on the style. """ self.data_view = DataViewWidget( parent=parent, data_model=ArrayDataModel( data=self.data, value_type=FloatValue(), ), ) self.data_view._create() return self.data_view.control def _data_default(self): import numpy return numpy.random.uniform(size=(10000, 10, 10))*1000000 def destroy(self): self.data_view.destroy() super().destroy()
class MainWindow(ApplicationWindow): """ The main application window. """ data_view = Instance(IDataViewWidget) def _create_contents(self, parent): """ Creates the left hand side or top depending on the style. """ self.data_view = DataViewWidget( parent=parent, data_model=DictDataModel( data={ 'one': 1, 'two': 2, 'three': 3 }, value_type=IntValue(), ), ) self.data_view._create() return self.data_view.control def destroy(self): self.data_view.destroy() super().destroy()
class MainWindow(ApplicationWindow): """ The main application window. """ data = List(Instance(Person)) row_info = Instance(AbstractRowInfo) data_view = Instance(IDataViewWidget) def _create_contents(self, parent): """ Creates the left hand side or top depending on the style. """ self.data_view = DataViewWidget( parent=parent, data_model=ColumnDataModel( data=self.data, row_info=self.row_info, ), ) self.data_view._create() return self.data_view.control def _data_default(self): import numpy return numpy.random.uniform(size=(100000, 10)) def destroy(self): self.data_view.destroy() super().destroy()
class MainWindow(ApplicationWindow): """ The main application window. """ data_view = Instance(IDataViewWidget) def _create_contents(self, parent): """ Creates the left hand side or top depending on the style. """ self.data_view = DataViewWidget( parent=parent, data_model=IndexDataModel(), ) self.data_view._create() return self.data_view.control def destroy(self): self.data_view.destroy() super().destroy()