| Reply | « Previous Thread | Next Thread » |
|
Hi.
I'm trying to draw in a background python process. In API reference, graphics module, it says: "The module is usable from both graphical Python applications and background Python processes." But I don't know how to do this. I'm trying launching a script like: Code:
while running: e32.ao_sleep(3) canvas=Canvas() app.body=canvas drc=Draw(canvas) drc.line((30,40),(100,40),outline=0,fill=0) e32.ao_yield() Perhaps this is'nt the correct way for launching a background process, but I do'nt know any other way... I need to draw some text from a background process to the mobile main screen, as I have seen in others pure symbian apps. Any idea? Thanks in advance. Using python 1.1.6 over Nokia 7610 |
| canopus961 |
| View Public Profile |
| Find all posts by canopus961 |
|
The reference to background processes refers to processes started with e32.start_server, not normal applications that are just temporarily not visible.
There is currently no way to draw onto the screen from Python if the application is not visible. |
|
A clarification: You can of course any time draw to an in-memory Image and blit it onto the screen when your application returns to the foreground. See the redraw_callback parameter of Canvas.
|
|
OK, thanks for the answer.
I'm thinking on some way to draw to one image, save it, and set that image as wallpaper... I don't need much refresh rate. Other solution could be activate the background application from code when some event occurs, showing the new info... But I don't know if any of these solutions are possible. |
| canopus961 |
| View Public Profile |
| Find all posts by canopus961 |
|
I'm also interested in creating applications that draw to the phone's main screen.
(I would hope the finished application, once installed from a SIS, would be run from the menu, and simply disappear -- except for drawing on the phone's main screen -- until the process was ended by a utility or turning the phone off. Or perhaps it could have a configuration screen, also!) This might not have been possible back in 2005. Does anyone know if Python for S60 is capable of this now? Many thanks. |
|
Quote:
At least this seems to work. Upload it into your phone's \\python-directory, run it and switch it to background by pressing "application" key. "The counter" remains on the screen. Tested with E70. (BTW, there is no visible topwindow in E70 when keyboard is opened -> screen orientation is horizontal.) Code:
import TopWindow
global splash
splash = TopWindow.TopWindow()
splash.size = (200,100)
splash.position = (5,100)
splash.shadow = 3
splash.visible = 1
splash.corner_type = 'corner2'
splash.background_color = 0xcccccc
splash.show()
import graphics
import e32
import appuifw
def splash_text(text):
im = graphics.Image.new((200,100))
im.text((5,90),text, 0x000000)
splash.add_image(im, (0,0))
#e32.ao_sleep(0.01)
def quit():
app_lock.signal()
appuifw.app.exit_key_handler = quit
app_lock = e32.Ao_lock()
for i in range(10):
splash_text(u"%d" % (i))
e32.ao_sleep(1)
app_lock.wait()
splash.hide()
Last edited by aaaaapo : 2008-01-14 at 07:59.
Reason: Added code example
|
|
Thanks, aaaaapo. This is useful. I had a similar concept script going.
I think the main thing now is to determine whether it's possible to access the "true desktop" of the phone (sorry, I don't know the proper name for this). In other words, to write an application that functions in a similar way to Active Standby. Searching the forums, it seems there's talk of an undocumented Active Standby plugin API. Being able to extend Active Standby (with or without Python) would be really useful. --edit: seems that such plugins are only available for E-series phones. Check: http://nseries-mobile.blogspot.com/2...y-plugins.html This page directs users to a wishlist for plugins on standard S60 handsets: http://www.s60.com/life/wishlist/dis...0&activeCat=-2 -- Any thoughts on this? Thanks. |
|
Quote:
I also need an updating text in a topwindow, but my app crashes after 30 cycles, because I load jpg image. How to do it proper? PyNetMony - the ultimate War- and BlueWalking tool and 2G/3G Netmonitor http://pynetmony.googlepages.com/home
Last edited by carknue : 2008-07-21 at 21:51.
|
|
Quote:
I update "the splash screen" in my apps only about 10-20 times, so I have no crashing experiences. Perhaps this is a bug in TopWindow? I've no time to examine this better in the near future. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| A Graphics API for Python for Series 60 | nbsinner | Python | 4 | 2005-04-13 19:44 |
| Background Processes | ask@nokia | Mobile Java General | 1 | 2004-06-23 08:36 |
| BackGround Processes & Push Registry | isseyp | Mobile Java General | 0 | 2004-05-09 07:36 |
| Using the Graphics object outside of paint()? | weedy | Mobile Java General | 4 | 2003-06-06 11:03 |
| is there anyway to create a background graphics? | alexwei | Mobile Java General | 1 | 2003-02-27 09:57 |