[Sugar-devel] gtk.linkbutton() on sugar

James Cameron quozl at laptop.org
Wed Mar 17 20:43:45 EDT 2010


On Wed, Mar 17, 2010 at 04:23:18PM -0300, Esteban Arias wrote:
> example, I run this code on sugar 0.82, on terminal, when i press the link,
> this link don't opened on activity browser...

Your code is incomplete because you have not created a callback for the
"clicked" signal.  As a result, nothing happens when you click.

I've looked at the Chat activity code that James Simmons refers to, but
I cannot see anything that uses LinkButton.  When you click on a URL in
Chat, a journal entry is created and the user is taken to the page for
that entry, where they can select the activity to start the URL with.
Does that make sense in the context of your activity?  If so, look at
the Chat code.

I've looked at the code for all activities in the current XO-1.5 build,
but only Browse and a 0install bug reporter use gtk.LinkButton.  The bug
reporter does an "import browse", and its browser.py runs firefox.
Avoid that method if you desire to run Browse.

The Wikipedia activity runs Browse for a given input action.  You could
use that method.  Look at the code.

The Help activity has a browser.py that reimplements a web browser with
few controls.  You could use that method.  Look at the code.

-- 
James Cameron
http://quozl.linux.org.au/


More information about the Sugar-devel mailing list