@technoway , thanks. I know it has limited value. I use it for part of a basic in file search program I made. The search program is basic, just searches for a word in all my files, I present a list of file names in a ui.TableView. Then if I want to look into a file, I bring up this viewer , to see if it what I was looking for. So for that purpose its good for me. I wanted to update the search program, so I separated this out first. It was a bit of a mess :)
@AddledBadger , the beta version of Pythonista ships with module called arrow. Really simplifies date and time manipulation. If you are not on the beta version but have installed StaSH, you could pip install arrow yourself. Knowing that when the beta makes it to the App Store, arrow will be included. arrow docs StaSH
Look this is not as easy as what the other guys suggest if you dont have arrow installed. I understand why they dont suggest it. Anyway, its another way.
Lol, ok I can see this topic generated as much interest as watching grass grow :).
But at least to give something visual, i did the below. Just using a static form here with no chance to give feedeback because the form is just sitting as a json file in a github repo. Baby steps :)
I still like the idea/concept though. Maybe I am alone on this one! Again, this not what I described above. I just thought If i could do a static example, may give it more context. BTW, the recipe in the example is real and fantastic. It was from YouTube, I should have put the link in, but again this is just an example. No interaction is possible with this simple example. But I think you could see how there could be.
_form_raw_url = '''https://raw.githubusercontent.com/Phuket2/ui_forms/master/MicrowaveEggRecipe.json'''
resp = requests.get(_form_raw_url, timeout=5)
if resp.status_code != 200:
v = ui.load_view_str(json.dumps(resp.json()))
v["_dismiss"].action = close_action
Thank you! (Removing reprlib, revealed 4 more packages that must have been added by some package I installed. After they were all removed, all is working again). If that happens again, I now know where to look.
Thanks omz. I ended up using the total play time to wait.
I had thought of that, but polling for a time with short sleeps, so that the wait can be interrupted, is probably less efficient than a notification, although admittedly only slightly so. It certainly is a lot simpler.
Here is a simple dialog template that uses a pyui file created using designer. This helps to use ui controls like images, textviews, segmentedcontrol in dialogs. The gist with sample pyui file is here. I hope it helps
TKInter is a desktop GUI module that accepts mouse input, while the iPhone is a touch based UI. This means there are some interactions and gestures that don't map across between them. For example the phone interface has no analogue of right-click or click-and-drag. Similarly the desktop interaction model has no analogue of a long-press or swipe.
You can arbitrarily try and assign mappings between some of these, so you could say long press equals right-click, but that might work fine in one application but poorly in another in which long-click might need to be used for another gesture such as to select something for drag-and-drop. No one mapping will work for every application, but at the framework level to make something portable you'd need to have fixed mappings.
Then you have the issue that the phone doesn't have a concept of floating windows, re-sizable windows, overlapping windows, floating dialogs and menus, scroll bars and many others. How do you do shift-click or control-click on a phone? Conversely on the phone you have conventions like swiping from the edge of the screen and multi-touch gestures. There are very good reasons why even Apple's own OSX GUI framework was not ported directly to iOS.
It is possible to write UI toolkits from scratch that are designed to map across between touch and desktop paradigms. The way to do this is to identify a subset of gestures and interactions in both models and creating strict mappings between them at the toolkit level. This gives you the portability, but at a cost of sacrificing the ability to use interactions that can't be deterministic-ally mapped to the other platforms. Unfortunately TKInter wasn't designed in terms of sacrificing desktop GUI capabilities in order to make the subset portable to phones, so it has a lot of GUI paradigm interactions and display widgets included that don't port over.