Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- # -*- coding: utf-8 -*-
- # Autor: Felix Molero
- # Nick: Virus69
- # Email: elhackerlibre@gmail.com
- # Proyecto: Navegador Web
- # Licencia GPL v2.0
- import gtk
- import webkit
- def go_but(widget):
- add = addressbar.get_text()
- if add.startswith("http://"):
- web.open(add)
- else:
- add = "http://" + add
- addressbar.set_text(add)
- web.open(add)
- def new_title(view, frame, title):
- win.set_title(title) # Cambia el titulo del borde
- def on_click_link(view, frame):
- uri=frame.get_uri()
- addressbar.set_text(uri)
- #def back_but(widget):
- #def next_but(widget):
- win = gtk.Window()
- win.set_default_size(1024, 768)
- win.connect('destroy', lambda w: gtk.main_quit())
- box1 = gtk.VBox()
- win.add(box1)
- box2 = gtk.HBox()
- box1.pack_start(box2, False)
- addressbar = gtk.Entry()
- addressbar.connect("activate", go_but)
- box2.pack_start(addressbar)
- backbutton = gtk.Button("<") # Boton para regresa a la página anterior
- box2.pack_start(backbutton, False)
- # backbutton.connect("clicked", back_but)
- nextbutton = gtk.Button(">") # Boton para ir a la suiguiente página
- box2.pack_start(nextbutton, False)
- # nextbutton.connect("clicked", next_but)
- gobutton = gtk.Button("GO") # Boton de buscar
- box2.pack_start(gobutton, False) # Reduce el tamaño del boton "GO"
- gobutton.connect("clicked", go_but)
- scroller = gtk.ScrolledWindow()
- box1.pack_start(scroller)
- web = webkit.WebView()
- web.open("http://www.google.com") # fijar la url del sitio de preferencia
- web.connect("title-changed", new_title)
- web.connect("load-committed", on_click_link)
- scroller.add(web)
- win.show_all()
- gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement