Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
[share/in work] side bar replacement
-
Here is a little class to mimic the old sidebar presentation style from pythonista's past.
https://gist.github.com/8e872d12349ed11484ead7632d4859ad
Not quite a perfect replica, but a functional quick attempt. This resizes the detail window (editor view) as the sidebar width is changed. I realize this probably should live a little lower down the view heirarchy, but this way was easy and robust.
-
@JonB , thanks for sharing. Works well. My mind goes blank when I see the objc calls. But you are not passing on the kwargs to the super. I added the super call at the end of the init to override some of your defaults, like alpha and bg_color. While bg_color was changed alpha did not. I am not sure if it has to do with the way you create the view. I am just not sure, I thought I would point it out anyway.
-
@JonB I used your 'sidebar.py' to resurrect 'editmenu'. The extended side bar 'sidebar2.py' at:
https://gist.github.com/9ea9e4c36e1df21177ca15c743d135bf
is functionally and visually identical to 'editmenu.py' except that it no longer calls 'Find and Replace'. I also put the results from 'finddocstring' into a 'popover' since 'editor._set_toolbar(v)' has been removed. 'INDENTSTR' is no longer defined so I set it to four spaces. For those who prefer the 'real TAB' 'Indent Selection' can be easily modified to accommodate the 'Tab' character. You really investigate the Pythonista ui to its deepest end and teach me a lot with very little effort on my part. Thank you very much. -
What does ObjCInstance(self).tag=hash('SideBar') do?
-
@filippocld , I don't know. But possibly a dynamically added attr called tag storing the hash of SideBar
-
It allows a check so we can avoid creating two sidebars. It there is already a sidebar, we delete it and spawn the new one. UIViews have a tag attribute, which is sort of like the name attribute of ui.Views, except that it accepts an integer, hence the hash.
-
Long live HyperCard