Features/GTK3/API wish list

From Sugar Labs
< Features‎ | GTK3
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


There are a lot of code copy/pasted in the activities, and we can provide a easier API to new/occasional developers. Would be good use the change to GTK3 to improve our small sugar-toolkit/sugar APIs This pages is right now, to discuss ideas, and collect useful information.


The Activity Team


Toolbar items factory methods

Walter use in his activities factory methods to create buttons, separators, entry, etc. This remove a lot of duplicated code. Example:

def _label_factory(label, toolbar):
    Factory for adding a label to a toolbar 
   my_label = gtk.Label(label)
   _toolitem = gtk.ToolItem()
   toolbar.insert(_toolitem, -1)
   return my_label

def _entry_factory(length, toolbar, callback):
    Factory for adding a text enrty to a toolbar 
   my_entry = gtk.Entry()
   my_entry.connect('changed', callback)
   _toolitem = gtk.ToolItem()
   toolbar.insert(_toolitem, -1)
   return my_entry

We can add methods like create_button, create_label and create_entry to the toolbar

Code to enable/disable power management

Many activities have code to deal with pm.

Code to recognize XO-1, XO-1.5, XO-1.75 and other hardware

A few activities repeat code to recognize hardware.

More problems ahead http://dev.laptop.org/ticket/11116