Keyboard ui button.
@shinya.ta If the syntax error comes from the last line, I had made a copy/paste error, please check the two last lines versus the edit script above
I tried it, but iPad can show next emji, but I couldn't display it on iPhone.
I would like to display multiple windows at the same time and edit the text.
Can I make it with Pythonisa?
I don't know how to send pictures here.
If you see the picture, I think you can see the image.
@shinya.ta To post here a picture, I use this little script:
import pyimgur,photos,clipboard,os,console i=photos.pick_image() if i: print(i.format) format = 'gif' if (i.format == 'GIF') else 'jpg' i.save('img.'+format) clipboard.set(pyimgur.Imgur("303d632d723a549").upload_image('img.'+format, title="Uploaded-Image").link) console.hud_alert("link copied!") os.remove('img.'+format)
You have to
- run this script
- the program will ask you to pick a picture from your camera roll
- the program sends the picture to imgur site and copy the url in the clipboard
- here, in the forum, you paste this url from the clipboard in a post
- that's all, it takes some seconds
@shinya.ta If the 'next emoji' is not displayed on iPhone, it is perhaps a problem of screen width (sorry, I can't test it), you could try to put a shorter title to this button, like
UIBarButtonItem = ObjCClass('UIBarButtonItem').alloc().initWithTitle_style_target_action_('⏩',0,bb_target,sel('invokeAction:')).autorelease()
If you parametrized big characters in your iPhone settings, the system does not have sufficient room to display this button
It was difficult to send a photo to me because it was difficult to send.
So, I will explain in writing.
Can I open multiple windows at the same time with Pythonisa so that I can open multiple tasks with a computer?
@shinya.ta you can run multiple threads to process several tasks at once but you will have only one UI, user interface, thus not really multiple windows active at the same time.
@shinya.ta Apple's doc says:
Custom items can be added to the shortcuts bar on iPad only. On iPhone, the contents of the UITextInputAssistantItem object are ignored.
I see, I'll try to open it on GitHub.
@shinya.ta you can always
- tap raw
- select all
- paste it into your (new) script in Pythonista
Thank you. I'll try it on the weekend.
You are God.
@shinya.ta Try it before saying that, you'll perhaps regret it 😇
I am not sure if it is related to this program, but if you use voiceover on Pythonisa, there will be a sound that is irrelevant to the prediction conversion.
Why is this?
@shinya.ta I'm really sorry but I don't understand your post.
First of all, if your problem occurs when you start Pythonista, even outside my script, please try to describe with a maximum of details the problem in a new topic,assuming it is a Pythonista bug, thus for @omz
If the problem occurs only in my script, stay in this topic but give, please , more info's.
The same thing happened in the script on GitHub.
Is it better to make a topic with another topic?
@shinya.ta Ok, try first in this topic, but, please, give a maximum infos about the problem
I tried the spractin.
I was able to do it well both on iPhone and iPad.
Thank you very much.
I'm a little greedy, but is it possible to use the following programs mixed?
import ui from objc_util import * def NextFieldKeyInTextFieldKeyboard(view, button, background_color='lightgray'): # parameters: view = main view of textfields # button = ui.Button designed by user (size, title, image...) # background_color = background_color of InputAccessoryView # create ui.View for InputAccessoryView above keyboard v = ui.View() # view above keyboard v.background_color = background_color # background_color of user choice v.width = ui.get_screen_size() # width of screen, thus of keyboard v.height = button.height + 4 # only for Next button # code executed when Next key is tapped def Next_tapped(sender): s = sender.objc_instance.firstResponder()._nextKeyResponder().becomeFirstResponder() button.action = Next_tapped # code to be executed if button tapped v.add_subview(button) # set as subview of view vo = ObjCInstance(v) # get ObjectiveC object of v # attach to each textfield an InputAccessoryView abobe the keyboard for sv in view.subviews: # loop on all subviews of main view if 'TextField' in str(type(sv)): # subview is a TextField tfo = ObjCInstance(sv).textField()# get ObjectiveC object of sv tfo.setInputAccessoryView_(vo) # attach our accessory to textfield if __name__ == '__main__': main_view = ui.View() main_view.name = 'NextFieldKeyInTextFieldKeyboard' main_view.frame = (0,0,380,140) main_view.add_subview(ui.TextField(frame=(10, 2,360,32))) main_view.add_subview(ui.TextField(frame=(10, 36,360,32))) main_view.add_subview(ui.TextField(frame=(10, 70,360,32))) main_view.add_subview(ui.TextField(frame=(10,104,360,32))) button = ui.Button() # Button for Next key button.frame = (0,0,32,32) button.font = ('<System-Bold>',24) button.title = '⏯' # emoji as title NextFieldKeyInTextFieldKeyboard(main_view,button)#,background_color='green') main_view.present('sheet')
If possible, I would like to edit multiple Text views.