Advertisement
Guest User

Quickly - Python code

a guest
Feb 26th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
  2. ### BEGIN LICENSE
  3. # This file is in the public domain
  4. ### END LICENSE
  5.  
  6. from locale import gettext as _
  7.  
  8. from gi.repository import Gtk # pylint: disable=E0611
  9. import logging
  10. logger = logging.getLogger('dogbrowser')
  11.  
  12. from dogbrowser_lib import Window
  13. from dogbrowser.AboutDogbrowserDialog import AboutDogbrowserDialog
  14. from dogbrowser.PreferencesDogbrowserDialog import PreferencesDogbrowserDialog
  15.  
  16. import webkit
  17.  
  18. # See dogbrowser_lib.Window.py for more details about how this class works
  19. class DogbrowserWindow(Window):
  20. __gtype_name__ = "DogbrowserWindow"
  21.  
  22. def finish_initializing(self, builder): # pylint: disable=E1002
  23. """Set up the main window"""
  24. super(DogbrowserWindow, self).finish_initializing(builder)
  25.  
  26. self.AboutDialog = AboutDogbrowserDialog
  27. self.PreferencesDialog = PreferencesDogbrowserDialog
  28.  
  29. # Code for other initialization actions should be added here
  30.  
  31. self.refreshbutton = self.builder.get_object("refreshbutton")
  32. self.urlentry = self.builder.get_object("urlentry")
  33. self.webbrowser = self.builder.get_object("webBrowser")
  34.  
  35. self.webview = webkit.WebView()
  36.  
  37. self.webbrowser.add(self.webview)
  38.  
  39. def on_refreshbutton_clicked(self, widget):
  40. print("refresh")
  41.  
  42. def on_urlentry_activate(self, widget):
  43. url = widget.get_text()
  44.  
  45. print(url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement