mansrz / pymt

Automatically exported from code.google.com/p/pymt
0 stars 0 forks source link

MTList vertical scrolling broken #275

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When scrolling vertically *only*, it resets the list position after releasing 
the touch that triggered the scrolling.

See this modified code from the example:

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(cols=1)
for x in xrange(22):
    btn = MTToggleButton(label='label%d' % x)
    btn.connect('on_press', curry(test_button, btn))
    layout.add_widget(btn)

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

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

runTouchApp(anchor)

Original issue reported on code.google.com by dennd...@gmail.com on 4 Jul 2010 at 3:24

GoogleCodeExporter commented 9 years ago
Also, what's wrong with this code?
I can neither scroll the list nor is the on_press handler executed when I press.

                layout = MTBoxLayout(orientation='vertical')
                suggestions = self.spelling.suggest(self.words[index])
                btns = [MTButton(label=s, auto_height=True) for s in suggestions]
                layout.add_widgets(*btns)
                print btns
                lst = MTList(pos=(200, 200), size=(200, 500), do_y=True)
                lst.add_widget(layout)
                for btn in btns:
                    btn.connect('on_press', curry(self.replace_word, index, btn.label, lst))
                self.add_widget(lst)

Original comment by dennd...@gmail.com on 4 Jul 2010 at 4:05

GoogleCodeExporter commented 9 years ago
This code work: 
from pymt import *

# center the list on the screen
layout = MTBoxLayout(orientation='vertical')
suggestions = ['bb', 'pokapzdoakd', 'mlkmlk']
btns = [MTButton(label=s, auto_height=True) for s in suggestions]
layout.add_widgets(*btns)
lst = MTList(pos=(200, 200), size=(200, 500), do_x=False)
lst.add_widget(layout)
'''
for btn in btns:
    btn.connect('on_press', curry(self.replace_word, index, btn.label, lst))
'''

runTouchApp(lst)

So i don't known what the problem in your case.
Provide a test case that failed (like the start), and open a new issue if you 
still have the trouble :)

Original comment by txprog on 6 Jul 2010 at 12:33

GoogleCodeExporter commented 9 years ago
Closed via GitHub: 
http://github.com/tito/pymt/commit/ff5336bda14e07f922309ea12ce63598080d85ce

klist: fix animation when the list is out of the bounds on Y axis (fixe issues 
275)

Original comment by txprog on 6 Jul 2010 at 12:35