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.
pythonista UI
-
-
This time, I added the following code.
I selected the emoji I read aloud and put it in the task bar.
When the Text View is blank, when you press the cursor move button, there is an error.
What's the cause?
#็ตตๆๅญใฟในใฏใใผ
def typeChar(sender):
'''finds active textinput, and types the button's title'''
tf=sender.objc_instance.firstResponder()
tf.insertText_(sender.title)#create normal keys
buttons=[]
for button_title in '๐๐๐ฑ๐ฆโ๏ธ':
buttons.append(ui.Button(title=button_title,action=typeChar))#create special keys
def prev(sender):
'''simulates 'tab' key, go to next field '''
s=sender.objc_instance.firstResponder()._previousKeyResponder().becomeFirstResponder()
buttons.append(ui.Button(image=ui.Image.named('iob:ios7_arrow_back_32'),action=prev))def next(sender):
'''simulates 'tab' key, go to next field '''
s=sender.objc_instance.firstResponder()._nextKeyResponder().becomeFirstResponder()
buttons.append(ui.Button(image=ui.Image.named('iob:ios7_arrow_forward_32'),action=next))'''set up toolbar'''
keyboardToolbar=ObjCClass('UIToolbar').alloc().init()
keyboardToolbar.sizeToFit()
keyboardToolbar.items = [ObjCClass('UIBarButtonItem').alloc().initWithCustomView_(b) for b in buttons]#attach our accessory to the textfield, and textview.
tv.objc_instance.setInputAccessoryView_(keyboardToolbar)v.present('sheet')
tv.selected_range = (0,0)
tv.begin_editing() -
@shinya.ta Is she able to select the text and to tap the spell button?
-
I think training is necessary, but I think it's possible.
-
@shinya.ta add "i = 0" before "for c..." in "def IndexToPos..." as here-under
def IndexToPos(type): tvo = ObjCInstance(tv) # build array index -> position in range idxtopos = [] pre_x = -1 #print(tv.text) i = 0 for c in tv.text:```
-
Thank you very much.
We were able to solve it immediately.
There is a "โ๏ธโถ๏ธ" in the task bar, so I don't think that's necessary.
I'm trying to remove it, but I'm not sure which one I should turn off. -
I want to increase the type of emoji in the task bar, but when I try to increase the number of emoji, the original emoji will hide and I can't display them.
-
@shinya.ta Try this
#create special keys def prev(sender): '''simulates 'tab' key, go to next field ''' s=sender.objc_instance.firstResponder()._previousKeyResponder().becomeFirstResponder() buttons.append(ui.Button(image=ui.Image.named('iob:ios7_arrow_back_32'),action=prev)) def next(sender): '''simulates 'tab' key, go to next field ''' s=sender.objc_instance.firstResponder()._nextKeyResponder().becomeFirstResponder() buttons.append(ui.Button(image=ui.Image.named('iob:ios7_arrow_forward_32'),action=next)) #create normal keys d = 32 dd = 4 w, h = ui.get_screen_size() vv = ui.View() vv.background_color = 'lightgray' h = 0 x = dd y = dd for button_title in '๐๐๐ฑ๐ฆโ๏ธ๐๐๐๐๐๐ ๐๐คฃโบ๏ธ๐๐๐๐๐๐๐๐ฅฐ๐๐๐๐๐๐๐๐๐คช๐คจ๐ง๐ค๐๐คฉ๐ฅณ๐๐๐๐๐๐๐โน๏ธ๐ฃ๐๐ซ๐ฉ๐ฅบ๐ข๐ญ๐ค๐ ๐ก๐คฌ๐คฏ๐ณ๐ฅต๐ฅถ๐ฑ๐จ๐ฐ๐ฅ๐๐ค๐ค๐คญ๐คซ๐คฅ๐ถ๐๐๐ฌ๐ฆ๐ง๐ฎ๐ฒ๐ด๐คค๐ช๐ต๐ค๐ฅด๐คข๐คฎ๐คง๐ท๐ค๐ค๐ค๐ค ๐': b = ui.Button(title=button_title,action=typeChar) b.frame = (x,y,d,d) b.font = ('.SFUIText', d) if (y+d+dd) > h: h = y + d + dd vv.add_subview(b) x = x + d + dd if (x+d+dd) > w: x = dd y = y + d + dd vv.frame = (0,0,w,h) #attach our accessory to the textfield, and textview. tvo = tv.objc_instance tvo.setInputAccessoryView_(ObjCInstance(vv)) v.present('sheet') tv.selected_range = (0,0) tv.begin_editing()
-
-
@shinya.ta you are sure you have not removed your
def typeChar(sender): '''finds active textinput, and types the button's title''' tf=sender.objc_instance.firstResponder() tf.insertText_(sender.title)
-
It was successful.
By using this task bar, I think my wife can write a message happily.
Thank you very much.
-
@shinya.ta You could even add your "own" buttons in this taskbar...
-
@shinya.ta Thรฉ script here-under will allow you to test the Apple standard speech module, and this code supports, I hope, all emojis. Thus, I suppose that my other scripts has a bug for combined emojis. I'll try to correct it in a close future.