Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2009-09-22 20:17:18 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-09-22 20:17:18 (GMT)
commit7771593d2c7175c6512cf0b622dc42af1e975883 (patch)
treeb864fdaf72e78c25068c8d9f12b7090077be381d /tawindow.py
parent49fae193659f81ba32dc69385c68fb07519c9429 (diff)
hasattr(tw,"activity")
Diffstat (limited to 'tawindow.py')
-rw-r--r--tawindow.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/tawindow.py b/tawindow.py
index 731d8e2..bb6567e 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -589,7 +589,7 @@ def keypress_cb(area, event, tw):
else:
alt_mask = False
results = key_press(tw, alt_mask, keyname, keyunicode)
- if keyname is not None and \
+ if keyname is not None and hasattr(tw,"activity") and \
hasattr(tw.activity, 'chattube') and tw.activity.chattube is not None:
# print "key press"
if alt_mask:
@@ -782,19 +782,19 @@ def xy(event):
return map(int, event.get_coords())
def showPopup(block_name,tw):
- try:
- label = _(block_name) + ": " + hover_dict[block_name]
- except:
- label = _(block_name)
- try:
- # Use new toolbar
- tw.activity.hover_help_label.set_text(label)
- tw.activity.hover_help_label.show()
- except:
- # Use old toolbar
- tw.activity.helpToolbar.hover_help_label.set_text(label)
- tw.activity.helpToolbar.hover_help_label.show()
-
+ if hasattr(tw,"activity"):
+ try:
+ label = _(block_name) + ": " + hover_dict[block_name]
+ except:
+ label = _(block_name)
+ try:
+ # Use new toolbar
+ tw.activity.hover_help_label.set_text(label)
+ tw.activity.hover_help_label.show()
+ except:
+ # Use old toolbar
+ tw.activity.helpToolbar.hover_help_label.set_text(label)
+ tw.activity.helpToolbar.hover_help_label.show()
"""
i = popupHandler.getInvoker(block_name)
if i: