#!/usr/bin/python # -*- coding: UTF-8 -*- '''Prestame Tu Voz''' #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 #import Image import settings def pintar_filas(button_list, num_fila): ''' Pinta las filas de color rojo ''' color_rojo = gtk.gdk.color_parse('#ff0000') color_blanco = gtk.gdk.color_parse('#ffffff') for count in range(settings.TABLA_ALTO * settings.TABLA_ANCHO): if (count >= num_fila and count<(num_fila+settings.TABLA_ANCHO)): button_list[count].modify_bg(gtk.STATE_NORMAL, color_rojo) else: button_list[count].modify_bg(gtk.STATE_NORMAL, color_blanco) num_fila += settings.TABLA_ANCHO if num_fila >= (settings.TABLA_ANCHO * settings.TABLA_ALTO): num_fila = 0 button_list[num_fila].grab_focus() return num_fila def pintar_columnas(button_list, num_fila, num_columna): ''' Pinta las columnas de violeta ''' colorblanco = gtk.gdk.color_parse('#ffffff') colorrojo = gtk.gdk.color_parse('#ff0000') button_list[num_columna].modify_bg(gtk.STATE_NORMAL, colorblanco) num_columna = num_columna + 1 #print num_fila if num_columna > (num_fila + (settings.TABLA_ANCHO-1)): num_columna = num_fila for i in range(num_fila, num_fila + (settings.TABLA_ANCHO)): if i == num_columna: button_list[i].modify_bg(gtk.STATE_NORMAL, colorrojo) button_list[i].grab_focus() else: button_list[i].modify_bg(gtk.STATE_NORMAL, colorblanco) return num_columna #def redim_imagen(img, alto, ancho): ''' Redimensiona las imágenes ''' # imagen = Image.open(os.path.join(os.getcwd(), 'imagenes', img)) # imagen.thumbnail((alto, ancho), Image.ANTIALIAS) # imagen.save(os.path.join(os.getcwd(), img + '0.png'))