#!/usr/bin/python # -*- coding: utf-8 -*- ''' Clase de la Tarjeta''' #Copyright (C) 2009 Federico Moreira - # Alejandro Esperón - # # 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 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)