• @JonB I try very hard not to swizzle anything...it sounds and feels dirty. I did do it once, I admit, in order to make the tableview have the tableView_willDisplayHeaderView_forSection_ method, so I could customize header display.

    I suspect you are right about why it isn't working. Using the string comparison is working well enough.

  • UIApplication.sharedApplication().keyWindow().rootViewController().showAccessoryWithAnimationDuration_(1)

    Is the equivalent of show_console. It certainly works with editor or panel, but very well might not work with fullscreen or sheet.

    What could work would be to find the view that contains the fullscreen view (by walking up the heirarchy in objc), and just shift the frame so it is partially off the screen, enough to get to underlying console. You may need to go up a few levels, as there may be some "shield" views. Basically, find the common ancestor to the console view and the presented fullscreen view, then resize the child leg that contains the presented view.

    I could be totally wrong.. it might be some kind of modal view controller that will prevent any other interaction.

    I usually use panel for this sort of thing -- you get the extra titlebar stuff, but you can easily go back and forth to console.

  • That makes sense, but they disappear from the easy_config display once a new choice has been made. My experience using the feature on two different iPads is the same. Once a new color selection is made, that particular control becomes permanently blank. Thereafter, when easy_config is used again, those previously used color controls remain blank. So I did an $ rm -r command and removed the StaSh folder and did a complete reinstall of StaSh in order to see those controls again—and this time left the 'tint' control alone. Success. I can see the cursor.

  • RESOLVED Thank you, much better.
    Best regards,
    Robert Buckley

  • no problem. for modules that define a main like that, that will work. in some cases, a module might have

    if __name__=='__main__': do_stuff()

    in which case, run_py is the way to go (python -m actually uses run_py under the hood)

  • @struct_engr_ , I think the problem is that for the past 6 months or so, no emails from this forum get actually sent. Neither the password resets or other notifications. @omz, any chance you could take a look?

  • The question is a little different, since he already has written to the console, and NOW wants to save it. Technically this can be done in 3 lines, so qualifies for ccc's ten lines or less....
    though i broke up the long string of method calls onto multiple lines to keep some semblance of readability.

    This is my save_session script which appends to a command history file ( making it easier to convert an interactive session into a real script), and writes the current console output to a new file. Feel free to adapt to your own needs.

    from objc_util import UIApplication from time import ctime # save history with open('history.py','a') as f: f.write(ctime()+'\n') f.write( '\n'.join([str(h) for h in UIApplication.sharedApplication().keyWindow(). rootViewController().accessoryViewController(). consoleViewController().history() ])+'\n') #save console output with open('console_history.txt','w') as f: f.write(ctime()+'\n') f.write(str( UIApplication.sharedApplication(). keyWindow().rootViewController(). accessoryViewController().consoleViewController(). consoleOutputTextView().text() ))
  • https://github.com/jsbain/objc_hacks with a "c" on the objc

  • @Tizzy that's a question for someone else. I have no idea.

  • Unless 1.6 works differently with flex at runtime, there seems to be a problem. I am setting a scrollview's flex to 'WH' in code. What worked in 1.5, does not work now. I had to set the frame explicitly. I tried a few things to get flex working, but it did not work.

    Setting the flex attribute of a top-level view (i.e. one that you call present() on) doesn't have any effect, and it never had. The size of a view that is presented in 'sheet' style used to be fixed in 1.5 (regardless of what you set as flex, it would be something around 540x500), and in 1.6, it reflects the size of the view's frame/bounds.

    I'm aware that this may require minor code changes in some cases, but I don't see any way around that, without giving up the flexibility of having differently-sized sheets, which I find very useful.

    I cannot see a place to change the console font. Not sure if I can't find it or you have not got around to it yet.

    Didn't get to that yet. If you want a bigger font, you can use console.set_font for now:

    console.set_font('Menlo', 20)
Internal error.

Oops! Looks like something went wrong!