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
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
''' Clase de la Tarjeta'''
#Copyright (C) 2009 Federico Moreira - <federico@piensalibre.info>
# Alejandro Esperón - <ratman26@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, see <http://www.gnu.org/licenses/>
import gtk
import os
class Tarjeta(gtk.Button):
'''
Clase Tarjeta:
--------------
titulo --> Nombre de la tarjeta, aparece arriba de la imagen
imagen --> Imagen que se le agrega al botón al cargar el archivo
audio --> Audio que se reproduce al hacer click en la imagen
hijo --> En caso de que la accion sea la de cargar una nueva
plantilla aqui iria el nombre de la plantilla o la
posicion de la que se encuentra si tarian cargadas
en listas desde inicio.
'' = Uso normal, reproduccion de sonido
n = numero de plantilla (o nombre)
padre --> Desde donde viene, ya que seria necesario para retornar
a la plantilla anterior, dependeria si hijo tuviera algo
'''
def __init__(self, titulo='', imagen='', audio='', hijo='', padre=''):
super(Tarjeta, self).__init__()
self.titulo = titulo
self.audio = audio
self.imagen = imagen
self.hijo = hijo
self.padre = padre
def refresh_image(self):
imagen = gtk.Image()
imagen.set_from_file(os.path.join(os.getcwd(), self.imagen))
self.set_image(imagen)
|