Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/11/2011, 10:26
Avatar de razpeitia
razpeitia
Moderador
 
Fecha de Ingreso: marzo-2005
Ubicación: Monterrey, México
Mensajes: 7.321
Antigüedad: 19 años, 2 meses
Puntos: 1360
Respuesta: Problemas con codigo Python

Código Python:
Ver original
  1. import os
  2. import gtk
  3.  
  4. class MyApp1():
  5.  
  6.  
  7.     def ver3(self, widget, data=None):
  8.         buffer = gtk.TextBuffer()
  9.         buffer.set_text('\n'.join(self.text))
  10.         self.textView.set_buffer(buffer)
  11.    
  12.     def __init__(self):
  13.        
  14.         self.text = next(os.walk("."))[2]
  15.        
  16.         self.window = gtk.Window()
  17.         self.window.set_border_width(0)
  18.         self.window.set_title("CANAIMA SEMILLA")
  19.         self.window.set_size_request(520, 600)
  20.         #-------------------caja
  21.         self.vbox = gtk.VBox()
  22.         #------------------ boton
  23.         self.button = gtk.Button("llamando archivo")
  24.         self.button.connect("clicked", self.ver3, None)
  25.         #-----------------campo de texto------
  26.         self.textView = gtk.TextView()
  27.         #-----------------------------------
  28.         self.combo = gtk.Combo()
  29.         self.combo.set_popdown_strings(self.text)
  30.        
  31.         self.vbox.add(self.combo)
  32.         self.vbox.add(self.textView)
  33.         self.vbox.add(self.button)
  34.         self.window.add(self.vbox)
  35.        
  36.         self.window.connect("destroy", gtk.main_quit)
  37.         self.window.show_all()
  38.  
  39.  
  40. if __name__ == "__main__":
  41.     app = MyApp1()
  42.     gtk.main()
Tal vez deberías de empezar aprendiendo python. En vez de irte de lleno con aplicaciones de escritorio.