×
Namespaces

Variants
Actions

Archived:How to use PieSlice in PySymbian - Part 1

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

This is a continuation of the article Archived:How to use PieSlice in PySymbian- Part 1. The main purpose of this article is to show that a pie slice can be used as a progress bar to indicate the system busy indication.

Article Metadata
Tested with
Devices(s): Nokia N95 8G, Nokia N96
Compatibility
Platform(s): S60 1st Edition, S60 2nd Edition, S60 3rd Edition
Article
Keywords: appuifw, time, math, graphics
Created: james1980 (30 Dec 2008)
Last edited: hamishwillee (08 May 2013)

Code Snippet

import e32
import time
import appuifw
import graphics
import math
can=appuifw.Canvas()
appuifw.app.body=can
img=graphics.Image.new(can.size)
img.clear(0xffffff)
running=1
def quit():
global running
running=0
appuifw.app.exit_key_handler=quit
while running:
 
for i in range(180):
k=1.417*i
j=(0,k,k)
i=(i*math.pi)/90
img.pieslice((50,50,100,100),0.0,math.pi/180+i,outline=None,fill=j)
 
img.pieslice((60,60,90,90),0.0,math.pi/180+i,outline=None,fill=0xffffff)
 
can.blit(img)
e32.ao_sleep(0.001)
 
for i in range(180):
k=1.417*i
j=(0,255-k,255-k)
i=(i*math.pi)/90
#can.clear(0xffffff)
img.pieslice((50,50,100,100),0.0,math.pi/180+i,outline=None,fill=j)
 
img.pieslice((60,60,90,90),0.0,math.pi/180+i,outline=None,fill=0xffffff)
can.blit(img)
e32.ao_sleep(0.01)
e32.ao_yield()

See Also

To do

Add comments to the source

This page was last modified on 8 May 2013, at 09:16.
37 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×