[sugar] Pie menus for pygtk and OLPC Sugar!

Marco Pesenti Gritti mpg
Fri Feb 23 05:04:09 EST 2007


On Thu, 2007-02-22 at 01:55 -0800, Don Hopkins wrote:
> I've translated my fancy OpenLaszlo pie menu component to 
> Python/gtk/cairo, so they work with the OLPC Sugar user interface!
> 
> These pie menus have an adaptive layout algorithm, that support linear 
> menus which can lay out in all four directions, pie menus, and hybrid 
> pie/linear menus (automatically limiting the number of pie items to 8, 
> and formatting overflow items in as linear menu items below the pie).
> 
> I'm just learning pygtk, so they aren't as integrated or as fleshed out 
> as they should be yet, and they don't actually do anything but print 
> debugging messages so far, but this is a good first cut that's demoable.
> 
> I like the cairo drawing module! It's easy to use, and the graphics and 
> feedback highlighting looks nice.
> 
> It's all written in one file of Python code.
> You should be able to run the demo, which is included in the file, just 
> by going "python piemenu.py" on an OLPC or Python system with pytgk and 
> cairo installed.
> 
> I'd really appreciate it if anyone who knows pygtk would look at the 
> code and give me some feedback about what I'm doing wrong and how to 
> improve them, please.
> 
> Next I have to flesh out input tracking and notification, and figure out 
> how to send events during tracking when they pop up, the mouse moves, 
> item changes, when items are selected, sub menus are selected, etc.
> And then of course there's a some frosting to implement like keyboard 
> navigation, submenu browsing, screen edge handling, accessibility, popup 
> animation, titles, tooltips, icons, shaped windows, disabled items, etc.
> Also I'd like to integrate them with glade and the persistence stuff so 
> you can load them in from xml files, edit them with a property sheet, 
> and even edit live menus with direct manipulation, etc.

Hello,

this looks pretty cool!

I just wanted to mention Sugar is not going to use gtk widgets (and
glade) as the official/supported way to build activities UI. We are
developing a set of controls based on HippoCanvas.

Compared to gtk widgets it's lighter, it integrates better with cairo,
it has more powerful layout support and can also embed gtk widgets. On
the down side it's far from gtk maturity, the only documentation is code
at the moment and it miss basic features we will have to implement down
the road (mainly focus).

It looks like adapting your pie menus implementation to HippoCanvas
would be trivial.

Marco



More information about the Sugar-devel mailing list