Christmas 2008 PC

December 31, 2008

( Beloved Vareille is a fan of the OLPC project since April 2007, where he attended a first meeting on the project in Grenoble. This year, he was among the first buyers of XO in France via the program "One among you, a home ". In this post, he tells us his experience and impressions)

The XO in the sun

I ordered the XO, the result of OLPC, 3 December 2008 on the Amazon website through the operation G1G1 (Give One, Get One). He arrived safely in Belgium shortly before Christmas.
By cons there is no information or guarantee the beneficiary of the XO offered: Imagine the Magi who walked without knowing anything about the person who is their gift?

Given the keyboard, it is desirable that it be English ... the language change for the activities is made easy through the Control Panel. For cons, the inclusion of an external USB keyboard French (azerty ...) for example is not so automatic now (version 767, Sugar 0.82.1).

The XO machine is a fascinating result of the remarkable initiative OLPC (One Laptop Per Child: one laptop per child). The liquid crystal display (LCD), as shown in the photo taken in the morning outside Retroreflection can operate in pure: he is so black and white with a contrast increases as the illumination is strong c ' is particularly spectacular in the sun, where other backlit LCDs become unusable. Obviously the LCD XO backlight mode also works with all colors, which is surprising is that the switching from Retroreflection black and white backlit color mode is progressive.

The other strong point is that the XO consumes a few watts: it is a priori the notebook more energy now.

The 802.11s mesh WiFi works with the current g WiFi WPA without any problem.

the integrated webcam is also an asset well exploited by the first OLPC classes to introduce students to the observation.

G1G1 The operation ends December 31, 2008: http://blog.laptop.org/2008/12/24/g1g1-international-update/

In France the G1G1 is accessible through an agreement with Amazon UK: http://olpc-france.org/wiki/index.php?title=Commander_son_XO

There is much to discover and learn with the XO, although it is completely open, it is not so easy to use in multiboot on USB sticks.

My first project on the machine will concern:

When I rose, I intend to discuss in more detail on my blog: http://blog.ofset.org/aime .

Of XOs for a Russian summer camp

December 25, 2008

(Boris Yarmakhow is a professor at State University of Nizhny Novgorod and voluntary on the OLPC. In this article from OLPC News dated August 2008, he tells us his experience of using XOs for a camp summer)

Of XOs on vacation

In August 2008, a small project to deploy XO started in Russia. A group of professors from the University of Nizhny Novgorod State Pedagogical taught 32 students in Nizhny Novgorod to use the XOs during a summer camp. The project took place in the countryside on land belonging to the university in the village of Staraya Pustyn in the region of Nizhny Novgorod.

The XOs were used in 1:1 mode, each student participating in summer camp has become the owner of an XO for 10 days. The activities of summer camp where the XO was used included: taking pictures of plants and animals encountered during excursions, writing stories about their impressions and experiences, collect and process geographic data from the nearby camp, measuring the noise level and to program in Scratch. All stories and images were stored in a mediawiki running on the local WiFi network. The 32 students were registered on the wiki and used the hypertext environment to collaborate with others.

We taught students how to use the Browse activity, write, draw, measure and Scratch. Most of them have also discovered and used the Chat activity across the network mesh in their spare time. Several students also used Distance and Etoys of themselves.

The camp

The XO has proven to be a very effective tool for learning for a summer camp. Its design and display allows it to be used outdoors. Our students put their XO in a small backpack if they had to walk somewhere and they simply used the handle to carry it around the camp. We have encountered problems with the mouse on one of the XOs (we had to use a USB mouse on this machine). Sometimes the XOs lost the LAN connection, which was solved by simply rebooting the machine. The kids loved the XOs. There was not a single case of loss or damage XO.

Output type

The summer camp has become not only the first deployment of XOs in Russia (there are 54 XOs in Russia as I know, and we have 53). It was also the first educational project on a 1:1 basis. It was attended by about 20 teachers, students and volunteers from Nizhny Novgorod, St Petersburg and Moscow and became an important step in building a community of 1:1 teacher / teacher in Russia.

The project was made possible through the generosity and support of the Dutch foundation "Making Miles for Millennium," which provided the project team of 50 XOs and the rest of the infrastructure.

Thank you to Ton van Overbeek have set up the Picasa photo gallery which contains more photos of summer camp XO. See original article on OLPC News for other links on reports and photos of this summer camp.

Notes OLPC deployments in Cambodia

December 23, 2008

(Mike Cariaso is a volunteer working on the deployment of the OLPC Cambdoge. He gives us his feedback from the school in which Nicholas Negroponte test for the first time the use of computers for education. This Post is the translation of a recent article in his blog )

Satellite connection

Reaksmy, Vihea Preah, Cambodia is home to the school PRIDE (Providing Rural Innovative Digital Education). Elaine and Nicholas Negroponte founded the school in 1999, and Elaine still lives in Cambodia almost half of the year. Before there was the XOs, the elementary school was equipped with a class of phones. These machines were originally of Panasonic Toughbooks, many of which are still used daily. Now there are about 250 XOs here and they can be considered a true response to the harshness of the environment. While the XO is still young, it is important to measure the results and see how they can be improved.

For information, only two machines were seriously damaged. A screen was broken after the fall of the machine, another was damaged when it was cleaned with water. Other students apparently learned the lesson and it is unlikely that this error occurs again. The Sugar interface makes it really easy the final suppression of the activities of XO, which can also give us more work.

A Cambodian student and XO

As others have noted, the most common problem is the "jumping cursor". Interestingly, there were many experiments and found a reduction of the problem by putting tape on the touchpad. Maybe others will find this site useful trick until the next update of Sugar. Anyway the problem should be solved in software along with other problems in the network. In particular I was hoping to provide remote support via a SSH tunnel on the XO. But even with a USB cable / Ethernet, I was not able to operate simultaneously and Mesh Internet. I hope someone who has experience on the functioning of the XO network can help me on this.

Students in elementary school have a course with the computer one hour per day, 5 days a week. The first day I arrived, I saw a multimedia presentation made Scratch, which was performed by the students of 6th (13 to 15 years). The themes were such as "how to cook rice at home," "how to grow vegetables in the garden," "how to play baseball." It was quite similar to PowerPoint presentations that I'm used during scientific conferences or business but it was much better in many ways. The project was started several days before each group of students and students using the XO to take pictures at home. Finally, they recorded the text which provided the opportunity for those not fluent in English to re-record and edit until they are satisfied with the outcome.

To draw out the XO

Later in the day, many younger students have taken out their XO to use the activity of drawing and designing houses and the nature around them. In my previous experience, I learned to appreciate how drawing programs are important for students to learn control of the mouse, copy / paste / move, backup and exit activities. The ability to use the XO outdoors in sunlight, develop children's creativity in a way that is not imaginable when they are between four walls.

For historical reasons, education in the countries of Southeast Asia is largely based on memorization. It is quite far from the model of the OLPC project that encourages individual creativity and collaboration. Establish new habits of education is neither simple nor quick. Western teachers that I met told me they often need to show an example but they are rushing to delete to prevent the students copied verbatim. Have a girl who raises his hand in the middle of the class to say "Professor, I have a question" is too rare a moment that makes you understand the real progress has been achieved here.

Additional photos are available at: http://www.flickr.com/photos/cariaso/archives/date-taken/2008/12/18/

Gérard Klein sponsors OLPC France

December 14, 2008

The promotion of an at home, a home left me little time these days to talk about this event, which is therefore clear that as a mere news among others. I want some of this great moment in the life of OLPC France. And first, for those who have not seen it yet, here's the video:

http://www.dailymotion.com/video/x7ndfh

It was important for us to have a sponsor who would bring credibility to the OLPC project and OLPC France. That's what OLPC Boston has also performed with Tom Brady . Tom Brady is probably unknown to you but it's a famous Quarterback - Football playmaker in US - in the New England Patriots team.

We therefore sought to contact the individuals who would like to give us a few minutes of their time to promote this great project and bring hope to change the world for children. Thanks to a contact Laurence Buchmann, a recent recruit of OLPC France, Gérard Klein was kind enough to answer that call.

Gerard Klein is known for the series " The Instit "in which he played for over 10 years a teacher Victor Novak making substitutions throughout France and even abroad in certain episodes. Gerard Klein also hosted the magazine " Va Savoir "on France 5 in which he traveled the road with a dozen children in a yellow bus.

Gerard now runs the website http://www.gerardklein.org on which it tries, through reports, to make the connection between solidarity groups and individuals who wish to help. It also follows the associations in the field. Read the charter of its site and you will understand the spirit of solidarity that animates this action. This can not be a coincidence that his path is crossed OLPC France!

The shooting of the video was made ​​December 4, 2008 at La Maison de la Radio, where Gerard handed the awards evening of solidarity Award in 2008 .

The film crew was composed by Laurence Buchmann to completion, the script and the scene (!), Philippe Lallet for images, and Alain Barnault to the sound. All three are professionals and were equipped as such. I must admit that I have happy memories from this shoot. I was obviously not of much use (except for two XOs Take affected) but I was looking through the eyes of these four children to the body, take after take, in this film. Our association has only six months, it's always impressive to see, as in those moments, how it can take shape. In short, it was a great moment of generosity and I take this opportunity to once again thank Gerard and the team.

The film was shot in HDCAM and was mounted in the studio by Laurence. It includes shots of the video Zimi , conducted by the foundation to promote the project Give One Get One in the U.S..

Notes on the OLPC deployment in Nepal

December 12, 2008

(This article is a translation of the article "Notes from OLE Nepal OLPC Deployment year" appeared on OLPC News , I thought it was interesting to offer you as it provides a vision field of a real deployment of the project.)

OLPC deployments in Nepal have started there is now more than 7 months. I was asked many questions about the difficulties we encountered and the solutions we have implemented. I hope the following information helpful. First, a brief overview of our deployments:

Progress of OLE Nepal

Deployments began in the public schools Vishwamitra Ganest and Bashuki April 23, 2008,

  • 135 XO-1 computers were made to students in grades 2 and 6;
  • no computer has been stolen, lost or was missing. A computer was seriously damaged by the child to which he belonged after he had cleaned thoroughly with soap and water. Apart from this, no computer has been severely damaged by its use;
  • 8 motherboards, keyboards, 5 microphones and 4 were found defective machinery;
  • children used the computers in the classroom 1-2 times per week;
  • The most common problem we encountered is the problem of "jumping mouse cursor";
  • teachers, parents and children are happy with the project, according to the results of the survey we conducted.
    1. children and their parents attached great value to the XO and protected accordingly;
    2. Crime in rural Nepal is relatively low compared to developed countries. In rural communities, everybody knows the "business" of others.
    • Easier way to play music and videos.
    • Better e-book reader.
    • More activities to learn English.
    • All the Nepali text book in electronic format.
    • A comprehensive digital library content with many Nepali language.
    • An assistance program for writing to learn English and Nepali.
    • Of interactive learning activities in accordance with the Nepali educational program.
    • A car racing game (children).
  • At the beginning: teacher training

    We conducted four days of teacher training outside the school and five days in class with students and teachers. A majority of our teachers had never used a computer before, but they learned very quickly. Their enthusiasm was impressive. Training outside the school ended at 5:30 p.m. normally but teachers remained in the room every night until 23H, exploring the XO and constantly asking questions.

    Although teachers have learned very quickly how to use the XO, I did not anticipate how certain actions would be difficult for them. In particular, they had plenty of time to learn the "drag" the mouse. Most of the best work of the XO requires good dexterity with the mouse as TurtleArt, Etoys and Scratch. For this reason, we have not had time to cover its activities during the training. I advise to start teacher training through activities that do not require great skill with the mouse.

    Protect children and computers

    We were very concerned about computer security and safety of children when carrying their precious machines between school and home every day. Vishwamitra and Bashuki are both in poor communes. However our fears were unfounded. XO has not been lost, stolen or missing. I think this is due to two things:
    Maintenance and support of computers

    One of the big surprises was the short time the team spent in support and maintenance of the XO. The XO-1 is a fantastic machine and I am convinced that anyone with a little mechanical aptitude can solve 90% of the hardware problems that can happen, simply by replacing a bad component with a spare.

    Writing on the XO Limbu

    The "test mode" built into the firmware of the XO is an indispensable tool. Just run the "test mode" firmware and it will give you a full report indicating what hardware is in error. Unfortunately, we could not access the test without the activation key developer of the XO. For this reason we have asked the key to all the XOs and we have disabled the security on each of them.

    We have trained teachers in two schools to address the hardware and software problems. They can handle most of the hardware problems that occur. Due to my limited experience, I can say that it is feasible to train teachers to resolve hardware problems but it is more difficult to teach them how to troubleshoot software in the Linux kernel or Sugar. If a serious software problem occurs, our teachers simply reflash the XO with the specific image for Nepal, which includes standards activities.

    Under Pressure: meet the program

    OLPC in the world, we like to talk about friendly concepts such as constructivism, co-learning, collaboration, etc ... However, teachers and Bashuki Vishwamitra have more pressing concerns. The Nepali system does not allow for social advancement. Children have to pass an annual examination to the next level. Nepali teachers are interested in constructivism, co-learning, and collaboration as they let their students to progress through the education system. Our teachers are very happy with the result of E-business Paath that OLE Nepal developed in accordance with the program. The real interest of the teachers found the OLPC project in the classroom and they can take their students with a problem on the XO and during that time working with students who need help.

    The missing link: the school server

    When we deployed the school server (XS) in April, XS-163 configuration was a very immature. Since the XS server has changed under the influence of its architect, Martin Langhoff. But then as now, the XS server does not offer content filtering pre-configured. We had a time therefore to configure the tool so that Dansguardian not blocking good content and it blocks the bad content.

    The XOs in rural Nepali

    For example, "Dikshit" is a name common in Nepal. Dansguardian will block access to new articles containing that name because he considers the last four letters as an insult (note: "shit" means "shit" in English). XS server is still largely developing and deploying the teams need solid expertise to set up a server operating XS.

    Main demands of teachers and children

    We will incorporate what we learned from these deployments schools when we deploy 15-20 schools in 5-6 districts in April 2009. With any luck, I'll find more time to talk about my experiences in the coming weeks but do not count on it. I work at OLPC for over two and a half years and I must say it really worth it.

    Postscript: Pradosh Kharel worked on a comprehensive plan for the deployment Nepal. You can read it here .

    Bryan Berry is CTO of OLE Nepal and co-editor of OLPC News. OLE Nepal supports OLPC deployments in partnership with the Nepalese Department of Education.

[Contest] The XO in kindergarten

December 8, 2008
Tags:

(Philippe Larcher is one of the winners of OLPC France. In this post, Philippe tells us his first impressions here after 3 weeks of class with the machine)

The class in which I currently consists of three sections of kindergarten:

  • Petite Section (PS),
  • Middle Section (MS)
  • Large section (GS).

I have not started the project submitted for the contest because I want to familiarize myself with the laptop before.

Children of MS (4 years) and GS (5 years) have quickly adopted the XO: their dimensions are perfect. They are much better fitted to a desk in the class of specific furniture to computers, too high for children of this age!

Armel before the XO
Armel before the XO

The thinness of the keyboard makes controlling the touchpad: a few seconds for some who had never touched a computer before.

The younger, Nursery (3 years), are demanding but very awkward in their movements.

Software or activities most used currently are Memorize, records photos, videos and audios.

Elyne before the XO he calls
Elyne before the XO he calls the "small office"

The XO works wonders in this area: ease of use is amazing. Take pictures at various times of the class to talk, discuss and build a memory game is simple. This aspect was very surprised, especially compared to what I usually do with camera, large PC image processing etc ...
Transferring files to SD card or USB stick is just as easy: it allows me to prepare small programs with Scratch.
There are tremendous opportunities in that direction.

The keyboard is perhaps the point that I have a problem: the accented characters are difficult to produce and non-transferable. The lack of a keypad lock position complicates the use uppercase at the beginning of school year in which case sensitive correspondence is far from familiar to the children of large section. But solutions must certainly exist.

The XO while aimed at older children seems to be perfectly suited for work with students from kindergarten.

[Contest] Music Theory and Practice

December 5, 2008

(Theory and Practice of Music is one of the projects selected by the Board of OLPC France for his contest idea. In this post, François Sénéquier, the author presents his project and its port to the XO)

Software Overview

This is a tool for learning music theory (scales, chords, relationship between scale / chord) and practice a musical instrument (guitar, piano, harmonica ...).

Capture Music Theory

To begin learning an instrument, it is necessary to know the range (blues, major, minor, ...) and modes (modes of the major scale for the Jazz ...) but also agreements (7M, above, Sun, ...) and their inversions.

We must also understand the relationship between scales and chords that:
Miss line with what sounds good agreements and vice versa?

The tool allows you to:

  • comparisons between scales and chords like getting the harmonization of a particular range (all existing agreements built on the notes of the scale in question);
  • to find the name of an agreement or a range over a set of notes
  • how to play the notes of a scale or a chord (arpeggios) on a musical instrument (rope / box for a guitar, blow alveoli + / + aspire to pull a harmonica, ...) with a graphical simple notes.

The project is available on Sourceforge:

Porting the application

Porting the implementation of joint developed on EEE PC music took place in two stages:

  • direct execution from the console (terminal) without using special packages of Sugar activities: The XO is a real Linux system does not run the application directly to verify the portability of the code but also the libraries needed are pre-installed on the XO. On EEE PC, the libraries used are:
    • python-cairo (for graphical output);
    • python-gtk2 (for management interface GTK);
    • librsvg2-2 (to use the SVG vector graphics in Cairo);
    • python-psyco (to speed up the execution of Python programs).

    The only library missing in the original configuration of the XO is Psyco.
    This library allows you to run Python programs more quickly but at the expense of greater memory consumption. Psyco can be installed on the XO using the YUM package manager and it works fine.

    To enable Psyco in a Python program, the following code can be used:


    try:
    import psyco
    psyco.full()
    except ImportError:
    print "'Psyco' introuvable !"

    To avoid problems of memory, using the garbage collector can be forced and the maximum memory can be recovered through the following commands:


    try:
    import gc
    gc.enable()
    gc.collect()
    except:
    print "Garbage collector error !"

    Given the resources of the XO (processor interface in Python, Psyco not installed), parts of the code had to be optimized. But here are many optimization algorithms or pure logic, not low-level optimizations as it is possible to do with the C language.

    The program, as a result of these optimizations is stable (no problem of memory, speed acceptable) on the XO.

  • Creation of activity:
    • Creating the activity
      : Theorie.activity;
    • Create the directory the subdirectory theorie.activity activity;
    • Create activity in the directory, the icon for the project in SVG: theory-activity.svg
      Note: the icon of the activity (treble clef) comes from the library openclipart and was modified to incorporate the mechanism of color change of Sugar. Declaration of two variables containing the color plot (stroke) and fill (fill):

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [
      <!ENTITY stroke_color "#666666">
      <!ENTITY fill_color "#FFFFFF">
      ]>
      Then, in the objects of the SVG (path, rec ...), these colors can be
      directly associated by referencing these variables:


      <path fill="&fill_color;" stroke="&stroke_color;" stroke-width="4" ...

      Sugar can then change the fill color dynamically when hovering over the icon.

      Note: To generate its own icons, free software Inkscape is very suitable.

    • Create the file in the directory activity.info theorie.activity / activity that contains:

      [Activity]
      name = Theorie
      service_name = Theorie
      bundle_id = Theorie
      class = theorie.Theorie
      icon = activity-theorie
      activity_version = 1
      host_version = 1
      show_launcher = yes
      With:

      • class name of the Python class that inherits from the class Activity of Sugar
      • icon the name of the icon of the activity without the extension SVG>
    • Create or copy the file setup.py by putting the name of the activity by setting the start method:
      #!/usr/bin/env python
      from sugar.activity import bundlebuilder
      if __name__ == "__main__":
      bundlebuilder.start("TheorieActivity")

      This makes Python file operations such as:

      • the installation of the activity in development environment (create the directory operations of a link to the directory of the activity developed):
        python setup.py dev
        Thus, it is not useful at each change Python code to recreate the file to deploy XO.
      • la création ou la mise à jour du fichier MANIFEST (qui contient les noms de tous les fichiers du projet) pour la création du fichier XO :
        python setup.py fix_manifest
        Voici le contenu du fichier MANIFEST situé à la racine du répertoire de l'activité :

        setup.py
        theorie.py
        commun.py
        modele.py
        modele_data.py
        observable.py
        canvas_instrument.py
        canvas_clarinette.py
        canvas_flute.py
        canvas_guitare.py
        canvas_harmonica.py
        canvas_piano.py
        composant_notes.py
        composant_degres.py
        composant_comparaison.py
        composant_selection.py
        composant_affichage.py
        composant_clarinette.py
        composant_flute.py
        composant_guitare.py
        composant_harmonica.py
        composant_piano.py
        clarinette.svg
        gpl.txt

        activity/activity.info
        activity/theorie.activity.svg

      • la création du fichier XO pour la distribution de l'application :
        python setup.py dist_xo
    • Transformation de l'application PyGtk en activité Sugar :
      Le programme original utilise une seule fenêtre GTK . Le point d'entrée du programme PyGtk est une classe héritant de gtk.Window :

      class ComposantTheorie(gtk.Window):

      def __init__(self):
      gtk.Window.__init__(self)
      self.set_title(« Théorie musicale – Instruments de musique »)
      # creation des composants
      SET_AFF(MOD_NOT)
      SET_CMP(MOD_OCT)
      compGAM = ComposantGammes()
      compACC = ComposantAccords()
      compNOT = ComposantNotes()
      compSEL = ComposantSelection(« », [compGAM, compACC, compNOT], gtk.POS_LEFT)
      notes = compGAM.getNotes()
      compCMP = ComposantComparaison(notes)
      compHAR = ComposantHarmonica(notes)
      compFLU = ComposantFlute(notes)
      compGUI = ComposantGuitare(notes)
      compCLA = ComposantClarinette(notes)
      # recuperation des dimensions de l'ecran
      lar = screen_width()
      hau = screen_height()
      # composition de l'ecran suivant sa hauteur (en pixels)
      if hau <= 480:
      compAFF = ComposantAffichage(« », notes, [compGUI , compHAR, compFLU, compCLA, compCMP], gtk.POS_TOP)
      else:
      compINS = ComposantAffichage(TXT_ONG_INS, notes, [compGUI, compHAR, compFLU, compCLA], gtk.POS_BOTTOM)
      compAFF = ComposantAffichage(« », notes, [compINS, compCMP], gtk.POS_TOP)
      paned = definirVPANED(compSEL.getContainer(), compAFF.getContainer())
      self.add(paned)
      # affichage en plein ecran ou non
      if lar <= 1024 or hau <= 600:
      self.fullscreen()
      else:
      self.set_size_request(1024,600)
      # gestion des evenements compSEL.addObserver(compAFF)
      self.connect(« destroy », gtk.main_quit)
      self.show_all()

      Le programme est ensuite lancé par le code suivant :

      if __name__ == "__main__":
      try:
      import psyco
      psyco.full()
      except ImportError:
      print "'Psyco' introuvable !"
      try:
      import gc
      gc.enable()
      gc.collect()
      except:
      print "Garbage collector error !"
      obj = ComposantTheorie()
      gtk.main()

      Le programme doit être modifié :

      • la classe principale
        doit hériter de activity.Activity (et non de gtk.Window );
      • il faut ajouter la barre d'outil standard des activités;
      • il faut associer le contenu de la fenêtre du programme PyGtk à l'activité par l'intermédiaire de la méthode set_canvas de la classe Activity ;
      • compte-tenu du fait que Sugar se charge de démarrer l'activité :
        • le code de l'activité ne doit pas contenir de gtk.Main() (lancement du programme et gestion des événements);
        • le code relatif à Psyco et au garbage collector est déplacé dans le constructeur de l'activité.

      Which gives:

      class Theorie(activity.Activity):
      ...
      def __init__(self, handle):
      # initialisations (initialisation de l'activite + creation de la toolbox)
      activity.Activity.__init__(self, handle)
      toolbox = activity.ActivityToolbox(self)
      self.set_toolbox(toolbox)
      toolbox.show()
      # recuperation du maximum de memoire
      try:
      import gc
      gc.enable()
      gc.collect()
      except:
      pass
      # activation de Psyco
      try:
      import psyco
      psyco.full()
      except:
      pass
      # creation des composants specifiques a l'application
      self.set_title("Théorie musicale - Pratique des instruments de musique")
      SET_AFF(MOD_NOT)
      SET_CMP(MOD_OCT)
      # creation des onglets gammes, accords, notes
      compGAM = ComposantGammes()
      compACC = ComposantAccords()
      compNOT = ComposantNotes()
      compSEL = ComposantSelection("", [compGAM, compACC, compNOT], gtk.POS_TOP)
      # recuperation des notes initiales
      notes = compGAM.getNotes()
      # creation des onglets instruments et theorie
      compHAR = ComposantHarmonica(notes)
      compFLU = ComposantFlute(notes)
      compGUI = ComposantGuitare(notes)
      compCLA = ComposantClarinette(notes)
      compPIA = ComposantPiano(notes)
      compINS = Composant Affichage(TXT_ONG_INS, notes, [compGUI, compHAR, compFLU, compCLA, compPIA], gtk.POS_BOTTOM)
      compCMP = ComposantComparaison(notes)
      compAFF = ComposantAffichage("", notes, [compINS, compCMP], gtk.POS_TOP)
      panedUI = definirVPANED(compSEL.getContainer(), compAFF.getContainer())
      # liaison 'evenement' entre les deux zones
      compSEL.addObserver(compAFF)
      # ajout de l'ensemble des composants dans la zone ecran de l'activite
      self.set_canvas(panedUI)
      # gestion des evenements 'clavier' self.connect('key-press-event', self.__keyPress)

    • Gestion des touches de l'écran pour une utilisation en mode replié :
      Curieusement, les touches des deux PADs (disposées à gauche et à droite de l'écran) ne permettent pas dans leur configuration par défaut de piloter le logiciel entièrement : naviguer d'un contrôle à l'autre, activer une case à cocher… Le comportement des touches a donc ét
      é modifié pour que le logiciel puisse être piloté sans le clavier :

      • naviguer entre les différents contrôles;
      • pouvoir sélectionner ou désélectioner une case à cocher ou un bouton à état.

      Le principe est exactement le même que pour réagir aux autres touches du clavier :
      il suffit d'associer à l'événement key-press-event du contrôle considéré une fonction ayant comme paramètre le widget et l'événement.

      Pour exemple, voici le code pour que les cases à cocher puissent être cochées ou décochées en appuyant sur les touches de gauche et de droite du PAD disposé à droite de l'écran.
      self.hKEY = self.checkREL.connect("key-press-event", self.__keyPress)
      Avec self.checkREL , la case à
      cocher et self.__keyPress la méthode à appeler.


      def __keyPress(self, widget, event):
      key = gtk.gdk.keyval_name(event.keyval)
      if key in ['KP_Home', 'KP_End']:
      active = widget.get_active()
      widget.set_active(not active)
      return True
      return False

      PyGtk fournit les méthodes get_active() et set_active() pour changer l'état de la case à cocher.

      Autre exemple de code pour faire en sorte que les boutons du haut et du bas du PAD de gauche permettent de passer d'un contrôle à l'autre :


      class Theorie(activity.Activity):
      ...
      def __keyPress(self, widget, event):
      key = gtk.gdk.keyval_name(event.keyval)
      if key == 'KP_Page_Up':
      widget.get_toplevel().child_focus(gtk.DIR_TAB_BACKWARD)
      return True
      elif key == 'KP_Page_Down':
      widget.get_toplevel().child_focus(gtk.DIR_TAB_FORWARD)
      return True
      return False

    • Pour lancer le programme, deux possibi
      lités :

      • en mode développement :
        python setup.py dev pour installer l'application dans le menu sous la forme d'un lien (les fichiers *.py ne sont pas copiés dans le répertoire principal des activités)
      • lorsque le développement est terminé :
        • python setup.py dist_xo pour créer le package XO (fichier compressé ZIP);
        • sugar-install-bundle pour installer le package XO dans le menu (copie physique des fichiers nécessaires dans le répertoire des activités).

Documents ou liens utiles