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.
Outliner with drag/drop reordering - part 2
-
@cvp I seem to have just stumbled on a bug. When I touch the outline number of one of the items in order to get the pop-up menu ,instead of showing it for the line I touch, it shows it for one of the items in the middle of the outline. It shows this item no matter which one I touch. There may also be a related bug which is this particular outline item has a long line of text and the pop-up menu tries to show this entire line which pushes the right hand part of the menu off the screen
-
@ihf said:
Script gets an error:
Weird. I don't have any problem with this little script.
Could you check if code is identical no retry after a restart of Pythonista? Before testing any other script -
@ihf said
I seem to have just stumbled on a bug. When I touch the outline number of one of the items in order to get the pop-up menu ,instead of showing it for the line I touch, it shows it for one of the items in the middle of the outline. It shows this item no matter which one I touch. There may also be a related bug which is this particular outline item has a long line of text and the pop-up menu tries to show this entire line which pushes the right hand part of the menu off the screen
Do you have this problem with new V 01.14version?
Where do you see in the popup window for which line it is?
-
@ihf popup window:
- at top, tapped outline
- at bottom, last copied text, stored in file outline.clipboard, able to be pasted
-
@cvp I tried the above script again after restarting Pythonista and I get the same error about a missing objective-C class. I presume you are running iOS 15?
-
@cvp I’m in landscape mode and the line I’m talking about is to the left of hide children in the pop-up menu. The interesting thing is that this line which is one line of an outline isn’t going away regardless of which item I touch even if I change outlines. It even persists if I start a new outline and touch 1.0 in the new outline.
-
@ihf said:
I presume you are running iOS 15
Yes.
aren't you?
But this ObjectiveC class exists from ios4...
Did you try on a device where Pythonista is authorized to access calendar?Could you try on iPad please?
Edit: same problem as you on my iPhone.
-
@ihf said:
I’m in landscape mode and the line I’m talking about is to the left of hide children in the pop-up menu. The interesting thing is that this line which is one line of an outline isn’t going away regardless of which item I touch even if I change outlines. It even persists if I start a new outline and touch 1.0 in the new outline
Ok, understood, you didn't say you work with horizontal popup (which has a bug). Will correct it.
-
@ihf V01.15 and outline.versions with
Version V01.15 - when copy selected rows, outlines and texts are also copied in standard IOS PasteBoard for eventual paste in another app - correction of bug "left title of horizontal popup does not show the tapped outline but the text of another line, even from a previous file"
-
@cvp I just tested the copy/paste function and got a strange result. I selected two lines that were at level one in an outline and then I created a new outline and did a paste. I got the two lines, the first at level one and the second at level 2.15.
-
@ihf V01.16 and outline.versions with
Version V01.16 - correction of bug "paste lines of same level gave bad numbering results" - correction of bug "popup option paste crashes if no dates defined in copied lines"
-
@JonB Perhaps could you know why
EKEventEditViewController = ObjCClass('EKEventEditViewController').new().autorelease()
Gives this error, on some devices only (IOS 15.0.2 Pythonista v3.3 330025)
Solved: needs load_framework('EventKitUI') but why on some devices only? Perhaps different startup.
File "/var/containers/Bundle/Application/8778D1CF-1C08-48BA-9714-9D2CFE524EA1/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 429, in __init__ raise ValueError('no Objective-C class named \'%s\' found' % (name,)) ValueError: no Objective-C class named 'b'EKEventEditViewController'' found
-
@ihf did you test the paste in another app? Is that like you hoped?
-
@cvp yes, I also pasted discontiguous parts of an outline to another app and it looks perfect. Thanks!
-
@ihf at least one good news
-
@ihf did you test my little script of the standard iOS calendar event edit on iPad?
And, if yes, do you like this standard screen?
If it does not work on iPhone, I would need to program a part of the fields and we would need to decide which ones. -
@cvp The traceback I posted above is from my iPad.
-
@ihf Thus the problem may occur on iPad or iPhone. I don't understand why objc_until could be different.
Solved: needs (sometimes?)
load_framework('EventKitUI')
Script edited
Thus, please, try it and tell me if you would be happy with this event editer .
-
I need help...
Next script works correctly, event is canceled or added but my delegate method is not called.
What is wrong? Thanks for helping me.import ui from objc_util import * load_framework('EventKitUI') EKEventEditViewController = ObjCClass('EKEventEditViewController') def eventEditViewController_didCompleteWith_(_self, _cmd, _controller, _action): controller = ObjCInstance(_controller) action = ObjCInstance(_action) print(action) controller.dismissViewControllerAnimated_completion_(True, None) try: MyEventEditViewDelegate = ObjCClass('MyEventEditViewDelegate') except: MyEventEditViewDelegate = create_objc_class( 'MyEventEditViewDelegate', methods=[eventEditViewController_didCompleteWith_,], protocols=['EKEventEditViewDelegate'] ) @on_main_thread def EventEdit(title=None): v = ui.View() if title: v.name = title v.rgb = None vc = ObjCInstance(v) store = ObjCClass('EKEventStore').alloc().init() calendar = None for cal in store.calendars(): #print(cal.title()) if str(cal.title()) == 'Outline': calendar = cal break EventEditViewController = EKEventEditViewController.new().autorelease() #print(dir(EventEditViewController)) EventEditViewController.editViewDelegate = MyEventEditViewDelegate.alloc().init() EventEditViewController.eventStore = store event = ObjCClass('EKEvent').eventWithEventStore_(store) event.title = 'Todo: text line' event.setCalendar_(calendar) EventEditViewController.event = event clview = EventEditViewController.view() w,h = ui.get_screen_size() v.frame = (0,0,w,h) vc.addSubview_(clview) v.present('fullscreen') #v.wait_modal() return EventEdit()
-
@cvp Perhaps i have not thought this through, but would the event editor be used to set the default for events or would it be used to edit any event that has been added? If the latter, then I’m not sure what the advantage is to performing the edit within Pythonista as opposed to going to the calendar and editing it.