@@ -0,0 +1,1304 @@
+# coding: utf-8%0A%0A# See: http://omz-forums.appspot.com/pythonista/post/5774800525983744%0A%0Aimport ui%0A%0Aclass ButtonView(ui.View):%0A    def __init__(self, title=None):%0A        w, h = ui.get_screen_size()%0A        self.frame = (0, 0, w, h)%0A        self.counter = 0%0A        self.add_subview(self.make_button(title))%0A    %0A    def action(self, sender):%0A        self.counter += 1%0A        sender.title = str(self.counter)%0A%0A    def make_button(self, title=None):%0A        button = ui.Button(frame=self.bounds, title=title or 'Tap me!')%0A        button.action = self.action%0A        button.flex = 'WH'%0A        button.frame = self.bounds%0A        return button%0A%0Aif __name__ == '__main__':%0A    single_button = False%0A%0A    if single_button:%0A        ButtonView().present()%0A    else:%0A        import string%0A        view = ui.View()%0A        view.present()%0A        buttons_per_row = 13%0A        buttons_per_col = 2%0A        w = view.width / buttons_per_row%0A        h = view.height / buttons_per_col%0A        for i, letter in enumerate(string.lowercase):%0A            button_view = ButtonView(title=letter)%0A            #button_view.border_width = 1%0A            #button_view.border_color = 'white'%0A            button_view.frame = (i %25 buttons_per_row * w, i / buttons_per_row * h, w, h)%0A            view.add_subview(button_view)%0A        %0A

Create ButtonView.py