[sugar] A place to point new developers

Dafydd Harries dafydd.harries
Mon Apr 9 11:14:51 EDT 2007


I've written a new chat activity based on Telepathy. I've made it as simple as
possible: when you launch it, it joins the Jabber multi-user chat
chat at conference.olpc.collabora.co.uk.

Right now, it's hard-coded to use Gabble (the XMPP backed for Telepathy), but
it should be pretty easy to make it use Salut (for local network Jabber). If
you want to run this, you'll need to have the telepathy-gabble binary and its
.service file installed.

Git repository is here:

http://projects.collabora.co.uk/~daf/chat-activity.git/

(This is my first time with git, so I'm not sure if I got that right.)

There's one really annoying bug I couldn't work out: the conversation is
inside a Gtk scroll area, using a hack I lifted from the journal code. The UI
structure looks like this:

 - hippo.Canvas
   - hippo.CanvasWidget
     - gtk.ScrolledWindow
       - gtk.Viewport
         - hippo.Canvas (*)
           - hippo.CanvasBox
             - (conversation items)
   - sugar.graphics.entry.Entry

It seems that the inner hippo.Canvas gets allocated more space than it wants,
which messes up the vertical adjustment of the ScrolledWindow. It turns out
that the allocation is always 804 pixels larger than the request, which I'm
guess is 844 (screen height) - 40 pixels for the Entry. This is annoying
because I want to scroll the conversation down when somebody says something,
but it ends up showing a mass of empty space if I scroll to what should be the
bottom. Hence this gross hack which makes it kinda work:

        adj.set_value(adj.upper - adj.page_size - 804)

If somebody can shed some light on this, I'd be very happy.

-- 
Dafydd



More information about the Sugar-devel mailing list