-
(UI) Wishlist?
After two weeks of playing with Python I feel finally that developing a Symbian app is easy. Being a C/Java programmer/teacher I must confess Python is really a wonderful and powerful language and it invites people to program. Finally, no rss, mmp, buggy software and inflexible compilers anymore ;-)
However, on the other hand, looking at the OPL sourceforge project and .Net CF on that other platform ;-) I feel something is fundamentally lacking in this port: good direct graphics/canvas programming. Has anyone starting looking into extending Python in this area?
Are there any other UI wishes amongst you out there?
-
What kind of features are you interested in for graphics/canvas work? And are there any existing Python graphics packages that you already work with?
-
[QUOTE][i]Originally posted by eriksmartt [/i]
[B]What kind of features are you interested in for graphics/canvas work? [/B][/QUOTE]
I'm not the original poster but I'd like to say something about this subject.
At the moment I have an idea for a little program that would fetch some data from an internet site and present it as well as possible given the screen size. The optimal situation would be to use the whole screen and both custom font and font rendering. I am not into speed so almost any way to put pixels on the screen is acceptable.
For another little project I would need sound for alerting or a way trigger the "normal" alert on the phone. Also sound input and/or very limited speech-to-text could be useful.
These things are probably trivial with a c++ module, but unfortunately I am not familiar with Symbian programming. Is the SDK only for Windows or is it possible to work with OS X (or Linux)?
-
Just like in J2ME...
[QUOTE][i]Originally posted by eriksmartt [/i]
[B]What kind of features are you interested in for graphics/canvas work? And are there any existing Python graphics packages that you already work with? [/B][/QUOTE]
I have no experience with Python GUI programming but I'm aware of the existence of tinker (?)and tcl stuff. What I just want are drawing capabilities like in J2ME or OPL: drawing bitmaps/gifs/etc, lines, boxes etc.
I personally find the solution of calling a content handler when a gif or a different format is to be shown not always the most apropriate solution.
-
PIL (Python Imaging Library) is the standard graphics library in the Python world. It's available here:
[url]http://www.pythonware.com/products/pil/[/url]
It's very easy to use. Making a thumbnail from an image is as simple as this:
import Image
im = Image.open('image.jpg')
tn = im.resize((80, 60), Image.ANTIALIAS)
tn.save('thumbnail.jpg')
You can also draw an image from scratch:
import Image, ImageDraw
im = Image.new('RGB', (120, 80))
dr = ImageDraw.Draw(im)
dr.rectangle((0,0,40,80), fill=0xff0000)
dr.rectangle((40,0,80,80), fill=0xffffff)
dr.rectangle((80,0,120,80), fill=0x0000ff)
im.save('frenchflag.bmp')
It would be nice to have it on Series 60, maybe a limited subset or a similar API for the existing graphics libraries of the platform.
-
canvas
[QUOTE][i]Originally posted by eriksmartt [/i]
[B]What kind of features are you interested in for graphics/canvas work? And are there any existing Python graphics packages that you already work with? [/B][/QUOTE]
I personally like and use VPYTHON:
[url]http://vpython.org[/url]
on the desktop. On a small device I would like to have some basic plotting functionalities which - for example - gnuplot provides. Alternatively SVG graphics would suffice for many other purposes.
-
J2ME equivalent
Many developers are familiar with what's available in J2ME. It may be a good idea to have the same API which will aid migration from J2ME.
Python GUI API on big screen may not match well with mobile phone screen. We need a strip down version.
Another approach could be simply give a thin layer to Symbain C++ UI API. Someone will develop a good python API on top of that. Then we rewrite it in C++ for performace. (But flexibility is more important initially)
-
Re: J2ME equivalent
[QUOTE][i]Originally posted by korakotc [/i]
[B]Another approach could be simply give a thin layer to Symbain C++ UI API. Someone will develop a good python API on top of that. Then we rewrite it in C++ for performace. (But flexibility is more important initially) [/B][/QUOTE]
This is my thinking as well. There are a number of existing Python packages for screen drawing, but I don't think there is a single one that really owns the space. Given that, I'm guessing that Python developers are learning new graphics API's all the time, and probably changing from time to time based on project needs.
Wrapping the native drawing API's means you'll have to learn something new and specific to Series 60 (for now), but the operations should be fast.