Skip to content
Browse files

Example 74: Add two kinds of properties to OrkivRoot.

These will facilitate calculations about whether to add a new chat window beside the buddy list or
or to replace it.
  • Loading branch information...
1 parent 2e8fa6b commit a22c40b6790f1e154fd28df00a2d4cfca3fd7c10 @buchuki committed Aug 13, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 orkiv/__main__.py
View
10 orkiv/__main__.py
@@ -156,6 +156,16 @@ def append_chat_message(self, sender, message, color):
class OrkivRoot(BoxLayout):
+ mode = StringProperty("narrow")
+
+ @property
+ def chat_visible(self):
+ return ChatWindow in {c.__class__ for c in self.children}
+
+ @property
+ def buddy_list_visible(self):
+ return self.buddy_list in self.children
+
def __init__(self):
super(OrkivRoot, self).__init__()
self.buddy_list = None

0 comments on commit a22c40b

Please sign in to comment.
Something went wrong with that request. Please try again.