~fluidity-core/fluidity/DG_Neumann

« back to all changes in this revision

Viewing changes to libspud/diamond/diamond/databuttonswidget.py

  • Committer: Timothy Bond
  • Date: 2011-12-06 11:38:19 UTC
  • mfrom: (3871.1.4 fix-diamond-4.1.1)
  • Revision ID: timothy.bond@imperial.ac.uk-20111206113819-n6utj7qfkerze9ul
This merge supplies:

* An updated version of libspud
* An install target for diamond in the root fluidity makefile
* A target in the root fluidity makefile to install user schemata

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
#    This file is part of Diamond.
 
4
#
 
5
#    Diamond is free software: you can redistribute it and/or modify
 
6
#    it under the terms of the GNU General Public License as published by
 
7
#    the Free Software Foundation, either version 3 of the License, or
 
8
#    (at your option) any later version.
 
9
#
 
10
#    Diamond is distributed in the hope that it will be useful,
 
11
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
#    GNU General Public License for more details.
 
14
#
 
15
#    You should have received a copy of the GNU General Public License
 
16
#    along with Diamond.  If not, see <http://www.gnu.org/licenses/>.
 
17
 
 
18
import gobject
 
19
import gtk
 
20
 
 
21
class DataButtonsWidget(gtk.HBox):
 
22
 
 
23
  __gsignals__ = { "revert" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
 
24
                   "store"  : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ())}
 
25
 
 
26
  def __init__(self):
 
27
    gtk.HBox.__gobject_init__(self)
 
28
    revertButton = gtk.Button()
 
29
    revertButton.set_label("Revert data")
 
30
    revertButton.connect("clicked", self._revert)
 
31
 
 
32
    storeButton = gtk.Button()
 
33
    storeButton.set_label("Store data")
 
34
    storeButton.connect("clicked", self._store)
 
35
 
 
36
    self.pack_start(revertButton)
 
37
    self.pack_end(storeButton)
 
38
 
 
39
    return
 
40
 
 
41
  def _revert(self, widget = None):
 
42
    self.emit("revert")
 
43
 
 
44
  def _store(self, widget = None):
 
45
    self.emit("store")
 
46
 
 
47
gobject.type_register(DataButtonsWidget)