• mikael

    @PatoNegro, please see and potentially add to this issue.

    posted in Pythonista read more
  • mikael

    @cbanta, what is the exception? Install the fault handler to find out.

    posted in Pythonista read more
  • mikael

    @kami, NavigationView is challenging overall, to the extent that I have never really understood its value over some custom navigation. You can Google ”pythonista NavigationView” to review some of the discussions.

    That said, I think you need to track the loaded view manually. E.g. modify the connect function to store the loaded view or its name to a separate variable, maybe as an attribute of the NavigationView itself.

    For accessing a specific label in a view, the standard way is to set the name attribute, either in the UI Editor or in the code where you create the label, and then locating it by my_view['my_label_name'].

    posted in Pythonista read more
  • mikael

    @dgelessus, on iPhone the undo is available by long-pressing the rightmost aux key, :.

    Not very convenient when you need to do it several times, but still better than shaking.

    posted in Pythonista read more
  • mikael

    @jacobengland16, I use a simple script that uses SSH to send the whole working directory to Raspberry Pi. It then runs the code remotely on the Pi and displays the (textual) results.

    Very handy for when you develop on the iPhone, and want a very tight feedback loop for deployment and testing.

    Let me know if this is relevant and I will share the script.

    posted in Pythonista read more
  • mikael

    @robopu, no, it sounds to me like this topic is not what you are after although you will need to use objc_util for that as well.

    For adding characters around highlighted text, I would recommend using additional keys above the keyboard. As a sample, check MarkdownView. There, look at create_accessory_toolbar method. As a sample of adding specific characters around the selected text, look at insert_character method.

    Changing the background of selected text uses "attributed strings" - there are threads on that, but below is an example for the background color. Check this thread for other formatting options.

    import ui
    from objc_util import *
    
    @on_main_thread
    def change_background():
      red = UIColor.yellowColor()
      mystring = ObjCClass('NSMutableAttributedString').alloc() 
      teststring = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tincidunt facilisis dapibus.'
      mystring.initWithString_(teststring)
      mystring.setAttributes_range_({'NSBackgroundColor': red}, NSRange(28, 11)) # start, length
      tv = ui.TextView()
      tvc = ObjCInstance(tv)
      tvc.attributedText = mystring 
      tv.present()
      
    change_background()

    posted in Pythonista read more
  • mikael

    @cvp, very interesting. I think I will be needing this soon.

    posted in Pythonista read more
  • mikael

    This came out pretty rad, if I may use the term.

    Editing in Markdown, I can just type [x], and a checkbox pops out to hover over it. Tapping the checkbox changes the text underneath to [ ] and back. I can select and delete the checkbox because it is actually the underlying text that gets deleted.

    Other ideas for ”active text” that would go beyond Apple’s data recognizers for phone numbers etc.?

    posted in Pythonista read more
  • mikael

    @dominik, I was not really suggesting that you try to use sqlalchemy-internal module this way, unless you find a clear documentation supporting it in their docs.

    I trust you saw the discussion in the other MySQL thread that just popped up?

    posted in Pythonista read more
  • mikael

    @cvp, rect.size is in this case just the size of the caret, i.e. roughly right height but very thin.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!