| Issue 275: | MTList vertical scrolling broken | |
| 1 person starred this issue and may be notified of changes. | Back to list |
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)
Jul 6, 2010
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 :)
Jul 6, 2010
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)
Status:
Done
|
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)