Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <cassidy@cass-wks.(none)>2007-05-03 15:29:09 (GMT)
committer Guillaume Desmottes <cassidy@cass-wks.(none)>2007-05-03 15:29:09 (GMT)
commitf2364e949f5ca95b5a0d85c55b4df3f31f499d55 (patch)
treecd8a20c4f8322b485104f9e68b59d14f8e357ce0
parente18c4468e432f0b4af05c11ca125f60cd488327a (diff)
port to use new graphics API
-rw-r--r--chat.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/chat.py b/chat.py
index f103036..a2ccb0f 100644
--- a/chat.py
+++ b/chat.py
@@ -23,9 +23,7 @@ from sugar import profile
from sugar.activity.activity import Activity
from sugar.graphics import font
from sugar.graphics.canvasicon import CanvasIcon
-from sugar.graphics.entry import Entry
from sugar.graphics.roundbox import RoundBox
-from sugar.graphics.button import Button
from sugar.graphics.xocolor import XoColor
from sugar.graphics.units import points_to_pixels as px
from sugar.presence import presenceservice
@@ -54,9 +52,8 @@ class Chat(Activity):
self.set_title('Chat')
root = self.make_root()
- self._canvas.set_root(root)
- self._canvas.show()
- self._canvas.show_all()
+ self.set_canvas(root)
+ root.show_all()
self.owner_color = profile.get_color()
self.owner_nickname = profile.get_nick_name()
@@ -137,13 +134,13 @@ class Chat(Activity):
conversation = hippo.CanvasBox(spacing=px(4))
self.conversation = conversation
- entry = Entry(padding=5)
+ entry = gtk.Entry()
# XXX make this entry unsensitive while we're not
# connected.
- entry.connect('activated', self.entry_activated_cb)
+ entry.connect('activate', self.entry_activate_cb)
- hbox = hippo.CanvasBox(orientation=hippo.ORIENTATION_HORIZONTAL)
- hbox.append(entry, hippo.PACK_EXPAND)
+ hbox = gtk.HBox()
+ hbox.add(entry)
canvas = hippo.Canvas()
canvas.set_root(conversation)
@@ -155,9 +152,9 @@ class Chat(Activity):
widget = hippo.CanvasWidget(widget=sw)
- box = hippo.CanvasBox()
- box.append(widget, hippo.PACK_EXPAND)
- box.append(hbox)
+ box = gtk.VBox(homogeneous=False)
+ box.pack_start(sw)
+ box.pack_start(hbox, expand=False)
return box
@@ -204,7 +201,7 @@ class Chat(Activity):
#adj.set_value(rh)
adj.set_value(adj.upper - adj.page_size - 804)
- def entry_activated_cb(self, entry):
+ def entry_activate_cb(self, entry):
text = entry.props.text
print `text`