[Sugar-devel] query

Benjamin M. Schwartz bmschwar at fas.harvard.edu
Thu Sep 3 13:18:07 EDT 2009


deepanshu arora wrote:
> yes Benjamin..u are right.
> I am trying to make an interface that would allow users to edit programmable
> tools while inside paint.

OK.  I think that's a great idea, and it should not be too hard to
implement.  You will need to provide a GUI for editing, but this is easy
with gtksourceview.

You also need a way to save and load the user's code.  If you are
targeting Sugar 0.84+, then the easiest way to do this is to add the
programmable tools to the datastore object's metadata as a string.  See,
for example,

http://wiki.laptop.org/go/Sugar.activity.activity#How_do_I_implement_a_write_file_method_for_my_activity_in_order_to_persist_my_activity_in_the_journal.3F

This method is very easy to use (probably one or two lines of code) and
has the advantages that (1) it only creates a single Journal entry, and
(2) the Journal entry it creates is still a standard PNG file, so it
retains excellent compatibility.  However, this method will only work
reliably on Sugar 0.84 and newer.

--Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20090903/16724103/attachment.pgp 


More information about the Sugar-devel mailing list