diff options
author | Yader Velásquez <yajosev@gmail.com> | 2010-08-29 02:27:06 (GMT) |
---|---|---|
committer | Yader Velásquez <yajosev@gmail.com> | 2010-08-29 02:27:06 (GMT) |
commit | 8e2b57cbb62f98921da0369a8811102efdce9bb4 (patch) | |
tree | 0bfb1301eb5e14fdaf7913c983ce1d80e2dc4bb0 | |
parent | b4607aaa9e7f452f54adad6ae6525819a12ee191 (diff) |
ya funciona la vista de actividades con textview
-rw-r--r-- | .archivo.py.swp | bin | 12288 -> 12288 bytes | |||
-rw-r--r-- | .calendario.py.swp | bin | 20480 -> 20480 bytes | |||
-rw-r--r-- | archivo.py | 13 | ||||
-rw-r--r-- | calendario.py | 22 | ||||
-rw-r--r-- | fecha.py | 12 |
5 files changed, 30 insertions, 17 deletions
diff --git a/.archivo.py.swp b/.archivo.py.swp Binary files differindex 299a3e0..cf1fd92 100644 --- a/.archivo.py.swp +++ b/.archivo.py.swp diff --git a/.calendario.py.swp b/.calendario.py.swp Binary files differindex 8b5a7fb..bb281f9 100644 --- a/.calendario.py.swp +++ b/.calendario.py.swp @@ -15,10 +15,19 @@ # #You should have received a copy of the GNU General Public License #along with this program. If not, see <http://www.gnu.org/licenses/>. -# -#Utils for make a date dictionary and save it in a file +import gtk import pickle +import gobject + +def crear_modelo(): + '''create a define liststore model''' + modelo = gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING) + contador = modelo.append() + modelo.set(contador, 1, 'Hola Mundo') + contador = modelo.append() + modelo.set(contador, 1, 'Hi') + return modelo def guardar_dato(indice, contenido, archivo): '''get a id dependig of the unix time, and the content''' diff --git a/calendario.py b/calendario.py index 5ca5fa5..f81e522 100644 --- a/calendario.py +++ b/calendario.py @@ -18,8 +18,8 @@ from gettext import gettext as _ from fecha import FechaUnix, FechaNormal +from archivo import crear_modelo import gtk -import gobject import pickle class Calendario: @@ -31,6 +31,8 @@ class Calendario: self.ventana.set_title(_('Calendario')) self.ventana.connect('destroy', self._cerrar_cb) self.fecha_normal = FechaNormal() + self.temporal = [1,'holamundo'] + ######################### set interface ######################## #calendar @@ -42,9 +44,10 @@ class Calendario: self.area_texto = gtk.ScrolledWindow() self.area_texto.set_shadow_type(gtk.SHADOW_IN) self.area_texto.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) - self.modelo = gtk.ListStore(gobject.TYPE_STRING); - self.actividades = gtk.TreeView() + self.modelo = crear_modelo() + self.actividades = gtk.TreeView(self.modelo) self.area_texto.add(self.actividades) + self._crear_columna() #ephemeris @@ -134,7 +137,18 @@ class Calendario: #def _limpiar_boton_cb(self, widget, data=None): # '''clean input area''' - + + def _crear_columna(self): + '''create the columns for the treeview''' + self.celda = gtk.CellRendererText() + self.numero = (_('Numero de actividad')) + self.actividad = (_('Actividades para hoy')) + + self.columna = gtk.TreeViewColumn(self.numero, self.celda, text = 0) + self.actividades.append_column(self.columna) + + self.columna = gtk.TreeViewColumn(self.actividad, self.celda, text = 1) + self.actividades.append_column(self.columna) if __name__ == "__main__": foo = Calendario() @@ -19,16 +19,6 @@ from time import localtime, strftime, mktime from datetime import datetime -#def fecha_actual(): -# '''return a friendly date''' #esta fecha es la que se muestra arriba del calendario -# fecha = datetime.today() -# return fecha.strftime("%d de %B de %Y") - -#def fecha_cadena(): -# '''return a string of the date''' #este es el formato de fecha para los indices de efemerides -# fecha = datetime.today() -# return fecha.strftime("%y-%b-%d") - class FechaUnix(object): '''for get, convert and return dates based on the unix date''' @@ -56,7 +46,7 @@ class FechaNormal(object): def fecha_actual(self): '''return the actual date''' self.fecha = datetime.today() - return self.fecha.strftime("%y-%b-%d") + return self.fecha.strftime("%d de %B de %Y") def fecha_especial(self): '''special format of a date for |