views:

266

answers:

2

Hi,

I am very new to PyS60. I was testing how to set an application to full screen mode but unfortunately, it doesn't work as expected. I tested the script on Nokia 6120 Classic. Here is what I did:

appuifw.app.screen = 'full'

What I get is a half screen of my application with a plain white colour below. What am I doing wrong? Thanks in advance.

A: 

If you haven't already, I would advise using the latest version of PyS60 from https://garage.maemo.org/frs/?group_id=854 and trying again.

Do the other two screen modes work as they are supposed to?

QuickRecipesOnSymbianOS
+4  A: 

Make sure you define own functions for screen redraw and screen rotate callbacks. When you rotate the device, you have to manually rescale everything to fit the new screen size. Otherwise you might get that "half of screen" effect.


    canvas = img = None

    def cb_redraw(aRect=(0,0,0,0)):
        ''' Overwrite default screen redraw event handler '''
        if img:
            canvas.blit(img)

    def cb_resize(aSize=(0,0,0,0)):
        ''' Overwrite default screen resize event handler '''
        global img
        img = graphics.Image.new(canvas.size)

    appuifw.app.screen = 'full'
    canvas = appuifw.Canvas(
        resize_callback = cb_resize,
        redraw_callback = cb_redraw)
    appuifw.app.body = canvas
JOM
I had just this problem and your solution works perfectly. Thank you so much!
Acorn