~ubuntu-branches/ubuntu/trusty/guiqwt/trusty

« back to all changes in this revision

Viewing changes to py2exe_example/simpledialog.pyw

  • Committer: Bazaar Package Importer
  • Author(s): Picca Frédéric-Emmanuel
  • Date: 2011-04-07 22:41:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110407224150-kkhppnq7rp2c8b3c
Tags: 2.1.0-1
* Imported Upstream version 2.1.0
* debian/patches/
  - 0001-features-01_bts614083.patch (delete)
  - 0001-feature-fix-the-documentation-build.patch (new)
* add and install the sift desktop file
* recommends python-dicom (Closes: #621421)
  thanks Junqian Gordon Xu for the report

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
#
 
3
# Copyright © 2009-2010 CEA
 
4
# Pierre Raybaut
 
5
# Licensed under the terms of the CECILL License
 
6
# (see guiqwt/__init__.py for details)
 
7
 
 
8
"""Very simple dialog box"""
 
9
 
 
10
from guiqwt.plot import ImageDialog
 
11
from guiqwt.builder import make
 
12
 
 
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)
 
19
        plot.replot()
 
20
 
 
21
if __name__ == "__main__":
 
22
    import numpy as np
 
23
    from guidata import qapplication
 
24
    _app = 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