Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflavio <fdanesse@gmail.com>2012-05-24 23:23:48 (GMT)
committer flavio <fdanesse@gmail.com>2012-05-24 23:23:48 (GMT)
commit521786d250eaf4862319186a8815f36788d3a0d0 (patch)
tree675e098489f2cb132e20612d5fdbc0b00ba24df1
parent02511ae82da5ccc39ec22f12881402268166059a (diff)
Portado
-rw-r--r--Widgets.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/Widgets.py b/Widgets.py
index 5fddd75..3723a92 100644
--- a/Widgets.py
+++ b/Widgets.py
@@ -39,11 +39,7 @@ class Button(Gtk.EventBox):
if event.button == 1:
self.modify_bg(0, self.clickedcolor)
self.emit("clicked", event)
-
- def set_tooltip(self, texto):
- tooltips = Gtk.Tooltips()
- tooltips.set_tip(self, texto, tip_private=None)
-
+
def set_tamanio(self, w, h):
if self.tamanio != (w,h):
self.tamanio = (w,h)
@@ -57,7 +53,7 @@ class ButtonElemento(Button):
texto = ""
for key in self.elementoquimico.keys():
texto += "%s = %s%s" % (key, self.elementoquimico[key], "\n")
- self.set_tooltip(texto)
+ self.set_tooltip_text(texto)
self.show_all()
'''
@@ -89,7 +85,7 @@ class TablaPeriodica(Gtk.EventBox):
self.modify_bg(0, G.FONDO3)
self.tabla = None
self.filasdeelementos = None
- #self.set_layout()
+ self.set_layout()
self.show_all()
def set_layout(self):
@@ -102,11 +98,13 @@ class TablaPeriodica(Gtk.EventBox):
button.clickedcolor = G.BLANCO
button.modify_bg(0, button.normalcolor)
button.add(Gtk.Label(x))
+ self.tabla.attach(button, x, x+1, 0, 1)
+ '''
self.tabla.attach(button, x, x+1, 0, 1,
xoptions=Gtk.EXPAND|Gtk.FILL,
yoptions=Gtk.EXPAND|Gtk.FILL,
- xpadding=0, ypadding=0)
-
+ xpadding=0, ypadding=0)'''
+
for x in range(1,10):
button = Button()
button.normalcolor = G.BLANCO
@@ -114,10 +112,12 @@ class TablaPeriodica(Gtk.EventBox):
button.clickedcolor = G.BLANCO
button.modify_bg(0, button.normalcolor)
button.add(Gtk.Label(x))
+ self.tabla.attach(button, 0, 1, x, x+1)
+ '''
self.tabla.attach(button, 0, 1, x, x+1,
xoptions=Gtk.EXPAND|Gtk.FILL,
yoptions=Gtk.EXPAND|Gtk.FILL,
- xpadding=0, ypadding=0)
+ xpadding=0, ypadding=0)'''
self.add(self.tabla)
estructura = G.INDICEELEMENTOS
@@ -142,10 +142,12 @@ class TablaPeriodica(Gtk.EventBox):
for boton in line:
col = line.index(boton)+1
if boton != None:
+ self.tabla.attach(boton, col, col+1, row, row+1)
+ '''
self.tabla.attach(boton, col, col+1, row, row+1,
xoptions=Gtk.EXPAND|Gtk.FILL,
yoptions=Gtk.EXPAND|Gtk.FILL,
- xpadding=0, ypadding=0)
+ xpadding=0, ypadding=0)'''
def set_colores(self, boton):
for elemen in G.COLORS: