[Sugar-devel] TreeView in Sugar

Wade Brainerd wadetb at gmail.com
Thu Nov 5 18:00:18 EST 2009


On Thu, Nov 5, 2009 at 8:12 AM, Walther Neuper <neuper at ist.tugraz.at> wrote:
> Hi,
>
> working on a "ReckonPrimer"-activity we face a design issue, which seems
> to be related to Sugars principles on GUI design, and we ask for your
> opinion and your help.
>
> # Sugar establishes the Journal as primary means to retrieve activities
> and related data, thus replacing filebrowsers for good reasons.
> # In the activity under construction we have a collection of 10 - 100
> units (called exercises) with the following properties:
>   * each unit needs a line/row for representation (with several
> parts/columns)
>   * the units can be grouped by the user (groups recursively nested)
>   * child rows of a group can be collapsed and expanded
>
> Now two questions:
> (1) The properties mentioned above suggest to represent a collection as
> a kind of a filebrowser --- would this be in line with Sugars general
> design principles ?

Sounds more like a standard gtk.TreeView to me.  Pippy, Log, and other
activities have examples of this widget in action.

> (2) If yes for (1), do we have to implement a TreeView from scratch
> (p.214 ff in http://www.pygtk.org/pygtk2tutorial/index.html) --- or is
> there already something similar available in Sugar, in some activity ?

It's not from scratch, it's just something you have to do using the
PyGTK API - the same way you would add a Button or a Label to your
activity, you add a TreeView.  This API is a little bit complex
compared to the other widgets, but once you get the hang of it it's
quite simple to create TreeViews.

Best,
Wade


More information about the Sugar-devel mailing list