Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-12 Thread Jim Simmons
As many of you know, I've been working on a handbook for creating
Sugar Activities and I have added another couple of chapters to it (on
Pootle and distributing your Activity) and made numerous corrections
to earlier chapters, many of them based on suggestions you made.
Stuff still to do:

Text To Speech chapter
Collaboration chapter
Sugar Activity Debugging chapter (which may include information on
using a library Walter Bender created for running Sugar Activities
outside of Sugar)
New Style Toolbars chapter (including how to support both styles in
one Activity)
PyGame chapter or chapters

The sequence these chapters will appear is negotiable.  For now I'm
just trying to get them written, going from easiest to hardest.

I have not been able to get a pre-publish done so the website link I
gave out last week still points to the old content.  However, I have
been able to use OBJAVI to create a really beautiful PDF 73 pages long
(including code samples and screenshots) that has the latest content.
I think there is enough written so far that if I got run over by a bus
someone could still use this to learn how to write an Activity.  If
you have thought about writing your own Activity you might check this
out with Read and see if you agree.  Other kinds of feedback would be
most welcome as well.

The URL of the PDF is:

http://objavi.flossmanuals.net/books/ActivitiesGuideSugar-en-2010.01.11-23.05.32.pdf

Thanks,

James Simmons
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-12 Thread Bert Freudenberg
On 12.01.2010, at 16:43, Jim Simmons wrote:
 
 http://objavi.flossmanuals.net/books/ActivitiesGuideSugar-en-2010.01.11-23.05.32.pdf

Very nice, Jim!

It is a truth universally acknowledged, that a Sugar activity should be written 
in Python.

However, there are other means to go about that, and special circumstances may 
lead a developer to consider alternatives.

In WHAT IS A SUGAR ACTIVITY? you make it sound like Python was a necessary 
ingredient for all Sugar activities. That is not true, an activity *can* be 
written without any bit of Python code. Not even Python bindings are needed. 
See

http://wiki.laptop.org/go/Low-level_Activity_API

Activities can be written in any language, as long as it can connect to D-Bus 
and provide an X11 interface.

While it's most convenient and also encouraged to write new activities in 
Python, it is not mandatory. The Sugar API was carefully designed to allow 
activity development in any language. There are a couple of non-Python 
activities, most prominently Etoys which is even part of the Sugar platform, 
emphasizing it is *not* Python-only. It would be nice if you could rephrase 
that introductory section.

Other than that, very nice book. I love your style :)

- Bert -


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-12 Thread Jim Simmons
Bert,

That is the kind of feedback I was hoping to get, actually.  I figured
if I make a definite statement like Every Activity needs at least
some Python someone who knows better would correct me.  I will make a
more qualified statement in my next revision.

I am hoping that the book will be read by those who have not
programmed (maybe even older children) before so even though I know it
is possible to write an Activity that connects to DBus, etc. I'm not
planning to include examples of that in the book.  In fact, one of my
goals was to get through the whole book without mentioning DBus at
all.  I'd like to leave stuff out of the book if a person could write
an Activity without knowing it.  But I will definitely mention that
there are other ways to make an Activity than the one I'm writing
about.

Thanks again,

James Simmons


On Tue, Jan 12, 2010 at 10:49 AM, Bert Freudenberg b...@freudenbergs.de wrote:
 On 12.01.2010, at 16:43, Jim Simmons wrote:

 http://objavi.flossmanuals.net/books/ActivitiesGuideSugar-en-2010.01.11-23.05.32.pdf

 Very nice, Jim!

 It is a truth universally acknowledged, that a Sugar activity should be 
 written in Python.

 However, there are other means to go about that, and special circumstances 
 may lead a developer to consider alternatives.

 In WHAT IS A SUGAR ACTIVITY? you make it sound like Python was a necessary 
 ingredient for all Sugar activities. That is not true, an activity *can* be 
 written without any bit of Python code. Not even Python bindings are 
 needed. See

        http://wiki.laptop.org/go/Low-level_Activity_API

 Activities can be written in any language, as long as it can connect to 
 D-Bus and provide an X11 interface.

 While it's most convenient and also encouraged to write new activities in 
 Python, it is not mandatory. The Sugar API was carefully designed to allow 
 activity development in any language. There are a couple of non-Python 
 activities, most prominently Etoys which is even part of the Sugar platform, 
 emphasizing it is *not* Python-only. It would be nice if you could rephrase 
 that introductory section.

 Other than that, very nice book. I love your style :)

 - Bert -



___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-07 Thread Wade Brainerd
Hi Jim,

Just wanted to say, this looks awesome!  I love the overall writing
style, the scattered pearls of wisdom and bits of humor, and the
extensive use of screenshots.

I'll try to provide some more detailed comments soon.

Great work!

-Wade

On Tue, Jan 5, 2010 at 2:57 PM, Jim Simmons nices...@gmail.com wrote:
 I've been working on a Floss Manual that should be a beginner's guide
 to creating Sugar Activities.  I've got 64 page's worth (in the PDF
 version) written and I feel confident that I will finish this book
 eventually.  What I have now may be good enough to criticize.  It
 contains some pretty good code samples, some reasonable
 recommendations, and a fair number of screen shots.  So far it covers
 writing a basic Activity in Python, running it with sugar-emulator,
 and getting the code in Git.  Future chapters will include doing i18n
 with Pootle, distributing the Activity, doing text to speech with and
 without highlighting, and collaboration features.  I may stick
 something on Activity debugging techniques in somewhere too.

 Other stuff that *should* be included, but which I am not currently
 qualified to write, would include:

 * Developing Activities on a Mac
 * Creating an Activity using PyGame instead of PyGTK.
 * Creating the new-styled toolbars
 * etc., etc.

 If you want to check out what I have the URL is:

 http://en.flossmanuals.net/ActivitiesGuideSugar/Introduction

 Any help anyone can provide on this will be greatly appreciated.  If
 you want to register as a writer and contribute stuff of your own or
 edit my stuff you have my blessing.

 Thanks,

 James Simmons
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-06 Thread Jim Simmons
Walter,

I figured out a simple answer to this this morning.  I'm going to use
sugar-jhbuild on my Fedora 11 box.  I started the process of setting
it up and so far it's relatively painless.  This kills two birds,
because I probably should have something more to say about
sugar-jhbuild in the book than I currently do.  The last time I tried
it was on an old version of SuSE and that was painful.  With Fedora 11
it's time consuming but not awful.

SoaS would be another option, but not as convenient.

Thanks,

James Simmons

On Tue, Jan 5, 2010 at 9:02 PM, Walter Bender walter.ben...@gmail.com wrote:
 Is Sugar on a Stick a suitable test environment for you? That is 0.86.

 -walter

 On Tue, Jan 5, 2010 at 4:20 PM, Jim Simmons nices...@gmail.com wrote:
 Walter,

 I've used the import exception method myself.  It looks like this will
 be a bit more complicated than I had planned on, because it would seem
 that I'd need a .86 environment to test in.  I have two development
 boxes at home, one running Fedora 10 (which I plan to leave alone) and
 another running 11, which I could update to 12 if that would give me
 .86.  Unfortunately, Fedora's idea of upgrade seems to be a clean
 install, which I'd like to put off.  Maybe I should finish the rest of
 the chapters before I try making new style toolbars.

 You've given me a good start though, and I think I can figure out the
 rest.  I could probably figure out the PyGame stuff too.  It's the
 developing on a Mac topic that has me stumped.

 Thanks,

 James Simmons


 On Tue, Jan 5, 2010 at 2:42 PM, Walter Bender walter.ben...@gmail.com 
 wrote:
 On Tue, Jan 5, 2010 at 2:57 PM, Jim Simmons nices...@gmail.com wrote:
 I've been working on a Floss Manual that should be a beginner's guide
 to creating Sugar Activities.  I've got 64 page's worth (in the PDF
 version) written and I feel confident that I will finish this book
 eventually.  What I have now may be good enough to criticize.  It
 contains some pretty good code samples, some reasonable
 recommendations, and a fair number of screen shots.  So far it covers
 writing a basic Activity in Python, running it with sugar-emulator,
 and getting the code in Git.  Future chapters will include doing i18n
 with Pootle, distributing the Activity, doing text to speech with and
 without highlighting, and collaboration features.  I may stick
 something on Activity debugging techniques in somewhere too.

 Other stuff that *should* be included, but which I am not currently
 qualified to write, would include:

 * Developing Activities on a Mac
 * Creating an Activity using PyGame instead of PyGTK.
 * Creating the new-styled toolbars
 * etc., etc.

 If you want to check out what I have the URL is:

 http://en.flossmanuals.net/ActivitiesGuideSugar/Introduction

 Any help anyone can provide on this will be greatly appreciated.  If
 you want to register as a writer and contribute stuff of your own or
 edit my stuff you have my blessing.


 Jim,

 This is a great start. I'll try to help out with some of the missing piece.

 Re how to handle the new toolbars, I have some examples from other
 programs, but I am happy to work with you on the ReadEtext example if
 you want. The only thing you need are some icons to represent the
 toolbar submenus. Your current activity icon will replace the
 Activity toolbar; there is a standard icon for the Edit toolbar
 ('toolbar-edit'); likewise, for the 'View toolbar ('toolbar-view').
 You'll need to decide on an icon for the Read toolbar, perhaps the
 icon from the Read activity?

 The trick then is to figure out which version of Sugar you are
 running in order to decide which toolbars to use. I am lazy and just
 catch an ImportError:

 import sugar
 from sugar.activity import activity
 try: # 0.86+ toolbar widgets
    from sugar.bundle.activitybundle import ActivityBundle
    from sugar.activity.widgets import ActivityToolbarButton
    from sugar.activity.widgets import StopButton
    from sugar.graphics.toolbarbox import ToolbarBox
    from sugar.graphics.toolbarbox import ToolbarButton
    sugar86 = True
 except ImportError:
    sugar86 = False
    pass
 from sugar.graphics.toolbutton import ToolButton
 from sugar.graphics.menuitem import MenuItem
 from sugar.graphics.icon import Icon

 later...

 if sugar86 is True:
    toolbar_box = ToolbarBox()
    ...
    self.set_toolbar_box(toolbar_box)
    toolbar_box.show()
 else:
    self.toolbox = activity.ActivityToolbox(self)
    self.set_toolbox(self.toolbox)
    ...
    self.toolbox.show()
    self.toolbox.set_current_toolbar(1)

 There are a few more details regarding sharing callbacks between the
 toolbars, etc. Maybe checkout
 http://git.sugarlabs.org/projects/visualmatch/repos/mainline/blobs/master/VisualMatchActivity.py
 for an example.

 -walter

 Thanks,

 James Simmons
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




 --
 Walter 

Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-06 Thread Jim Simmons
Gary,

I don't have a Mac.  My brother has one but lives in another state.  I
know the latest Macs run a kind of Unix on Intel chips, but can they
run sugar-jhbuild?  Or do you run Sugar in a VM of some kind?  If you
browse through my chapters you'll see my way of doing things and maybe
you can give some insight into how you'd do it differently.

I'm interested in Mac developers because Caryl Bigenho had emailed me
saying she looked forward to learning how to write Sugar Activities
from the book.  If she actually tried to learn from the book that
would be the best test I could ask for, but I understand that she's a
Mac user.

Thanks,

James Simmons

On Tue, Jan 5, 2010 at 9:05 PM, Gary C Martin g...@garycmartin.com wrote:
 Hi James,


 * Developing Activities on a Mac

 I'll try to help here, though I'm not sure how 'Developing Activities on a 
 Mac' really differs from any other platform, though I'm sure I have a few 
 shiny reality distortion platform habits of choice that may be of use to 
 others ;-)

 * Creating an Activity using PyGame instead of PyGTK.

 Maybe can help here as well, Physics originally is a PyGame (and others) 
 construct, though I'm not convinced how elegant the code really is. Wade has 
 been working on sugargame as an improved over the original olpcgame 
 sugarising effort, so would be good to focus on that, I think (see Physics 
 git rep and Wade's clone I hope to merge moving forward).
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-06 Thread Sascha Silbe

On Wed, Jan 06, 2010 at 10:01:36AM -0600, Jim Simmons wrote:


I don't have a Mac.
FWIW, I've got a real (read: PowerPC) Mac (eMac to be more specific) 
running Sugar from distro packages on Debian squeeze quite fine. 
Installation was a bit painfull, though - I need to repeat it some time 
and file bug reports. Or maybe someone else is adventurous enough to try 
it? :)


My brother has one but lives in another state.  I know the latest Macs 
run a kind of Unix on Intel chips, but can they run sugar-jhbuild?
They can't run sugar-jhbuild directly inside MacOS X. It's possible in 
theory, but would take a lot of effort (most of it probably changing 
upstream code to build and run on MacOS X).



Or do you run Sugar in a VM of some kind?
That's one option. The two others are dual-booting into some Linux 
distro (similar to what they seem to do with Windows) and SoaS. But Gary 
probably knows about that much better than I do. :)


CU Sascha

--
http://sascha.silbe.org/
http://www.infra-silbe.de/

signature.asc
Description: Digital signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-06 Thread Behavior Vehikel
Hello Jim,

Nine month ago I started writing my first activity for sugar (
http://git.sugarlabs.org/projects/kandid ). Had trouble to understand
the following three things .

My hardest problem is the code for collaborating. I copied some code
from the Connect activity and adopted it to my activity. But even now
after I published my first version I am not able to make more than
trivial changes in this code. An in detail chapter about looking up
buddies, neighborhood, joining, using tubes will be a great help for
me.

Next point is the journal. Please explain how to use is in an conform
way to exchange data between different activities. In one of next
revision my activity will be able to import and export bitmap images.
How should this be implemented to achieve a tight integration to other
Sugar activities?

Setting up an Sugar emulator on Ubuntu or using SoaS in a virtual
machine it not too complicated. But I spend a lot of time to simulate
two or more Sugar desktops to test collaboration. Up to now I not able
to simulate the mesh networking. I installed something like a 'school
server' and three virtual  'laptops'. An chapter about building a
virtual network for testing collaboration will be helpful. By the way
I have no access to an real XO Laptop. All my development is done on
one typical desktop computer.

Kind regards
Thomas


2010/1/6, Sascha Silbe sascha-ml-ui-sugar-de...@silbe.org:
 On Wed, Jan 06, 2010 at 10:01:36AM -0600, Jim Simmons wrote:

 I don't have a Mac.
 FWIW, I've got a real (read: PowerPC) Mac (eMac to be more specific)
 running Sugar from distro packages on Debian squeeze quite fine.
 Installation was a bit painfull, though - I need to repeat it some time
 and file bug reports. Or maybe someone else is adventurous enough to try
 it? :)

 My brother has one but lives in another state.  I know the latest Macs
 run a kind of Unix on Intel chips, but can they run sugar-jhbuild?
 They can't run sugar-jhbuild directly inside MacOS X. It's possible in
 theory, but would take a lot of effort (most of it probably changing
 upstream code to build and run on MacOS X).

 Or do you run Sugar in a VM of some kind?
 That's one option. The two others are dual-booting into some Linux
 distro (similar to what they seem to do with Windows) and SoaS. But Gary
 probably knows about that much better than I do. :)

 CU Sascha

 --
 http://sascha.silbe.org/
 http://www.infra-silbe.de/


-- 
http://digital-defect.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-06 Thread Jim Simmons
Thomas,

In the chapter Adding Refinements I have some sample code for
creating, listing, and reading from Journal entries.  I'll probably
add an example of deleting a Journal entry as well.  And while I am no
expert in collaboration *yet* I will definitely be covering that in a
future chapter.  I too have not successfully simulated a mesh network.
 I have always used a test school server.  My hope is that as I create
new chapters others that are more knowledgeable will point out things
that I'm missing or contribute content themselves.

I do have an XO laptop, but after demonstrating SoaS Blueberry to a
seven year old niece this New Year's Day (I made it as a sort of extra
Christmas gift for her, and she loved it) I'm really starting to feel
that for Sugar developers the XO's are not the only game in town.

I hope you'll check out the book as I go along.  Collaboration will
likely be the last chapter I do, because it will be the most difficult
to write.  For every chapter I have to come up with demo code that
works, demonstrates good technique, and does something interesting.
This is a programming project as well as a writing project.

Thanks for your input,

James Simmons


On Wed, Jan 6, 2010 at 12:57 PM, Behavior Vehikel
b.vehi...@googlemail.com wrote:
 Hello Jim,

 Nine month ago I started writing my first activity for sugar (
 http://git.sugarlabs.org/projects/kandid ). Had trouble to understand
 the following three things .

 My hardest problem is the code for collaborating. I copied some code
 from the Connect activity and adopted it to my activity. But even now
 after I published my first version I am not able to make more than
 trivial changes in this code. An in detail chapter about looking up
 buddies, neighborhood, joining, using tubes will be a great help for
 me.

 Next point is the journal. Please explain how to use is in an conform
 way to exchange data between different activities. In one of next
 revision my activity will be able to import and export bitmap images.
 How should this be implemented to achieve a tight integration to other
 Sugar activities?

 Setting up an Sugar emulator on Ubuntu or using SoaS in a virtual
 machine it not too complicated. But I spend a lot of time to simulate
 two or more Sugar desktops to test collaboration. Up to now I not able
 to simulate the mesh networking. I installed something like a 'school
 server' and three virtual  'laptops'. An chapter about building a
 virtual network for testing collaboration will be helpful. By the way
 I have no access to an real XO Laptop. All my development is done on
 one typical desktop computer.

 Kind regards
 Thomas
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-06 Thread Bert Freudenberg
On 06.01.2010, at 20:50, Jim Simmons wrote:
 
 I too have not successfully simulated a mesh network.
 I have always used a test school server.

It's a (common) misconception that you need a mesh or school server to 
collaborate under Sugar. The XO 1.5 doesn't even support (hardware-) mesh 
anymore. But any local network works just fine. And an activity doesn't need to 
care about the actual transport mechanism. It works even on just one machine, 
like with two jhbuild instances (different SUGAR_PROFILE env var). 

- Bert -


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-05 Thread Walter Bender
On Tue, Jan 5, 2010 at 2:57 PM, Jim Simmons nices...@gmail.com wrote:
 I've been working on a Floss Manual that should be a beginner's guide
 to creating Sugar Activities.  I've got 64 page's worth (in the PDF
 version) written and I feel confident that I will finish this book
 eventually.  What I have now may be good enough to criticize.  It
 contains some pretty good code samples, some reasonable
 recommendations, and a fair number of screen shots.  So far it covers
 writing a basic Activity in Python, running it with sugar-emulator,
 and getting the code in Git.  Future chapters will include doing i18n
 with Pootle, distributing the Activity, doing text to speech with and
 without highlighting, and collaboration features.  I may stick
 something on Activity debugging techniques in somewhere too.

 Other stuff that *should* be included, but which I am not currently
 qualified to write, would include:

 * Developing Activities on a Mac
 * Creating an Activity using PyGame instead of PyGTK.
 * Creating the new-styled toolbars
 * etc., etc.

 If you want to check out what I have the URL is:

 http://en.flossmanuals.net/ActivitiesGuideSugar/Introduction

 Any help anyone can provide on this will be greatly appreciated.  If
 you want to register as a writer and contribute stuff of your own or
 edit my stuff you have my blessing.


Jim,

This is a great start. I'll try to help out with some of the missing piece.

Re how to handle the new toolbars, I have some examples from other
programs, but I am happy to work with you on the ReadEtext example if
you want. The only thing you need are some icons to represent the
toolbar submenus. Your current activity icon will replace the
Activity toolbar; there is a standard icon for the Edit toolbar
('toolbar-edit'); likewise, for the 'View toolbar ('toolbar-view').
You'll need to decide on an icon for the Read toolbar, perhaps the
icon from the Read activity?

The trick then is to figure out which version of Sugar you are
running in order to decide which toolbars to use. I am lazy and just
catch an ImportError:

import sugar
from sugar.activity import activity
try: # 0.86+ toolbar widgets
from sugar.bundle.activitybundle import ActivityBundle
from sugar.activity.widgets import ActivityToolbarButton
from sugar.activity.widgets import StopButton
from sugar.graphics.toolbarbox import ToolbarBox
from sugar.graphics.toolbarbox import ToolbarButton
sugar86 = True
except ImportError:
sugar86 = False
pass
from sugar.graphics.toolbutton import ToolButton
from sugar.graphics.menuitem import MenuItem
from sugar.graphics.icon import Icon

later...

if sugar86 is True:
toolbar_box = ToolbarBox()
...
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
else:
self.toolbox = activity.ActivityToolbox(self)
self.set_toolbox(self.toolbox)
...
self.toolbox.show()
self.toolbox.set_current_toolbar(1)

There are a few more details regarding sharing callbacks between the
toolbars, etc. Maybe checkout
http://git.sugarlabs.org/projects/visualmatch/repos/mainline/blobs/master/VisualMatchActivity.py
for an example.

-walter

 Thanks,

 James Simmons
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-05 Thread Jim Simmons
Walter,

I've used the import exception method myself.  It looks like this will
be a bit more complicated than I had planned on, because it would seem
that I'd need a .86 environment to test in.  I have two development
boxes at home, one running Fedora 10 (which I plan to leave alone) and
another running 11, which I could update to 12 if that would give me
.86.  Unfortunately, Fedora's idea of upgrade seems to be a clean
install, which I'd like to put off.  Maybe I should finish the rest of
the chapters before I try making new style toolbars.

You've given me a good start though, and I think I can figure out the
rest.  I could probably figure out the PyGame stuff too.  It's the
developing on a Mac topic that has me stumped.

Thanks,

James Simmons


On Tue, Jan 5, 2010 at 2:42 PM, Walter Bender walter.ben...@gmail.com wrote:
 On Tue, Jan 5, 2010 at 2:57 PM, Jim Simmons nices...@gmail.com wrote:
 I've been working on a Floss Manual that should be a beginner's guide
 to creating Sugar Activities.  I've got 64 page's worth (in the PDF
 version) written and I feel confident that I will finish this book
 eventually.  What I have now may be good enough to criticize.  It
 contains some pretty good code samples, some reasonable
 recommendations, and a fair number of screen shots.  So far it covers
 writing a basic Activity in Python, running it with sugar-emulator,
 and getting the code in Git.  Future chapters will include doing i18n
 with Pootle, distributing the Activity, doing text to speech with and
 without highlighting, and collaboration features.  I may stick
 something on Activity debugging techniques in somewhere too.

 Other stuff that *should* be included, but which I am not currently
 qualified to write, would include:

 * Developing Activities on a Mac
 * Creating an Activity using PyGame instead of PyGTK.
 * Creating the new-styled toolbars
 * etc., etc.

 If you want to check out what I have the URL is:

 http://en.flossmanuals.net/ActivitiesGuideSugar/Introduction

 Any help anyone can provide on this will be greatly appreciated.  If
 you want to register as a writer and contribute stuff of your own or
 edit my stuff you have my blessing.


 Jim,

 This is a great start. I'll try to help out with some of the missing piece.

 Re how to handle the new toolbars, I have some examples from other
 programs, but I am happy to work with you on the ReadEtext example if
 you want. The only thing you need are some icons to represent the
 toolbar submenus. Your current activity icon will replace the
 Activity toolbar; there is a standard icon for the Edit toolbar
 ('toolbar-edit'); likewise, for the 'View toolbar ('toolbar-view').
 You'll need to decide on an icon for the Read toolbar, perhaps the
 icon from the Read activity?

 The trick then is to figure out which version of Sugar you are
 running in order to decide which toolbars to use. I am lazy and just
 catch an ImportError:

 import sugar
 from sugar.activity import activity
 try: # 0.86+ toolbar widgets
    from sugar.bundle.activitybundle import ActivityBundle
    from sugar.activity.widgets import ActivityToolbarButton
    from sugar.activity.widgets import StopButton
    from sugar.graphics.toolbarbox import ToolbarBox
    from sugar.graphics.toolbarbox import ToolbarButton
    sugar86 = True
 except ImportError:
    sugar86 = False
    pass
 from sugar.graphics.toolbutton import ToolButton
 from sugar.graphics.menuitem import MenuItem
 from sugar.graphics.icon import Icon

 later...

 if sugar86 is True:
    toolbar_box = ToolbarBox()
    ...
    self.set_toolbar_box(toolbar_box)
    toolbar_box.show()
 else:
    self.toolbox = activity.ActivityToolbox(self)
    self.set_toolbox(self.toolbox)
    ...
    self.toolbox.show()
    self.toolbox.set_current_toolbar(1)

 There are a few more details regarding sharing callbacks between the
 toolbars, etc. Maybe checkout
 http://git.sugarlabs.org/projects/visualmatch/repos/mainline/blobs/master/VisualMatchActivity.py
 for an example.

 -walter

 Thanks,

 James Simmons
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




 --
 Walter Bender
 Sugar Labs
 http://www.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Several chapters of Make Your Own Sugar Activities! ready for review, feedback

2010-01-05 Thread Sascha Silbe

On Tue, Jan 05, 2010 at 03:20:15PM -0600, Jim Simmons wrote:

I have two development boxes at home, one running Fedora 10 (which I 
plan to leave alone) and another running 11, which I could update to 
12 if that would give me .86.  Unfortunately, Fedora's idea of upgrade 
seems to be a clean install, which I'd like to put off.
I don't know what tools there are for Fedora, but Debian has debootstrap 
and schroot which I'm using to install and use different versions of 
Debian inside chroots for Sugar development. Works quite well for me 
(except for #1401 [1] / #1403 [2], that is).

For different distros I use KVM, but chroots are much more comfortable.


PS: Thanks for the guide. I haven't read it yet, but your effort is 
quite appreciated.


[1] http://bugs.sugarlabs.org/ticket/1401
[2] http://bugs.sugarlabs.org/ticket/1403

CU Sascha

--
http://sascha.silbe.org/
http://www.infra-silbe.de/

signature.asc
Description: Digital signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel