On Sun, Jul 20, 2008 at 2:02 AM, Dirk Meyer <[EMAIL PROTECTED]> wrote:
> "Chandan Pitta" wrote:
> > More questions (sorry I decided to use my weekend to understand candy). I
> am
> > trying to create a grid of Text widgets, but Grid requries a template.
> What
> > is that? Can't I simply pass None?
>
> A grid _does_not_ take a list of widgets to be shown, it gets a list
> of something (e.g. in Freevo a Menu object) and iterates over this
> list and creates the widgets. To do that it need a template how to
> create widgets from it. Look at flickr.py, the list of of type
> Image(object) with a title and a thumbnail attribute.
>
I see. This makes sense. I guess I will have to do a paradigm shift in the
way I think about graphics :). One thing I thought was odd is that the grid
has its own animation. Is it possible to make the animation read from xml? I
mean we could have a default animation, but what if a theme wants to animate
the scrolling differently? Say change the duration of animation or make the
animation bounce (view slightly overshoots the destination and snaps back).
>
> You can create a template by calling the class function
> create_template. This is a thread-safe function which creates an
> object that can create a widget. This template is used for all cells
> in the grid.
>
> | template = Text.create_template(text=..., font=..., color=..., align=...)
>
> It is a bit complicated, I know. It is much easier if you use the xml
> based definition, in that case you always create templates.
>
> > grid = Grid(None, (100,500), (100, 100), "item", items, None,
> > SelectableGrid.VERTICAL)
> > self.stage.add(grid)
>
> SelectableGrid .... maybe you also want to take a look at
> freevo/WIP/gui/gui/widgets/listing.py.
>
Right, I was trying to wrap Grid in a SelectableGrid that will have a
selector to choose an item.
>
> > Also the doc string for Grid says that you can use None for size, but
> that
> > is wrong. It requires values because it calculates number of row and
> cols.
>
> Ooops, that is wrong.
>
>
> Dischi
>
> --
> People say I'm a bad influence. I say the world is already pretty
> messed up - I'm just adding to it.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Freevo-devel mailing list
> Freevo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freevo-devel
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel