Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-05-22 11:59:37 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-05-22 11:59:37 (GMT)
commite66eb0affccb71012619b7cdef3f502e32156f78 (patch)
treee004f4b0db72363503605e14fdb441fb85c6d73b /python
parent2c92da58d54b62149d5e286f6d44d334cb415b5f (diff)
Add a title property
Diffstat (limited to 'python')
-rw-r--r--python/webview.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/python/webview.py b/python/webview.py
index 9c077a9..443131a 100644
--- a/python/webview.py
+++ b/python/webview.py
@@ -15,6 +15,8 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
+import gobject
+
from hulahop import _hulahop
import xpcom
@@ -25,6 +27,10 @@ class _Chrome:
_com_interfaces_ = interfaces.nsIWebBrowserChrome, \
interfaces.nsIEmbeddingSiteWindow
+ def __init__(self, web_view):
+ self.web_view = web_view
+ self.title = ''
+
# nsIWebBrowserChrome
def destroyBrowserWindow(self):
pass
@@ -55,10 +61,11 @@ class _Chrome:
pass
def get_title(self):
- return ''
+ return self.title
def set_title(self, title):
- print title
+ self.title = title
+ self.web_view._notify_title_changed()
def get_visibility(self):
return True
@@ -67,16 +74,27 @@ class _Chrome:
pass
class WebView(_hulahop.WebView):
+ __gproperties__ = {
+ 'title' : (str, None, None, None,
+ gobject.PARAM_READABLE)
+ }
def __init__(self):
_hulahop.WebView.__init__(self)
self._chrome = xpcom.server.WrapObject(
- _Chrome(), interfaces.nsIEmbeddingSiteWindow)
+ _Chrome(self), interfaces.nsIEmbeddingSiteWindow)
weak_ref = xpcom.client.WeakReference(self._chrome)
self.browser.containerWindow = self._chrome
self.create_window()
+ def _notify_title_changed(self):
+ self.notify('title')
+
+ def do_get_property(self, pspec):
+ if pspec.name == 'title':
+ return self._chrome.title
+
def get_window_root(self):
return _hulahop.WebView.get_window_root(self)