diff options
author | Patricia Espinola <pathy15_91@hotmail.com> | 2013-01-23 04:20:35 (GMT) |
---|---|---|
committer | Patricia Espinola <pathy15_91@hotmail.com> | 2013-01-23 04:20:35 (GMT) |
commit | 3fa5c93264f82328d09b7fdbf7c38a7095928894 (patch) | |
tree | 21a2f25060c8eb7c39c5c68f6b57d1b12bbb98a8 | |
parent | 7b5f2bdbe1066ac9cfbae3e9ddb2a20b020858b5 (diff) |
Cambios en la interfaz
-rw-r--r-- | activity/activity.info | 2 | ||||
-rw-r--r-- | config.ini | 10 | ||||
-rw-r--r-- | imagen.py | 91 |
3 files changed, 54 insertions, 49 deletions
diff --git a/activity/activity.info b/activity/activity.info index ebc6b83..abddd3f 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -3,5 +3,5 @@ name = Piensa y Escribe activity_version = 3 bundle_id = org.sugarlabs.PiensaEscribe exec = sugar-activity activity.PiensaEscribeActivity -icon = activity-helloworld +icon = icono license = GPLv2+ @@ -1,11 +1,11 @@ [Pregunta1] = imagen1.jpg Respuesta1 = 'gordo y flaco' -[Pregunta2] = imagen1.jpg +[Pregunta2] = imagen2.jpg Respuesta2 = 'alto y bajo' -[Pregunta3] = imagen1.jpg -Respuesta3 = 'encima y debajo' +[Pregunta3] = imagen3.jpg +Respuesta3 = 'grande y pequeño' -[Pregunta4] = imagen1.jpg -Respuesta4 = 'oscuro y claro' +[Pregunta4] = imagen4.jpg +Respuesta4 = 'encendido y apagado' @@ -1,67 +1,72 @@ #!/usr/bin/python +# -*- encoding: utf-8 -*- import gtk import programa import voice -#global columna -#columna = 0 class MyApp(): def __init__(self): - label1 = ['Claro - Oscuro', 'Joven - Anciano', 'Gordo y Flaco'] - label2 = ['Nene - Nena', 'Mucho - Poco', 'Fuego - Agua'] - myListLabel = [label1, label2] - myImagenes = ['gordo.jpg', 'flaco.jpg'] - myListImagenes = [myImagenes] - correct_option = [3, 2] - fila_label = 0 - #fila_option = 0 - #cantidad_imagenes = 2 - image_number = 0 - + label_opciones = ["Claro - Oscuro", "Joven - Anciano", "Gordo - Flaco", "Alto - Bajo", "Pequeño - Grande", "Feliz - Triste"] + #label2 = ['Nene - Nena', 'Mucho - Poco', 'Fuego - Agua'] + listImagenes = ['gordo.jpg', 'flaco.jpg','alto.jpg', 'bajo.jpg'] + #myListImagenes = [myImagenes] + correct_option = [label_opciones[2],label_opciones[1]] + window = gtk.Window() vbox = gtk.VBox() hbox = gtk.HBox() - imagen1 = gtk.Image() - imagen1.set_from_file(myListImagenes[image_number][0]) - imagen2 = gtk.Image() - imagen2.set_from_file(myListImagenes[image_number][1]) - - window.connect('destroy', self.destroy) - button1 = gtk.Button() - button1.set_label(myListLabel[fila_label][0]) - button2 = gtk.Button() - button2.set_label(myListLabel[fila_label][1]) - button3 = gtk.Button() - button3.set_label(myListLabel[fila_label][2]) - - button1.connect('enter', self.__sobre_boton_cb) - button2.connect('enter', self.__sobre_boton_cb) - button3.connect('enter', self.__sobre_boton_cb) - button1.connect('clicked', self.__correcto_cb, correct_option[0], 1) - button2.connect('clicked', self.__correcto_cb, correct_option[0], 2) - button3.connect('clicked', self.__correcto_cb, correct_option[0], 3) - + window.connect('destroy', self.destroy) window.add(vbox) window.set_title('Piensa y Escribe') window.set_default_size(100,100) window.set_position(gtk.WIN_POS_CENTER) - hbox.add(imagen1) - hbox.add(imagen2) vbox.add(hbox) - vbox.add(button1) - vbox.add(button2) - vbox.add(button3) - window.show_all() + indice_opciones = 0 + indice_imagen = 0 + indice_resp_correcta = 0 + + while indice_imagen < 4: + imagen1 = gtk.Image() + imagen1.set_from_file(listImagenes[indice_imagen]) + indice_imagen+= 1 + imagen2 = gtk.Image() + imagen2.set_from_file(listImagenes[indice_imagen]) + indice_imagen+= 1 + button1 = gtk.Button() + button1.set_label(label_opciones[indice_opciones]) + indice_opciones+= 1 + button2 = gtk.Button() + button2.set_label(label_opciones[indice_opciones]) + indice_opciones+= 1 + button3 = gtk.Button() + button3.set_label(label_opciones[indice_opciones]) + indice_opciones+= 1 + button1.connect('enter', self.__sobre_boton_cb) + button2.connect('enter', self.__sobre_boton_cb) + button3.connect('enter', self.__sobre_boton_cb) + button1.connect('clicked', self.__correcto_cb) + button2.connect('clicked', self.__correcto_cb) + button3.connect('clicked', self.__correcto_cb) + indice_resp_correcta +=1 + hbox.add(imagen1) + hbox.add(imagen2) + vbox.add(button1) + vbox.add(button2) + vbox.add(button3) + window.show_all() + + + - def __correcto_cb(self, button, correct_option, clave): - if correct_option == clave: - voice.say('opcion - correcta') + def __correcto_cb(self, button): + if button.get_label() == correct_opcion[2]: + voice.say('Opcion correcta') else: - voice.say('opcion - incorrecta') + voice.say('Opcion incorrecta - Intente de nuevo') def destroy(self, window, data=None): gtk.main_quit() |