Listo!
Código Python:
Ver originalimport sys
import pygtk
pygtk.require('2.0')
import gtk
class simpleWindow:
def __init__(self):
self.wind = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.wind.set_border_width(2)
self.wind.set_size_request(400, 300)
self.wind.connect('delete_event', self.__on_quit)
vbox = gtk.VBox()
self.entry = gtk.Entry()
self.entry.set_text("Ejemplo")
self.bandera = True
self.entry.connect('event', self.__on_entry_clicked)
vbox.pack_start(self.entry)
self.wind.add(vbox)
self.wind.show_all()
gtk.main()
def __on_entry_clicked(self, widget, event, data=None):
if (self.bandera):
if event.type == gtk.gdk.BUTTON_RELEASE:
self.entry.set_text("")
self.bandera = False
def __on_quit(self, widget, event=None):
gtk.main_quit()
return False
def main():
wind = simpleWindow()
if __name__ == '__main__':
main()