blob: aa0e19f3a8ce05f2b5881eb1dc84083494b68782 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# Copyright (C) 2013 Cristhofer Travieso <cristhofert97@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St,
from gi.repository import Gtk
from gi.repository import Gdk
class Canvas(Gtk.HBox):
def __init__(self):
Gtk.HBox.__init__(self)
self.presentation = []#save the presentation
#panel
scroll = Gtk.ScrolledWindow()
self.pack_start(scroll, True, True, 0)
liststore = Gtk.ListStore(str)
for num in range(0, len(self.presentation)):
liststore.append([num])
# el contenedor de las filas
treeview = Gtk.TreeView()
# moldear el contenedor
treeview.set_model(liststore)
# Crear la columna para la lista
treeview.append_column(Gtk.TreeViewColumn('Slide', Gtk.CellRendererText(), text=0))
scroll.add(treeview)
self.show_all()
if __name__ == "__main__":
window = Gtk.Window()
window.connect('destroy', lambda w: Gtk.main_quit())
c = Canvas()
window.add(c)
window.set_title('Presentation')
window.maximize()
window.show()
Gtk.main()
|