I am trying to write Tkinter-like `GUI` library for iOS
Hey everyone, ShadowSlayer here. I've decided to post this thread, to give myself a little motivation. I am trying to write Tkinter-like
GUIlibrary (on top of Scene of course!) for Pythonista. Wish me luck! I will post all my updates here.
P. S. Maybe I won't success in this project, but at least I am going to try :)
Go for it. I certainly can find a use for it.
Sounds like a fun (and challenging) project, though you might want to wait for the 1.5 update. There will be a
uimodule that might be more suitable for this than
@omz, maybe, but I'd better start with what I have right now. If I understand the logic (which I probably already did), I will be able to later rewrite the library, using the
If 1.5 is Real Soon Now I'd wait. I assume the ui module has some resemblance to other modules in the same area?
Is there a way to force end the
yes. i think scene.end()
I was unable to find a
import inspect, scene print('\n'.join([member for member in inspect.getmembers(scene.Scene())]))
The other methods are documented in http://omz-software.com/pythonista/docs/ios/scene.html and Ole said he would add docs for
Scene.stop()here: http://omz-forums.appspot.com/pythonista/post/5822369738260480 If you add a
Scene.stop()method to your Scene, it will be called when the user clicks the X.
The only ways that I have found to really end a Scene are to tap the X in the upper right corner of the window or to launch another Scene. http://omz-forums.appspot.com/pythonista/post/5876387541942272
Not sure how close this is to what you're planning to do, but BashedCrab made a simple GUI toolkit named Hydrogen a while ago. You should probably take a look at it, it may be possible to build upon that instead of having to write everything up from scratch.
Guys, thanks for your tips :).
I am done writing simple Button&StaticText and StaticLink widgets. I will upload the code tomorrow and post the link to it here.
Ouch! I've got idea, how to implement Event system a little bit better. But I am getting very weird problems! Can someone help me? A bit hard to explain, you have to run file
ImportError: No module named events
EVT_TOUCH_BEGAN = 1 EVT_TOUCH_MOVED = 2 EVT_TOUCH_ENDED = 3
I could not quite figure out how to help you but:
- You might want to look at some advise that Ole provided on draggable images: http://omz-forums.appspot.com/pythonista/post/5144563366756352
- You can safely remove the
.keys()part of lines like:
if not id in self.children.keys(): # and return event_type in self.handlers.keys() # can be rewritten as: if not id in self.children: # and return event_type in self.handlers
key in dictat https://docs.python.org/2/library/stdtypes.html#dict
Hey all, I am back. Sorry for not writing anything for so long, I had damn lot of exams. I've finally fixed the problem, and now I have this draggable frame. Gonna add some more stuff and post the first version here soon.