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.
Patched get_keyboard_frame and convert_point
-
here is a subclassable RootView which aims to fix two bugs in the ui module, and add another missing feature.
convert_point
that works in all presentation types and orientations. Existing ui module breaks infullscreen
, so this version fixes that.get_keyboard_frame
that works properly in all orientations. Existing ui modules version doesn't.- adds a
get_orientation
, to get screen orientation.
Running as a script shows an example, which displays convert point results for screen touches, and draws a box around the keyboard frame to show that keyboard frame is reportd correctly.
Undocking/splitting the keyboard (bottom right button on ios keyboard) shows that this works properly even for keyboards which have been undocked.Note that, because this has to be implemented as a view in order for the orientation and keyboard frame to work, you need to call
RootView.__init__(self)
if subclassing. Also, there is one ui bug that I can't fix, which is that the keyboard frame sometimes reports incorrect values the first time it is shown. To fix that, see the example, which shows how to display, then hide the keyboard. After that, everything works swell. -
https://github.com/jsbain/uicomponents/blob/master/RootView.py link gives me a 404
-
@JonB, seems like you have added another
.py
at the end<br>
@ltddev, file is located here: https://github.com/jsbain/uicomponents/blob/master/RootView.py.py -
Whoops. Original link is fixed now.