Issue 263: Nested layouts are unbearably slow
Status:  Fixed
Owner:
Closed:  Jun 2010
Project Member Reported by dennd...@gmail.com, Jun 22, 2010
See:

from pymt import *

# callback for the buttons
def test_button(btn, *largs):
    print 'button pressed', btn.label

# create a grid layout with 2 rows
layout = MTGridLayout(rows=1)
for x in xrange(22):
    box = MTBoxLayout()
    grid = MTGridLayout(cols=2, rows=2)
    grid.add_widgets(MTLabel(label="foo"))
    grid.add_widgets(MTLabel(label="bar"))
    grid.add_widgets(MTLabel(label="baz"))
    grid.add_widgets(MTLabel(label="bum"))
    box.add_widget(grid)
    box.add_widget(MTLabel(label="bla"))
    #btn = MTToggleButton(label='label%d' % x)
    #btn.connect('on_press', curry(test_button, btn))
    layout.add_widget(box)

# create a list of 400x200 size, and disable scrolling on Y axis
lst = MTList(width=getWindow().width, do_y=False)
lst.add_widget(layout)

# center the list on the screen
anchor = MTAnchorLayout()
anchor.add_widget(lst)

runTouchApp(anchor)

Jun 22, 2010
Project Member #1 thomas.h...@gmail.com
Yes, this happens because we use absolute positionuing for a ll widgets...instead of relative!

if one thing changes, the whole layout has to be recomputed
Jun 22, 2010
Project Member #2 txprog
Actually, no.
The MTList children are relative. If the list move, the children are not moved.

The issue occur because on_move/on_resize are always call. I'm trying to known why.
Jun 22, 2010
Project Member #3 txprog
Very hard to track, here is a little patch to see some things.
http://paste.pocoo.org/show/228716/

Thomas, can you fix & handle layout fixes ?
If not, tell us, then we can known.

8 days left before the beta
Jun 27, 2010
Project Member #4 thomas.h...@gmail.com
fixed, needs reviews
Status: Fixed
Jul 2, 2010
Project Member #5 txprog
(No comment was entered for this change.)
Labels: Milestone-0.5