[Sugar-devel] The best place to learn interaction with the olpc journal ?

Walter Bender walter.bender at gmail.com
Tue Jun 21 15:22:13 EDT 2011

On Tue, Jun 21, 2011 at 3:10 PM, laurent bernabe
<laurent.bernabe at gmail.com> wrote:
> Hello,
> I apologize, I explained what I wanted to say in a bad way
> the etext example given in the tutorial does not show a write_file example.
> I tried to implement write_file in my application by giving a look at Turtle
> art example, adapting it for a custom MIME type. I believe it is quite
> simple to do this, but unfortunately, i must have done a mistake in my
> application :
> when I give a look at the journal, the screen capture of my save is ok. But
> when I try to open it with my application, the picture as been erased and I
> have lost all my data (Instead of really opening my save, it starts from
> sratch and erase old saves). So I think I misunderstood the developpment of
> interaction with the journal. My MIME type is *.gph and stands for
> application/x-graph

I am not sure I follow your intension here. I have been running your
activity and although I haven't tested it extensively, when I relaunch
from the Journal I get the drawing I made reloaded. When I add to that
drawing and save, upon relaunch, I get the aggregate drawing. What
behavior would you expect otherwise?

> when I copy an entry from the journal to the USB key, it has the gph
> extension, but it appears as empty : screen capture is a green background
> (the standard background of my application). However, when i open it with a
> text editor from my linux host, it has text data. So i really think i have
> misunderstood the development of interaction with the journal

I've not tested this. Will do and report back.



> I apologize for what i've said in my recent post.
> Regards
> 2011/6/21 James Simmons <nicestep at gmail.com>
>> Laurent,
>> I thought I had covered what you need to know in MYOSA, but if it
>> wasn't clear all you need to do to load a drawing that you created in
>> your Activity is implement the
>> def read_file(self, file_path):
>> method.  That gets executed when your Activity gets loaded, and
>> file_path will contain the data from your Journal entry.  You can also
>> read metadata from the Journal entry here.
>> When you close your Activity then the
>> def write_file(self, filename):
>> will save your drawing file as a Journal entry.  The write_file()
>> method is also the place where you can set up metadata for your
>> Journal entry.
>> write_file() is also invoked when you switch the focus away from your
>> Activity.
>> That is all most Activities will ever need to do, but if you want to
>> do more the chapter "Fun With The Journal" will give you the details.
>> If there are features you need to know about that I didn't cover could
>> you let me know what they are?
>> James Simmons
>> On Tue, Jun 21, 2011 at 12:59 PM, laurent bernabe
>> <laurent.bernabe at gmail.com> wrote:
>> > Hello everyone,
>> >
>> > I just would like to know where is the best place to learn interaction
>> > with
>> > Sugar OLPC journal ?
>> > Because I think that I've not  yet well understand the concept, for my
>> > project LearningWriting.
>> >
>> > I've read the tutorial
>> > http://en.flossmanuals.net/make-your-own-sugar-activities/, but it does
>> > not
>> > seem to cover all features.
>> > (I need to save my drawings and put them back in my application)
>> >
>> > Regards
>> >
>> > _______________________________________________
>> > Sugar-devel mailing list
>> > Sugar-devel at lists.sugarlabs.org
>> > http://lists.sugarlabs.org/listinfo/sugar-devel
>> >
>> >
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel

Walter Bender
Sugar Labs

More information about the Sugar-devel mailing list