2
# @file geisview/gesture_classview.py
3
# @brief GestureClass viewer for geisview.
5
# Copyright (C) 2011 Canonical Ltd
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
25
class GestureClassView(gtk.Window):
27
def __init__(self, gesture_classes):
28
gtk.Window.__init__(self)
29
self.set_title("GEIS GestureClasss")
30
self.set_size_request(200, 200)
32
self._tree_store = gtk.TreeStore(str, str)
33
for (class_id, gclass) in gesture_classes.iteritems():
34
it = self._tree_store.append(None, ["%s" % gclass.id(),
35
"%s" % gclass.name()])
36
self._tree_view = gtk.TreeView(self._tree_store)
37
# self._tree_view.set_mode(gtk.SELECTION_SINGLE)
39
cell = gtk.CellRendererText()
40
col = gtk.TreeViewColumn('ID')
41
col.pack_start(cell, True)
42
col.add_attribute(cell, 'text', 0)
43
self._tree_view.append_column(col)
45
cell = gtk.CellRendererText()
46
col = gtk.TreeViewColumn('Name')
47
col.pack_start(cell, True)
48
col.add_attribute(cell, 'text', 1)
49
self._tree_view.append_column(col)
51
self.add(self._tree_view)