• simonh

    I don't see what syntax highlighting has to do with running documents as scripts. Surely they are two separate issues?

    posted in Editorial read more
  • simonh

    So Editorial has a syntax mode for HTML, CSS and JavaScript, but not Python? JSON would be useful too.

    posted in Editorial read more
  • simonh

    @omz I've been thinking about picking up Working Copy but not sure how well it works with Pythonista. If it had really solid integration I'd be perfectly happy for you to hand off the details of the git client implementation to them and keep your focus on actual Pythonista feature development and core platform service support such as iCloud sync. That's a perfectly reasonable line to take IMHO.

    posted in Pythonista read more
  • simonh

    Direct GitHub synchronisation? That would be a real game changer for Pythonista.

    posted in Pythonista read more
  • simonh

    Apple Watch has much more processing power than Apollo 11.

    posted in Pythonista read more
  • simonh

    Just as a precaution, I regularly use the export function to mail myself a zip archive of my working folder. I've never needed to use it yet, but it gives me peace of mind.

    posted in Pythonista read more
  • simonh

    Are there any plans to implement this? I'm writing a mapping utility for a science fiction game and this would be a very valuable feature.

    posted in Pythonista read more
  • simonh

    Heres a code sample. If you comment out the three lines creating and adding the label the view looks fine. I need to add subviews because I'm trying to create a grid-style table of labels and values.

    import ui
    
    class MyTableViewDataSource (object):
        def tableview_number_of_sections(self, tableview):
            # Return the number of sections (defaults to 1)
            return 1
    
        def tableview_number_of_rows(self, tableview, section):
            # Return the number of rows in the section
            return 3
    
        def tableview_cell_for_row(self, tableview, section, row):
            # Create and return a cell for the given section/row
            cell = ui.TableViewCell()
            #cell.text_label.text = 'Foo Bar' # uncomment to switch behaviours
            label = ui.Label()      # comment out to switch behaviour
            label.text = 'mylabel'  # comment out to switch behaviour
            cell.add_subview(label) # comment out to switch behaviour
            return cell
    
    data_source = MyTableViewDataSource()
    tv = ui.TableView()
    tv.data_source = data_source
    mv = ui.View()
    mv.add_subview(tv)
    mv.present()
    

    posted in Pythonista read more
  • simonh

    That does the trick in the example. I can't use it directly in the real code because I'm putting several labels into the cell, but it should just be a matter of calculating the required frame geometries for the labels. Thanks!

    • update. The workaround works fine for my use case. I set the label frame to the cell bounds, then offset .x and .width as required. Looks perfect!

    posted in Pythonista read more
  • simonh

    I've had a few goes finding something in Google but no luck. Can someone post, or point me to a basic example of a ScrollView in use. I can't seem to figure out how it should be used. I want to create a map that dynamically populated with tiles as you scroll the view, but can't get past square 1 of getting the view working.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!