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
|
# -*- coding: utf-8 -*-
import gtk
from sugar.activity import activity
class Toolbar():
def __init__(self,view):
self.toolbox=activity.ActivityToolbox(view.controller.activity)
self.toolbox.show()
view.controller.activity.set_toolbox(self.toolbox)
#El Layout inicial
#encabezado = gtk.Label(' El encabezado, categoria y dificultad')
#encabezado.show()
#Preparando el menu
self.menu = gtk.HBox()
self.alineacion = gtk.Alignment(0.5, 1, 0.5, 1)
self.categoriaL = gtk.Label("Categoria:")
self.categoriaL.show()
self.categorias = gtk.combo_box_new_text()
self.categorias.insert_text(0,"Todas")
self.categorias.insert_text(1,"Matematica")
self.categorias.insert_text(2,"Historia")
self.categorias.insert_text(3,"Castellano")
self.categorias.set_active(0)
self.categorias.show()
self.dificultadL = gtk.Label("Dificultad:")
self.dificultadL.show()
self.dificultades = gtk.combo_box_new_text()
self.dificultades.insert_text(0,"1")
self.dificultades.insert_text(1,"2")
self.dificultades.insert_text(2,"3")
self.dificultades.set_active(0)
self.dificultades.show()
self.iniciarB = gtk.Button("Inicio")
self.iniciarB.connect("clicked", view.controller.newGame)
self.iniciarB.show()
self.finalizarB = gtk.Button("Terminar")
self.finalizarB.connect("clicked", view.controller.end)
self.finalizarB.show()
self.menu.pack_start(self.alineacion)
self.menu.pack_start(self.categoriaL)
self.menu.pack_start(self.categorias)
self.menu.pack_start(self.dificultadL)
self.menu.pack_start(self.dificultades)
self.menu.pack_start(self.iniciarB)
self.menu.pack_start(self.finalizarB)
self.menu.show()
|