1
# -*- coding: utf-8 -*-
3
# Copyright © 2009-2010 CEA
5
# Licensed under the terms of the CECILL License
6
# (see guiqwt/__init__.py for details)
8
"""Very simple dialog box"""
10
from guiqwt.plot import ImageDialog
11
from guiqwt.builder import make
13
class VerySimpleDialog(ImageDialog):
14
def set_data(self, data):
15
plot = self.get_plot()
16
item = make.trimage(data)
17
plot.add_item(item, z=0)
18
plot.set_active_item(item)
21
if __name__ == "__main__":
23
from guidata import qapplication
25
dlg = VerySimpleDialog()
26
dlg.set_data(np.random.rand(100, 100))
27
dlg.exec_() # No need to call app.exec_: a dialog box has its own event loop